CustusX  22.04-rc5
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_ */
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.