NorMIT-nav  22.09
An IGT application
cxViewWrapper3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 /*
13  * cxViewWrapper3D.h
14  *
15  * \date Mar 24, 2010
16  * \author christiana
17  */
18 #ifndef CXVIEWWRAPPER3D_H_
19 #define CXVIEWWRAPPER3D_H_
20 
21 #include "org_custusx_core_view_Export.h"
22 
23 #include <vector>
24 #include <QPointer>
25 #include <QObject>
26 #include "cxDefinitions.h"
27 #include "cxViewWrapper.h"
28 #include "cxForwardDeclarations.h"
29 #include "cxVector3D.h"
31 
32 class QAction;
33 typedef vtkSmartPointer<class vtkAnnotatedCubeActor> vtkAnnotatedCubeActorPtr;
34 typedef vtkSmartPointer<class vtkOrientationMarkerWidget> vtkOrientationMarkerWidgetPtr;
35 
36 namespace cx
37 {
38 typedef boost::shared_ptr<class Slices3DRep> Slices3DRepPtr;
39 typedef boost::shared_ptr<class DataMetricRep> DataMetricRepPtr;
40 typedef boost::shared_ptr<class MetricNamesRep> MetricNamesRepPtr;
41 
42 }
43 
44 namespace cx
45 {
46 typedef boost::shared_ptr<class ImageLandmarkRep> ImageLandmarkRepPtr;
47 typedef boost::shared_ptr<class PatientLandmarkRep> PatientLandmarkRepPtr;
48 typedef boost::shared_ptr<class MultiVolume3DRepProducer> MultiVolume3DRepProducerPtr;
49 typedef boost::shared_ptr<class AxisConnector> AxisConnectorPtr;
50 
57 typedef boost::shared_ptr<class ToolAxisConnector> ToolAxisConnectorPtr;
58 
59 
64 class org_custusx_core_view_EXPORT ViewWrapper3D: public ViewWrapper
65 {
66 Q_OBJECT
67 public:
68  ViewWrapper3D(int startIndex, ViewPtr view, VisServicesPtr services);
69  virtual ~ViewWrapper3D();
70  virtual ViewPtr getView();
71  virtual double getZoom2D() { return -1.0; }
72  virtual void setSlicePlanesProxy(SlicePlanesProxyPtr proxy);
73  virtual void setViewGroup(ViewGroupDataPtr group);
74  void setStereoType(int type);
75 
76 protected slots:
77  virtual void dataViewPropertiesChangedSlot(QString uid);
78  virtual void settingsChangedSlot(QString key);
79 private slots:
80  void showSlices();
81  void activeToolChangedSlot();
82  void toolsAvailableSlot();
83  void showSlicePlanesActionSlot(bool checked);
84  void fillSlicePlanesActionSlot(bool checked);
85  void showAxesActionSlot(bool checked);
86  void showManualToolSlot(bool visible);
87  void resetCameraActionSlot();
88  void activeImageChangedSlot(QString uid);
89  void showRefToolSlot(bool checked);
90  void showToolPathSlot(bool checked);
91  void pickerRepPointPickedSlot(Vector3D p_r);
92  void centerImageActionSlot();
93  void centerToolActionSlot();
94  void optionChangedSlot();
95  void showOrientationSlot(bool visible);
96  void setStereoEyeAngle(double angle);
97  void pickerRepDataPickedSlot(QString);
98  void updateView();
99 
100 protected:
101  virtual QString getDataDescription();
102  virtual QString getViewDescription();
103 
104 private:
105  virtual void appendToContextMenu(QMenu& contextMenu);
106  void readDataRepSettings(RepPtr rep);
107  void updateSlices();
108  NavigationPtr getNavigation();
109 
110  QAction* createSlicesAction(QString title, QWidget* parent);
111 
112  void createSlicesActions(QWidget *parent);
113  QAction* createSlicesAction(PlaneTypeCollection planes, QWidget* parent);
114 
115  void showLandmarks(bool on);
116  void showPointPickerProbe(bool on);
117  void setOrientationAnnotation();
118 
119  RepPtr createDataRep3D(DataPtr data);
120  DataMetricRepPtr createDataMetricRep3D(DataPtr data);
121 
122  void addVolumeDataRep(DataPtr data);
123  void removeVolumeDataRep(QString uid);
124 
125  void setTranslucentRenderingToDepthPeeling(bool setDepthPeeling);
126  void initializeMultiVolume3DRepProducer();
127  void updateMetricNamesRep();
128 
129  MultiVolume3DRepProducerPtr mMultiVolume3DRepProducer;
130  typedef std::map<QString, RepPtr> RepMap;
131  RepMap mDataReps;
132  LandmarkRepPtr mLandmarkRep;
133  PickerRepPtr mPickerRep;
134  MetricNamesRepPtr mMetricNames;
135  std::vector<AxisConnectorPtr> mAxis;
136 
137  bool mShowAxes;
138  Slices3DRepPtr mSlices3DRep;
139  SlicePlanes3DRepPtr mSlicePlanes3DRep;
140  OrientationAnnotation3DRepPtr mAnnotationMarker;
141 
142  ViewPtr mView;
143  RepPtr createTrackedStreamRep(TrackedStreamPtr trackedStream);
144 };
145 typedef boost::shared_ptr<ViewWrapper3D> ViewWrapper3DPtr;
146 
150 } // namespace cx
151 
152 #endif /* CXVIEWWRAPPER3D_H_ */
cx::RepMap
std::map< QString, RepPtr > RepMap
Definition: cxRepManager.h:30
cx::PlaneTypeCollection
Definition: cxPlaneTypeCollection.h:29
cx::Slices3DRepPtr
boost::shared_ptr< class Slices3DRep > Slices3DRepPtr
Definition: cxViewWrapper3D.h:38
cx::ViewWrapper3D::getZoom2D
virtual double getZoom2D()
Definition: cxViewWrapper3D.h:71
cx::PatientLandmarkRepPtr
boost::shared_ptr< class PatientLandmarkRep > PatientLandmarkRepPtr
Definition: cxViewWrapper3D.h:47
cx::ViewGroupDataPtr
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:29
cx::SlicePlanes3DRepPtr
boost::shared_ptr< class SlicePlanes3DRep > SlicePlanes3DRepPtr
Definition: cxForwardDeclarations.h:94
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxForwardDeclarations.h
cx::OrientationAnnotation3DRepPtr
boost::shared_ptr< class OrientationAnnotation3DRep > OrientationAnnotation3DRepPtr
Definition: cxForwardDeclarations.h:81
cxDefinitions.h
cx::VisServicesPtr
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
vtkAnnotatedCubeActorPtr
vtkSmartPointer< class vtkAnnotatedCubeActor > vtkAnnotatedCubeActorPtr
Definition: cxViewWrapper3D.h:32
cx::ToolAxisConnectorPtr
boost::shared_ptr< class ToolAxisConnector > ToolAxisConnectorPtr
Definition: cxViewWrapper3D.h:57
cx::AxisConnectorPtr
boost::shared_ptr< class AxisConnector > AxisConnectorPtr
Definition: cxAxisConnector.h:49
cxVector3D.h
cx::DataMetricRepPtr
boost::shared_ptr< class DataMetricRep > DataMetricRepPtr
Definition: cxViewWrapper3D.h:39
cx::ImageLandmarkRepPtr
boost::shared_ptr< class ImageLandmarkRep > ImageLandmarkRepPtr
Definition: cxViewWrapper3D.h:46
cx::MultiVolume3DRepProducerPtr
boost::shared_ptr< class MultiVolume3DRepProducer > MultiVolume3DRepProducerPtr
Definition: cxViewWrapper3D.h:48
cxViewWrapper.h
cx::SlicePlanesProxyPtr
boost::shared_ptr< class SlicePlanesProxy > SlicePlanesProxyPtr
Definition: cxForwardDeclarations.h:95
cx::ViewWrapper3DPtr
boost::shared_ptr< ViewWrapper3D > ViewWrapper3DPtr
Definition: cxViewWrapper3D.h:145
cx::NavigationPtr
boost::shared_ptr< class Navigation > NavigationPtr
Definition: cxForwardDeclarations.h:158
cx::RepPtr
boost::shared_ptr< class Rep > RepPtr
Definition: cxRepManager.h:24
vtkOrientationMarkerWidgetPtr
vtkSmartPointer< class vtkOrientationMarkerWidget > vtkOrientationMarkerWidgetPtr
Definition: cxViewWrapper3D.h:34
cx::DataPtr
boost::shared_ptr< class Data > DataPtr
Definition: cxRegistrationApplicator.h:22
cxCoordinateSystemHelpers.h
cx::MetricNamesRepPtr
boost::shared_ptr< class MetricNamesRep > MetricNamesRepPtr
Definition: cxViewWrapper3D.h:40
cx::ViewPtr
boost::shared_ptr< class View > ViewPtr
Definition: cxForwardDeclarations.h:110
cx::PickerRepPtr
boost::shared_ptr< class PickerRep > PickerRepPtr
Definition: cxForwardDeclarations.h:83
cx::LandmarkRepPtr
boost::shared_ptr< class LandmarkRep > LandmarkRepPtr
Definition: cxForwardDeclarations.h:78
cx::ViewWrapper3D
Definition: cxViewWrapper3D.h:64
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cx::TrackedStreamPtr
boost::shared_ptr< class TrackedStream > TrackedStreamPtr
Definition: cxStreamPropertiesWidget.h:22
cx::ViewWrapper
Superclass for ViewWrappers.
Definition: cxViewWrapper.h:89