Fraxinus  16.5.0-fx-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxViewService.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 #ifndef CXVIEWSERVICE_H_
34 #define CXVIEWSERVICE_H_
35 
36 #include "cxResourceVisualizationExport.h"
37 
38 #include <QObject>
39 #include <boost/shared_ptr.hpp>
40 #include <vector>
41 #include "cxData.h"
42 #include "cxLayoutData.h"
43 class QActionGroup;
44 
45 #define ViewService_iid "cx::ViewService"
46 
47 namespace cx
48 {
49 
50 typedef boost::shared_ptr<class InteractiveCropper> InteractiveCropperPtr;
51 typedef boost::shared_ptr<class Clippers> ClippersPtr;
52 
53 typedef boost::shared_ptr<class CyclicActionLogger> CyclicActionLoggerPtr;
54 typedef boost::shared_ptr<class Navigation> NavigationPtr;
55 typedef boost::shared_ptr<class LayoutRepository> LayoutRepositoryPtr;
56 typedef boost::shared_ptr<class CameraControl> CameraControlPtr;
57 typedef boost::shared_ptr<class RepContainer> RepContainerPtr;
58 
59 enum cxResourceVisualization_EXPORT CAMERA_STYLE_TYPE
60 {
62 };
63 
70 class cxResourceVisualization_EXPORT ViewService : public QObject
71 {
72  Q_OBJECT
73 public:
74  virtual ViewPtr get3DView(int group = 0, int index = 0) = 0;
75  RepContainerPtr get3DReps(int group = 0, int index = 0);
76 
77  //TODO: Remove direct access to this internal structure
78  virtual int getActiveGroupId() const = 0;
79  virtual ViewGroupDataPtr getGroup(int groupIdx) const = 0;
80  unsigned groupCount() const;
81 
82  //All above group access needs to be replaced with functions:
83  virtual void setRegistrationMode(REGISTRATION_STATUS mode) = 0;
84 
85  virtual void autoShowData(DataPtr data) = 0;
86  virtual void enableRender(bool val) = 0;
87  virtual bool renderingIsEnabled() const = 0;
88  virtual QWidget* createLayoutWidget(QWidget* parent, int index=0) = 0;
89  virtual QWidget* getLayoutWidget(int index) = 0;
90  virtual QString getActiveLayout(int widgetIndex=0) const = 0;
91  virtual void setActiveLayout(const QString& uid, int widgetIndex=0) = 0;
92  virtual void deactivateLayout();
93  virtual ClippersPtr getClippers() = 0;
94  virtual InteractiveCropperPtr getCropper() = 0;
95  virtual CyclicActionLoggerPtr getRenderTimer() = 0;
96  virtual NavigationPtr getNavigation() = 0;
97  virtual LayoutRepositoryPtr getLayoutRepository() = 0;
98  virtual CameraControlPtr getCameraControl() = 0;
99  virtual QActionGroup* getInteractorStyleActionGroup() = 0;
100  virtual void centerToImageCenterInActiveViewGroup() = 0;
101  virtual void setCameraStyle(CAMERA_STYLE_TYPE style, int groupIdx) = 0;
102  virtual void addDefaultLayout(LayoutData layoutData) = 0;
103 
104  virtual bool isNull() = 0;
105  static ViewServicePtr getNullObject();
106 
107  // extended Data interface
108  ViewGroupDataPtr getActiveViewGroup();
109 signals:
110  void fps(int number);
111  void activeLayoutChanged();
112  void activeViewChanged();
113  void renderingEnabledChanged();
114  void pointSampled(Vector3D p_r);
115  void renderFinished();
116 
117 public slots:
118  virtual void aboutToStop() = 0;
119 
120 };
121 
122 } //cx
123 Q_DECLARE_INTERFACE(cx::ViewService, ViewService_iid)
124 
125 #endif // CXVIEWSERVICE_H_
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:50
Visualization services.
Definition: cxViewService.h:70
boost::shared_ptr< class LayoutRepository > LayoutRepositoryPtr
boost::shared_ptr< class ViewService > ViewServicePtr
boost::shared_ptr< class View > ViewPtr
cstTOOL_STYLE
Definition: cxViewService.h:61
boost::shared_ptr< class Navigation > NavigationPtr
Definition: cxViewGroup.h:54
cstDEFAULT_STYLE
Definition: cxViewService.h:61
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class RepContainer > RepContainerPtr
boost::shared_ptr< class CyclicActionLogger > CyclicActionLoggerPtr
cstANGLED_TOOL_STYLE
Definition: cxViewService.h:61
#define ViewService_iid
Definition: cxViewService.h:45
boost::shared_ptr< class InteractiveCropper > InteractiveCropperPtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:63
boost::shared_ptr< class CameraControl > CameraControlPtr
Definition: cxMainWindow.h:58
cstUNICAM_STYLE
Definition: cxViewService.h:61
boost::shared_ptr< class Clippers > ClippersPtr