CustusX  16.12
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 Navigation> NavigationPtr;
68 typedef boost::shared_ptr<class ImageLandmarkRep> ImageLandmarkRepPtr;
69 typedef boost::shared_ptr<class PatientLandmarkRep> PatientLandmarkRepPtr;
70 typedef boost::shared_ptr<class MultiVolume3DRepProducer> MultiVolume3DRepProducerPtr;
71 typedef boost::shared_ptr<class AxisConnector> AxisConnectorPtr;
72 
79 typedef boost::shared_ptr<class ToolAxisConnector> ToolAxisConnectorPtr;
80 
81 
86 class org_custusx_core_view_EXPORT ViewWrapper3D: public ViewWrapper
87 {
88 Q_OBJECT
89 public:
90  ViewWrapper3D(int startIndex, ViewPtr view, VisServicesPtr services);
91  virtual ~ViewWrapper3D();
92  virtual ViewPtr getView();
93  virtual double getZoom2D() { return -1.0; }
94  virtual void setSlicePlanesProxy(SlicePlanesProxyPtr proxy);
95  virtual void setViewGroup(ViewGroupDataPtr group);
96  void setStereoType(int type);
97 
98 protected slots:
99  virtual void dataViewPropertiesChangedSlot(QString uid);
100  virtual void settingsChangedSlot(QString key);
101 private slots:
102  void showSlices();
103  void activeToolChangedSlot();
104  void toolsAvailableSlot();
105  void showSlicePlanesActionSlot(bool checked);
106  void fillSlicePlanesActionSlot(bool checked);
107  void showAxesActionSlot(bool checked);
108  void showManualToolSlot(bool visible);
109  void resetCameraActionSlot();
110  void activeImageChangedSlot(QString uid);
111  void showRefToolSlot(bool checked);
112  void showToolPathSlot(bool checked);
113  void pickerRepPointPickedSlot(Vector3D p_r);
114  void centerImageActionSlot();
115  void centerToolActionSlot();
116  void optionChangedSlot();
117  void showOrientationSlot(bool visible);
118  void setStereoEyeAngle(double angle);
119  void pickerRepDataPickedSlot(QString);
120  void updateView();
121 
122 protected:
123  virtual QString getDataDescription();
124  virtual QString getViewDescription();
125 
126 private:
127  virtual void appendToContextMenu(QMenu& contextMenu);
128  void readDataRepSettings(RepPtr rep);
129  void updateSlices();
130  NavigationPtr getNavigation();
131 
132  QAction* createSlicesAction(QString title, QWidget* parent);
133 
134  void createSlicesActions(QWidget *parent);
135  QAction* createSlicesAction(PlaneTypeCollection planes, QWidget* parent);
136 
137  void showLandmarks(bool on);
138  void showPointPickerProbe(bool on);
139  void setOrientationAnnotation();
140 
141  RepPtr createDataRep3D(DataPtr data);
142  DataMetricRepPtr createDataMetricRep3D(DataPtr data);
143 
144  void addVolumeDataRep(DataPtr data);
145  void removeVolumeDataRep(QString uid);
146 
147  void setTranslucentRenderingToDepthPeeling(bool setDepthPeeling);
148  void initializeMultiVolume3DRepProducer();
149  void updateMetricNamesRep();
150 
151  MultiVolume3DRepProducerPtr mMultiVolume3DRepProducer;
152  typedef std::map<QString, RepPtr> RepMap;
153  RepMap mDataReps;
154  LandmarkRepPtr mLandmarkRep;
155  PickerRepPtr mPickerRep;
156  MetricNamesRepPtr mMetricNames;
157  std::vector<AxisConnectorPtr> mAxis;
158 
159  bool mShowAxes;
160 #ifndef CX_VTK_OPENGL2
161  Slices3DRepPtr mSlices3DRep;
162 #endif
163  SlicePlanes3DRepPtr mSlicePlanes3DRep;
164  OrientationAnnotation3DRepPtr mAnnotationMarker;
165 
166  ViewPtr mView;
167  RepPtr createTrackedStreamRep(TrackedStreamPtr trackedStream);
168 };
169 typedef boost::shared_ptr<ViewWrapper3D> ViewWrapper3DPtr;
170 
174 } // namespace cx
175 
176 #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:62
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 Navigation > NavigationPtr
Definition: cxViewGroup.h:54
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 LandmarkRep > LandmarkRepPtr
boost::shared_ptr< class Rep > RepPtr
Definition: cxRepManager.h:45
vtkSmartPointer< class vtkAnnotatedCubeActor > vtkAnnotatedCubeActorPtr