Fraxinus  16.5.0-fx-rc1
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 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 globalConfigurationFileChangedSlot(QString key);
118  void setStereoEyeAngle(double angle);
119  void settingsChangedSlot(QString key);
120  void pickerRepDataPickedSlot(QString);
121  void updateView();
122 
123 private:
124  virtual void appendToContextMenu(QMenu& contextMenu);
125  void readDataRepSettings(RepPtr rep);
126  void updateSlices();
127  NavigationPtr getNavigation();
128 
129  QAction* createSlicesAction(QString title, QWidget* parent);
130 
131  void createSlicesActions(QWidget *parent);
132  QAction* createSlicesAction(PlaneTypeCollection planes, QWidget* parent);
133 
134  void showLandmarks(bool on);
135  void showPointPickerProbe(bool on);
136  void setOrientationAnnotation();
137 
138  RepPtr createDataRep3D(DataPtr data);
139  DataMetricRepPtr createDataMetricRep3D(DataPtr data);
140 
141  void addVolumeDataRep(DataPtr data);
142  void removeVolumeDataRep(QString uid);
143 
144  void setTranslucentRenderingToDepthPeeling(bool setDepthPeeling);
145  void initializeMultiVolume3DRepProducer();
146  void updateMetricNamesRep();
147 
148  MultiVolume3DRepProducerPtr mMultiVolume3DRepProducer;
149  typedef std::map<QString, RepPtr> RepMap;
150  RepMap mDataReps;
151  LandmarkRepPtr mLandmarkRep;
152  PickerRepPtr mPickerRep;
153  DisplayTextRepPtr mPlaneTypeText;
154  DisplayTextRepPtr mDataNameText;
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:62
boost::shared_ptr< class MultiVolume3DRepProducer > MultiVolume3DRepProducerPtr
Superclass for ViewWrappers.
Definition: cxViewWrapper.h:93
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 DisplayTextRep > DisplayTextRepPtr
boost::shared_ptr< class LandmarkRep > LandmarkRepPtr
boost::shared_ptr< class Rep > RepPtr
Definition: cxRepManager.h:45
vtkSmartPointer< class vtkAnnotatedCubeActor > vtkAnnotatedCubeActorPtr