NorMIT-nav  2023.01.05-dev+develop.0da12
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  void enableTransparentMeshesSlot();
80 private slots:
81  void showSlices();
82  void activeToolChangedSlot();
83  void toolsAvailableSlot();
84  void showSlicePlanesActionSlot(bool checked);
85  void fillSlicePlanesActionSlot(bool checked);
86  void showAxesActionSlot(bool checked);
87  void showManualToolSlot(bool visible);
88  void resetCameraActionSlot();
89  void activeImageChangedSlot(QString uid);
90  void showRefToolSlot(bool checked);
91  void showToolPathSlot(bool checked);
92  void pickerRepPointPickedSlot(Vector3D p_r);
93  void centerImageActionSlot();
94  void centerToolActionSlot();
95  void optionChangedSlot();
96  void showOrientationSlot(bool visible);
97  void setStereoEyeAngle(double angle);
98  void pickerRepDataPickedSlot(QString);
99  void updateView();
100 
101 protected:
102  virtual QString getDataDescription();
103  virtual QString getViewDescription();
104 
105 private:
106  virtual void appendToContextMenu(QMenu& contextMenu);
107  void readDataRepSettings(RepPtr rep);
108  void updateSlices();
109  NavigationPtr getNavigation();
110 
111  QAction* createSlicesAction(QString title, QWidget* parent);
112 
113  void createSlicesActions(QWidget *parent);
114  QAction* createSlicesAction(PlaneTypeCollection planes, QWidget* parent);
115 
116  void showLandmarks(bool on);
117  void showPointPickerProbe(bool on);
118  void setOrientationAnnotation();
119 
120  RepPtr createDataRep3D(DataPtr data);
121  DataMetricRepPtr createDataMetricRep3D(DataPtr data);
122 
123  void addVolumeDataRep(DataPtr data);
124  void removeVolumeDataRep(QString uid);
125 
126  void setupTransparentMeshes();
127  void setTranslucentRenderingToDepthPeeling(bool setDepthPeeling);
128  void initializeMultiVolume3DRepProducer();
129  void updateMetricNamesRep();
130 
131  MultiVolume3DRepProducerPtr mMultiVolume3DRepProducer;
132  typedef std::map<QString, RepPtr> RepMap;
133  RepMap mDataReps;
134  LandmarkRepPtr mLandmarkRep;
135  PickerRepPtr mPickerRep;
136  MetricNamesRepPtr mMetricNames;
137  std::vector<AxisConnectorPtr> mAxis;
138 
139  bool mShowAxes;
140  Slices3DRepPtr mSlices3DRep;
141  SlicePlanes3DRepPtr mSlicePlanes3DRep;
142  OrientationAnnotation3DRepPtr mAnnotationMarker;
143 
144  ViewPtr mView;
145  RepPtr createTrackedStreamRep(TrackedStreamPtr trackedStream);
146 };
147 typedef boost::shared_ptr<ViewWrapper3D> ViewWrapper3DPtr;
148 
152 } // namespace cx
153 
154 #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:147
cx::NavigationPtr
boost::shared_ptr< class Navigation > NavigationPtr
Definition: cxForwardDeclarations.h:160
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