CustusX  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_ */
std::map< QString, RepPtr > RepMap
Definition: cxRepManager.h:30
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:29
boost::shared_ptr< class SlicePlanesProxy > SlicePlanesProxyPtr
boost::shared_ptr< class TrackedStream > TrackedStreamPtr
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
boost::shared_ptr< class MultiVolume3DRepProducer > MultiVolume3DRepProducerPtr
Superclass for ViewWrappers.
Definition: cxViewWrapper.h:89
virtual double getZoom2D()
boost::shared_ptr< class DataMetricRep > DataMetricRepPtr
boost::shared_ptr< class View > ViewPtr
boost::shared_ptr< class ImageLandmarkRep > ImageLandmarkRepPtr
boost::shared_ptr< class MetricNamesRep > MetricNamesRepPtr
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class PickerRep > PickerRepPtr
boost::shared_ptr< class PatientLandmarkRep > PatientLandmarkRepPtr
boost::shared_ptr< class Slices3DRep > Slices3DRepPtr
vtkSmartPointer< class vtkOrientationMarkerWidget > vtkOrientationMarkerWidgetPtr
boost::shared_ptr< class ToolAxisConnector > ToolAxisConnectorPtr
boost::shared_ptr< class SlicePlanes3DRep > SlicePlanes3DRepPtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
boost::shared_ptr< class AxisConnector > AxisConnectorPtr
boost::shared_ptr< class OrientationAnnotation3DRep > OrientationAnnotation3DRepPtr
boost::shared_ptr< ViewWrapper3D > ViewWrapper3DPtr
boost::shared_ptr< class Navigation > NavigationPtr
boost::shared_ptr< class LandmarkRep > LandmarkRepPtr
boost::shared_ptr< class Rep > RepPtr
Definition: cxRepManager.h:24
vtkSmartPointer< class vtkAnnotatedCubeActor > vtkAnnotatedCubeActorPtr
Namespace for all CustusX production code.