Fraxinus  17.12-rc2
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) 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  * cxViewWrapper3D.h
35  *
36  * \date Mar 24, 2010
37  * \author christiana
38  */
39 #ifndef CXVIEWWRAPPER3D_H_
40 #define CXVIEWWRAPPER3D_H_
41 
42 #include "org_custusx_core_view_Export.h"
43 
44 #include <vector>
45 #include <QPointer>
46 #include <QObject>
47 #include "cxDefinitions.h"
48 #include "cxViewWrapper.h"
49 #include "cxForwardDeclarations.h"
50 #include "cxVector3D.h"
52 
53 class QAction;
54 typedef vtkSmartPointer<class vtkAnnotatedCubeActor> vtkAnnotatedCubeActorPtr;
55 typedef vtkSmartPointer<class vtkOrientationMarkerWidget> vtkOrientationMarkerWidgetPtr;
56 
57 namespace cx
58 {
59 typedef boost::shared_ptr<class Slices3DRep> Slices3DRepPtr;
60 typedef boost::shared_ptr<class DataMetricRep> DataMetricRepPtr;
61 typedef boost::shared_ptr<class MetricNamesRep> MetricNamesRepPtr;
62 
63 }
64 
65 namespace cx
66 {
67 typedef boost::shared_ptr<class ImageLandmarkRep> ImageLandmarkRepPtr;
68 typedef boost::shared_ptr<class PatientLandmarkRep> PatientLandmarkRepPtr;
69 typedef boost::shared_ptr<class MultiVolume3DRepProducer> MultiVolume3DRepProducerPtr;
70 typedef boost::shared_ptr<class AxisConnector> AxisConnectorPtr;
71 
78 typedef boost::shared_ptr<class ToolAxisConnector> ToolAxisConnectorPtr;
79 
80 
85 class org_custusx_core_view_EXPORT ViewWrapper3D: public ViewWrapper
86 {
87 Q_OBJECT
88 public:
89  ViewWrapper3D(int startIndex, ViewPtr view, VisServicesPtr services);
90  virtual ~ViewWrapper3D();
91  virtual ViewPtr getView();
92  virtual double getZoom2D() { return -1.0; }
93  virtual void setSlicePlanesProxy(SlicePlanesProxyPtr proxy);
94  virtual void setViewGroup(ViewGroupDataPtr group);
95  void setStereoType(int type);
96 
97 protected slots:
98  virtual void dataViewPropertiesChangedSlot(QString uid);
99  virtual void settingsChangedSlot(QString key);
100 private slots:
101  void showSlices();
102  void activeToolChangedSlot();
103  void toolsAvailableSlot();
104  void showSlicePlanesActionSlot(bool checked);
105  void fillSlicePlanesActionSlot(bool checked);
106  void showAxesActionSlot(bool checked);
107  void showManualToolSlot(bool visible);
108  void resetCameraActionSlot();
109  void activeImageChangedSlot(QString uid);
110  void showRefToolSlot(bool checked);
111  void showToolPathSlot(bool checked);
112  void pickerRepPointPickedSlot(Vector3D p_r);
113  void centerImageActionSlot();
114  void centerToolActionSlot();
115  void optionChangedSlot();
116  void showOrientationSlot(bool visible);
117  void setStereoEyeAngle(double angle);
118  void pickerRepDataPickedSlot(QString);
119  void updateView();
120 
121 protected:
122  virtual QString getDataDescription();
123  virtual QString getViewDescription();
124 
125 private:
126  virtual void appendToContextMenu(QMenu& contextMenu);
127  void readDataRepSettings(RepPtr rep);
128  void updateSlices();
129  NavigationPtr getNavigation();
130 
131  QAction* createSlicesAction(QString title, QWidget* parent);
132 
133  void createSlicesActions(QWidget *parent);
134  QAction* createSlicesAction(PlaneTypeCollection planes, QWidget* parent);
135 
136  void showLandmarks(bool on);
137  void showPointPickerProbe(bool on);
138  void setOrientationAnnotation();
139 
140  RepPtr createDataRep3D(DataPtr data);
141  DataMetricRepPtr createDataMetricRep3D(DataPtr data);
142 
143  void addVolumeDataRep(DataPtr data);
144  void removeVolumeDataRep(QString uid);
145 
146  void setTranslucentRenderingToDepthPeeling(bool setDepthPeeling);
147  void initializeMultiVolume3DRepProducer();
148  void updateMetricNamesRep();
149 
150  MultiVolume3DRepProducerPtr mMultiVolume3DRepProducer;
151  typedef std::map<QString, RepPtr> RepMap;
152  RepMap mDataReps;
153  LandmarkRepPtr mLandmarkRep;
154  PickerRepPtr mPickerRep;
155  MetricNamesRepPtr mMetricNames;
156  std::vector<AxisConnectorPtr> mAxis;
157 
158  bool mShowAxes;
159 #ifndef CX_VTK_OPENGL2
160  Slices3DRepPtr mSlices3DRep;
161 #endif
162  SlicePlanes3DRepPtr mSlicePlanes3DRep;
163  OrientationAnnotation3DRepPtr mAnnotationMarker;
164 
165  ViewPtr mView;
166  RepPtr createTrackedStreamRep(TrackedStreamPtr trackedStream);
167 };
168 typedef boost::shared_ptr<ViewWrapper3D> ViewWrapper3DPtr;
169 
173 } // namespace cx
174 
175 #endif /* CXVIEWWRAPPER3D_H_ */
std::map< QString, RepPtr > RepMap
Definition: cxRepManager.h:51
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:50
boost::shared_ptr< class SlicePlanesProxy > SlicePlanesProxyPtr
boost::shared_ptr< class TrackedStream > TrackedStreamPtr
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:61
boost::shared_ptr< class MultiVolume3DRepProducer > MultiVolume3DRepProducerPtr
Superclass for ViewWrappers.
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:63
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:45
vtkSmartPointer< class vtkAnnotatedCubeActor > vtkAnnotatedCubeActorPtr
Namespace for all CustusX production code.