CustusX  15.8
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxViewWrapper2D.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 /*
34  * cxViewWrapper2D.cpp
35  *
36  * \date Mar 24, 2010
37  * \author christiana
38  */
39 
40 
41 #include "cxViewWrapper2D.h"
42 #include <vector>
43 #include <vtkCamera.h>
44 #include <vtkRenderer.h>
45 #include <vtkRenderWindow.h>
46 
47 #include <QAction>
48 #include <QActionGroup>
49 #include <QMenu>
50 #include <QMouseEvent>
51 #include <QWheelEvent>
52 
53 #include "cxUtilHelpers.h"
54 #include "cxView.h"
55 #include "cxSliceProxy.h"
56 #include "cxSlicerRepSW.h"
57 #include "cxToolRep2D.h"
60 #include "cxDisplayTextRep.h"
61 
62 #include "cxManualTool.h"
63 #include "cxViewManager.h"
64 #include "cxTrackingService.h"
65 #include "cxViewGroup.h"
66 #include "cxDefinitionStrings.h"
67 #include "cxSlicePlanes3DRep.h"
68 #include "cxDefinitionStrings.h"
69 #include "cxSliceComputer.h"
70 #include "cxGeometricRep2D.h"
71 #include "cxTexture3DSlicerRep.h"
72 #include "cxDataLocations.h"
73 #include "cxSettings.h"
74 #include "cxGLHelpers.h"
75 #include "cxData.h"
76 #include "cxMesh.h"
77 #include "cxImage.h"
78 #include "cxPointMetricRep2D.h"
79 
80 #include "cxViewFollower.h"
81 #include "cxVisServices.h"
82 #include "cx2DZoomHandler.h"
83 #include "cxNavigation.h"
84 #include "cxDataRepContainer.h"
85 #include "vtkRenderWindowInteractor.h"
86 #include "cxPatientModelService.h"
87 
88 
89 namespace cx
90 {
91 
93  ViewWrapper(backend),
94  mOrientationActionGroup(new QActionGroup(view.get()))
95 {
96  mView = view;
97  this->connectContextMenu(mView);
98 
99  // disable vtk interactor: this wrapper IS an interactor
100  mView->getRenderWindow()->GetInteractor()->Disable();
101  mView->getRenderer()->GetActiveCamera()->SetParallelProjection(true);
102  double clipDepth = 1.0; // 1mm depth, i.e. all 3D props rendered outside this range is not shown.
103  double length = clipDepth*10;
104  mView->getRenderer()->GetActiveCamera()->SetPosition(0,0,length);
105  mView->getRenderer()->GetActiveCamera()->SetClippingRange(length-clipDepth, length+0.1);
106  connect(settings(), SIGNAL(valueChangedFor(QString)), this, SLOT(settingsChangedSlot(QString)));
107 
108  // slice proxy
109  mSliceProxy = SliceProxy::create(mServices->getPatientService());
110 
111  mDataRepContainer.reset(new DataRepContainer());
112  mDataRepContainer->setSliceProxy(mSliceProxy);
113  mDataRepContainer->setView(mView);
114 
115  mViewFollower = ViewFollower::create(mServices->getPatientService());
116  mViewFollower->setSliceProxy(mSliceProxy);
117 
118  addReps();
119 
120  mZoom2D.reset(new Zoom2DHandler());
121  connect(mZoom2D.get(), SIGNAL(zoomChanged()), this, SLOT(viewportChanged()));
122  setOrientationMode(SyncedValue::create(0)); // must set after addreps()
123 
124  connect(mServices->getToolManager().get(), SIGNAL(activeToolChanged(const QString&)), this, SLOT(activeToolChangedSlot()));
125  connect(mView.get(), SIGNAL(resized(QSize)), this, SLOT(viewportChanged()));
126  connect(mView.get(), SIGNAL(shown()), this, SLOT(showSlot()));
127  connect(mView.get(), SIGNAL(mousePress(int, int, Qt::MouseButtons)), this, SLOT(mousePressSlot(int, int, Qt::MouseButtons)));
128  connect(mView.get(), SIGNAL(mouseMove(int, int, Qt::MouseButtons)), this, SLOT(mouseMoveSlot(int, int, Qt::MouseButtons)));
129  connect(mView.get(), SIGNAL(mouseWheel(int, int, int, int, Qt::MouseButtons)), this, SLOT(mouseWheelSlot(int, int, int, int, Qt::MouseButtons)));
130 
131  this->activeToolChangedSlot();
132  this->updateView();
133 }
134 
136 {
137  if (mView)
138  mView->removeReps();
139 }
140 
141 void ViewWrapper2D::appendToContextMenu(QMenu& contextMenu)
142 {
143  QAction* obliqueAction = new QAction("Oblique", &contextMenu);
144  obliqueAction->setCheckable(true);
145  obliqueAction->setData(qstring_cast(otOBLIQUE));
146  obliqueAction->setChecked(getOrientationType() == otOBLIQUE);
147  connect(obliqueAction, SIGNAL(triggered()), this, SLOT(orientationActionSlot()));
148 
149  QAction* ortogonalAction = new QAction("Ortogonal", &contextMenu);
150  ortogonalAction->setCheckable(true);
151  ortogonalAction->setData(qstring_cast(otORTHOGONAL));
152  ortogonalAction->setChecked(getOrientationType() == otORTHOGONAL);
153  connect(ortogonalAction, SIGNAL(triggered()), this, SLOT(orientationActionSlot()));
154 
155  //TODO remove actiongroups?
156  mOrientationActionGroup->addAction(obliqueAction);
157  mOrientationActionGroup->addAction(ortogonalAction);
158 
159  contextMenu.addSeparator();
160  contextMenu.addAction(obliqueAction);
161  contextMenu.addAction(ortogonalAction);
162  contextMenu.addSeparator();
163 
164  mZoom2D->addActionsToMenu(&contextMenu);
165 }
166 
168 {
170 
171  mZoom2D->setGroupData(group);
172  connect(group.get(), SIGNAL(optionsChanged()), this, SLOT(optionChangedSlot()));
173  this->optionChangedSlot();
174 }
175 
176 void ViewWrapper2D::optionChangedSlot()
177 {
178  ViewGroupData::Options options = mGroupData->getOptions();
179 
180  if (mPickerGlyphRep)
181  {
182  mPickerGlyphRep->setMesh(options.mPickerGlyph);
183  }
184 }
185 
189 void ViewWrapper2D::orientationActionSlot()
190 {
191  QAction* theAction = static_cast<QAction*>(sender());if(!theAction)
192  return;
193 
194  ORIENTATION_TYPE type = string2enum<ORIENTATION_TYPE>(theAction->data().toString());
195  mOrientationMode->set(type);
196 }
197 
198 
199 void ViewWrapper2D::addReps()
200 {
201  // annotation rep
202  mOrientationAnnotationRep = OrientationAnnotationSmartRep::New();
203  mView->addRep(mOrientationAnnotationRep);
204 
205  // plane type text rep
206  mPlaneTypeText = DisplayTextRep::New();
207  mPlaneTypeText->addText(QColor(Qt::green), "not initialized", Vector3D(0.98, 0.02, 0.0));
208  mView->addRep(mPlaneTypeText);
209 
210  //data name text rep
211  mDataNameText = DisplayTextRep::New();
212  mDataNameText->addText(QColor(Qt::green), "not initialized", Vector3D(0.02, 0.02, 0.0));
213  mView->addRep(mDataNameText);
214 
215  // tool rep
216  mToolRep2D = ToolRep2D::New(mServices->getSpaceProvider(), "Tool2D_" + mView->getName());
217  mToolRep2D->setSliceProxy(mSliceProxy);
218  mToolRep2D->setUseCrosshair(true);
219 // mToolRep2D->setUseToolLine(false);
220  mView->addRep(mToolRep2D);
221 
222  mPickerGlyphRep = GeometricRep2D::New("PickerGlyphRep_" + mView->getName());
223  mPickerGlyphRep->setSliceProxy(mSliceProxy);
224  if (mGroupData)
225  {
226  mPickerGlyphRep->setMesh(mGroupData->getOptions().mPickerGlyph);
227  }
228  mView->addRep(mPickerGlyphRep);
229 }
230 
231 void ViewWrapper2D::settingsChangedSlot(QString key)
232 {
233  if (key == "View/showDataText")
234  {
235  this->updateView();
236  }
237  if (key == "View/showOrientationAnnotation")
238  {
239  this->updateView();
240  }
241  if (key == "useGPU2DRendering")
242  {
243  this->updateView();
244  }
245  if (key == "Navigation/anyplaneViewOffset")
246  {
247  this->updateView();
248  }
249 }
250 
255 void ViewWrapper2D::resetMultiSlicer()
256 {
257  if (mSliceRep)
258  {
259  mView->removeRep(mSliceRep);
260  mSliceRep.reset();
261  }
262  if (mMultiSliceRep)
263  mView->removeRep(mMultiSliceRep);
264  if (!settings()->value("useGPU2DRendering").toBool())
265  return;
266 
267 // std::cout << "using gpu multislicer" << std::endl;
268  mMultiSliceRep = Texture3DSlicerRep::New();
269  mMultiSliceRep->setShaderPath(DataLocations::findConfigFolder("/shaders"));
270  mMultiSliceRep->setSliceProxy(mSliceProxy);
271  mView->addRep(mMultiSliceRep);
272  if (mGroupData)
273  mMultiSliceRep->setImages(mGroupData->getImages(DataViewProperties::createSlice2D()));
274  this->viewportChanged();
275 }
276 
280 void ViewWrapper2D::viewportChanged()
281 {
282  if (!mView->getRenderer()->IsActiveCameraCreated())
283  return;
284 
285  mView->setZoomFactor(mZoom2D->getFactor());
286 
287  double viewHeight = mView->getViewport_s().range()[1];
288  mView->getRenderer()->GetActiveCamera()->SetParallelScale(viewHeight / 2);
289 
290  // Heuristic guess for a good clip depth. The point is to show 3D data clipped in 2D
291  // with a suitable thickness projected onto the plane.
292  double clipDepth = 2.0; // i.e. all 3D props rendered outside this range is not shown.
293  double length = clipDepth*10;
294  clipDepth = viewHeight/120 + 1.5;
295  mView->getRenderer()->GetActiveCamera()->SetPosition(0,0,length);
296  mView->getRenderer()->GetActiveCamera()->SetClippingRange(length-clipDepth, length+0.1);
297 
298  mSliceProxy->setToolViewportHeight(viewHeight);
299  double anyplaneViewOffset = settings()->value("Navigation/anyplaneViewOffset").toDouble();
300  mSliceProxy->initializeFromPlane(mSliceProxy->getComputer().getPlaneType(), false, Vector3D(0, 0, 1), true, viewHeight, anyplaneViewOffset, true);
301 
302  DoubleBoundingBox3D BB_vp = getViewport();
303  Transform3D vpMs = mView->get_vpMs();
304  DoubleBoundingBox3D BB_s = transform(vpMs.inv(), BB_vp);
305  PLANE_TYPE plane = mSliceProxy->getComputer().getPlaneType();
306 
307  mToolRep2D->setViewportData(vpMs, BB_vp);
308  if (mSlicePlanes3DMarker)
309  {
310  mSlicePlanes3DMarker->getProxy()->setViewportData(plane, mSliceProxy, BB_s);
311  }
312 
313  mViewFollower->setView(BB_s);
314 }
315 
318 DoubleBoundingBox3D ViewWrapper2D::getViewport() const
319 {
320  QSize size = mView->size();
321  Vector3D p0_d(0, 0, 0);
322  Vector3D p1_d(size.width(), size.height(), 0);
323  DoubleBoundingBox3D BB_vp(p0_d, p1_d);
324  return BB_vp;
325 }
326 
327 void ViewWrapper2D::showSlot()
328 {
329  activeToolChangedSlot();
330  viewportChanged();
331 }
332 
333 void ViewWrapper2D::initializePlane(PLANE_TYPE plane)
334 {
335 // mOrientationAnnotationRep->setPlaneType(plane);
336  mPlaneTypeText->setText(0, qstring_cast(plane));
337 // double viewHeight = mView->heightMM() / mZoom2D->getFactor();
338  double viewHeight = mView->getViewport_s().range()[1];
339  mSliceProxy->initializeFromPlane(plane, false, Vector3D(0, 0, 1), true, viewHeight, 0.25);
340 // double anyplaneViewOffset = settings()->value("Navigation/anyplaneViewOffset").toDouble();
341 // mSliceProxy->initializeFromPlane(plane, false, Vector3D(0, 0, 1), true, 1, 0);
342  mOrientationAnnotationRep->setSliceProxy(mSliceProxy);
343 
344  // do this to force sync global and local type - must think on how we want this to work
345  this->changeOrientationType(getOrientationType());
346 
347  bool isOblique = mSliceProxy->getComputer().getOrientationType() == otOBLIQUE;
348  mToolRep2D->setUseCrosshair(!isOblique);
349 // mToolRep2D->setUseToolLine(!isOblique);
350 
351 }
352 
355 ORIENTATION_TYPE ViewWrapper2D::getOrientationType() const
356 {
357  return mSliceProxy->getComputer().getOrientationType();
358 }
359 
363 void ViewWrapper2D::orientationModeChanged()
364 {
365  ORIENTATION_TYPE type = static_cast<ORIENTATION_TYPE>(mOrientationMode->get().toInt());
366 
367 if (type == this->getOrientationType())
368  return;
369  if (!mSliceProxy)
370  return;
371 
372  SliceComputer computer = mSliceProxy->getComputer();
373  computer.switchOrientationMode(type);
374 
375  PLANE_TYPE plane = computer.getPlaneType();
376 // mOrientationAnnotationRep->setPlaneType(plane);
377  mPlaneTypeText->setText(0, qstring_cast(plane));
378  mSliceProxy->setComputer(computer);
379  }
380 
383 void ViewWrapper2D::changeOrientationType(ORIENTATION_TYPE type)
384 {
385  mOrientationMode->set(type);
386 }
387 
389 {
390  return mView;
391 }
392 
395 void ViewWrapper2D::imageAdded(ImagePtr image)
396 {
397  this->updateView();
398 
399  // removed this side effect: unwanted when loading a patient, might also be unwanted to change scene when adding/removing via gui?
400  //Navigation().centerToView(mViewGroup->getImages());
401 }
402 
404 {
405  QString text;
406  if (mGroupData)
407  {
408  std::vector<ImagePtr> images = mGroupData->getImages(DataViewProperties::createSlice2D());
409  ImagePtr image;
410  if (!images.empty())
411  image = images.back(); // always show last in vector
412 
413  if (image)
414  {
415  Vector3D c = image->get_rMd().coord(image->boundingBox().center());
416  mSliceProxy->setDefaultCenter(c);
417  }
418 
419  // slice rep
420  if (settings()->value("useGPU2DRendering").toBool())
421  {
422  this->resetMultiSlicer();
423  text = this->getAllDataNames(DataViewProperties::createSlice2D()).join("\n");
424  }
425  else
426  {
427  if (mMultiSliceRep)
428  {
429  mView->removeRep(mMultiSliceRep);
430  mMultiSliceRep.reset();
431  }
432 
433  if (!mSliceRep)
434  {
435  mSliceRep = SliceRepSW::New("SliceRep_" + mView->getName());
436  mSliceRep->setSliceProxy(mSliceProxy);
437  mView->addRep(mSliceRep);
438  }
439 
440  QStringList textList;
441  mSliceRep->setImage(image);
442 
443  // list all meshes and one image.
444  std::vector<MeshPtr> mesh = mGroupData->getMeshes(DataViewProperties::createSlice2D());
445  for (unsigned i = 0; i < mesh.size(); ++i)
446  textList << qstring_cast(mesh[i]->getName());
447  if (image)
448  textList << image->getName();
449  text = textList.join("\n");
450  }
451  }
452 
453  bool show = settings()->value("View/showDataText").value<bool>();
454  if (!show)
455  text = QString();
456 
457  //update data name text rep
458  mDataNameText->setText(0, text);
459  mDataNameText->setFontSize(std::max(12, 22 - 2 * text.size()));
460 
461  mOrientationAnnotationRep->setVisible(settings()->value("View/showOrientationAnnotation").value<bool>());
462 
463  mDataRepContainer->updateSettings();
464 // mViewFollower->ensureCenterWithinView();
465 }
466 
467 
468 
469 void ViewWrapper2D::imageRemoved(const QString& uid)
470 {
471  updateView();
472 }
473 
475 {
476  DataPtr data = mServices->getPatientService()->getData(uid);
477  DataViewProperties properties = mGroupData->getProperties(uid);
478 
479  if (properties.hasSlice2D())
480  this->dataAdded(data);
481  else
482  this->dataRemoved(uid);
483 
484 }
485 
486 void ViewWrapper2D::dataAdded(DataPtr data)
487 {
488  if (boost::dynamic_pointer_cast<Image>(data))
489  {
490  this->imageAdded(boost::dynamic_pointer_cast<Image>(data));
491  }
492  else
493  {
494  mDataRepContainer->addData(data);
495  }
496  this->updateView();
497 }
498 
499 void ViewWrapper2D::dataRemoved(const QString& uid)
500 {
501  mDataRepContainer->removeData(uid);
502  this->updateView();
503 }
504 
505 void ViewWrapper2D::activeToolChangedSlot()
506 {
507  ToolPtr activeTool = mServices->getToolManager()->getActiveTool();
508  mSliceProxy->setTool(activeTool);
509 }
510 
512 {
513  if (mOrientationMode)
514  disconnect(mOrientationMode.get(), SIGNAL(changed()), this, SLOT(orientationModeChanged()));
515  mOrientationMode = value;
516  if (mOrientationMode)
517  connect(mOrientationMode.get(), SIGNAL(changed()), this, SLOT(orientationModeChanged()));
518 
519  orientationModeChanged();
520 }
521 
526 void ViewWrapper2D::mousePressSlot(int x, int y, Qt::MouseButtons buttons)
527 {
528  if (buttons & Qt::LeftButton)
529  {
530  if (this->getOrientationType() == otORTHOGONAL)
531  {
532  setAxisPos(qvp2vp(QPoint(x,y)));
533  }
534  else
535  {
536  mClickPos = qvp2vp(QPoint(x,y));
537  this->shiftAxisPos(Vector3D(0,0,0)); // signal the maual tool that something is happening (important for playback tool)
538  }
539  }
540 }
541 
546 void ViewWrapper2D::mouseMoveSlot(int x, int y, Qt::MouseButtons buttons)
547 {
548  if (buttons & Qt::LeftButton)
549  {
550  if (this->getOrientationType() == otORTHOGONAL)
551  {
552  setAxisPos(qvp2vp(QPoint(x,y)));
553  }
554  else
555  {
556  Vector3D p = qvp2vp(QPoint(x,y));
557  this->shiftAxisPos(p - mClickPos);
558  mClickPos = p;
559  }
560  }
561 }
562 
563 
567 void ViewWrapper2D::mouseWheelSlot(int x, int y, int delta, int orientation, Qt::MouseButtons buttons)
568 {
569  // scale zoom in log space
570  double val = log10(mZoom2D->getFactor());
571  val += delta / 120.0 / 20.0; // 120 is normal scroll resolution, x is zoom resolution
572  double newZoom = pow(10.0, val);
573 
574  mZoom2D->setFactor(newZoom);
575 
576  Navigation(mServices).centerToTooltip(); // side effect: center on tool
577 }
578 
582 Vector3D ViewWrapper2D::qvp2vp(QPoint pos_qvp)
583 {
584  QSize size = mView->size();
585  Vector3D pos_vp(pos_qvp.x(), size.height() - pos_qvp.y(), 0.0); // convert from left-handed qt space to vtk space display/viewport
586  return pos_vp;
587 }
588 
592 void ViewWrapper2D::shiftAxisPos(Vector3D delta_vp)
593 {
594  delta_vp = -delta_vp;
595  ToolPtr tool = mServices->getToolManager()->getManualTool();
596 
597  Transform3D sMr = mSliceProxy->get_sMr();
598  Transform3D rMpr = mServices->getPatientService()->get_rMpr();
599  Transform3D prMt = tool->get_prMt();
600  Transform3D vpMs = mView->get_vpMs();
601  Vector3D delta_s = vpMs.inv().vector(delta_vp);
602 
603  Vector3D delta_pr = (rMpr.inv() * sMr.inv()).vector(delta_s);
604 
605  // MD is the actual tool movement in patient space, matrix form
606  Transform3D MD = createTransformTranslate(delta_pr);
607  // set new tool position to old modified by MD:
608  tool->set_prMt(MD * prMt);
609 }
610 
614 void ViewWrapper2D::setAxisPos(Vector3D click_vp)
615 {
616  ToolPtr tool = mServices->getToolManager()->getManualTool();
617 
618  Transform3D sMr = mSliceProxy->get_sMr();
619  Transform3D rMpr = mServices->getPatientService()->get_rMpr();
620  Transform3D prMt = tool->get_prMt();
621 
622  // find tool position in s
623  Vector3D tool_t(0, 0, tool->getTooltipOffset());
624  Vector3D tool_s = (sMr * rMpr * prMt).coord(tool_t);
625 
626  // find click position in s.
627  Transform3D vpMs = mView->get_vpMs();
628  Vector3D click_s = vpMs.inv().coord(click_vp);
629 
630  // compute the new tool position in slice space as a synthesis of the plane part of click and the z part of original.
631  Vector3D cross_s(click_s[0], click_s[1], tool_s[2]);
632  // compute the position change and transform to patient.
633  Vector3D delta_s = cross_s - tool_s;
634  Vector3D delta_pr = (rMpr.inv() * sMr.inv()).vector(delta_s);
635 
636  // MD is the actual tool movement in patient space, matrix form
637  Transform3D MD = createTransformTranslate(delta_pr);
638  // set new tool position to old modified by MD:
639  tool->set_prMt(MD * prMt);
640 }
641 
643 {
644  mSlicePlanes3DMarker = SlicePlanes3DMarkerIn2DRep::New("uid");
645  PLANE_TYPE plane = mSliceProxy->getComputer().getPlaneType();
646  mSlicePlanes3DMarker->setProxy(plane, proxy);
647 
648  DoubleBoundingBox3D BB_vp = getViewport();
649  Transform3D vpMs = mView->get_vpMs();
650  mSlicePlanes3DMarker->getProxy()->setViewportData(plane, mSliceProxy, transform(vpMs.inv(), BB_vp));
651 
652  mView->addRep(mSlicePlanes3DMarker);
653 }
654 
655 //------------------------------------------------------------------------------
656 }
QString qstring_cast(const T &val)
DoubleBoundingBox3D transform(const Transform3D &m, const DoubleBoundingBox3D &bb)
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:50
static SliceProxyPtr create(PatientModelServicePtr dataManager)
boost::shared_ptr< class SlicePlanesProxy > SlicePlanesProxyPtr
virtual void setOrientationMode(SyncedValuePtr value)
otOBLIQUE
orient planes relative to the tool space
Definition: cxDefinitions.h:50
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:62
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
virtual ViewPtr getView()
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:48
Superclass for ViewWrappers.
Definition: cxViewWrapper.h:93
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
Definition: cxSettings.cpp:87
static Texture3DSlicerRepPtr New(const QString &uid="")
boost::shared_ptr< class View > ViewPtr
virtual void setViewGroup(ViewGroupDataPtr group)
static DataViewProperties createSlice2D()
static SlicePlanes3DMarkerIn2DRepPtr New(const QString &uid="")
static OrientationAnnotationSmartRepPtr New(const QString &uid="")
virtual void setViewGroup(ViewGroupDataPtr group)
boost::shared_ptr< class Data > DataPtr
virtual void updateView()
static QString findConfigFolder(QString pathRelativeToConfigRoot, QString alternativeAbsolutePath="")
otORTHOGONAL
orient planes relative to the image/reference space.
Definition: cxDefinitions.h:50
static SyncedValuePtr create(QVariant val=QVariant())
ViewGroupDataPtr mGroupData
static SliceRepSWPtr New(const QString &uid="")
Transform3D createTransformTranslate(const Vector3D &translation)
virtual void dataViewPropertiesChangedSlot(QString uid)
virtual void initializePlane(PLANE_TYPE plane)
Settings * settings()
Shortcut for accessing the settings instance.
Definition: cxSettings.cpp:42
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
virtual void setSlicePlanesProxy(SlicePlanesProxyPtr proxy)
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:63
static GeometricRep2DPtr New(const QString &uid="")
VisServicesPtr mServices
QStringList getAllDataNames(DataViewProperties properties) const
RealScalar length() const
static DisplayTextRepPtr New(const QString &uid="")
boost::shared_ptr< class SyncedValue > SyncedValuePtr
Definition: cxViewGroup.h:51
static ToolRep2DPtr New(SpaceProviderPtr spaceProvider, const QString &uid="")
Definition: cxToolRep2D.cpp:79
void connectContextMenu(ViewPtr view)
static ViewFollowerPtr create(PatientModelServicePtr dataManager)
ViewWrapper2D(ViewPtr view, VisServicesPtr backend)
bool hasSlice2D() const
boost::shared_ptr< class Tool > ToolPtr