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