NorMIT-nav  22.09
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) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXVIEWSERVICE_H_
13 #define CXVIEWSERVICE_H_
14 
15 #include "cxResourceVisualizationExport.h"
16 
17 #include <QObject>
18 #include <boost/shared_ptr.hpp>
19 #include <vector>
20 #include "cxData.h"
21 #include "cxLayoutData.h"
22 #include "cxEnumConverter.h"
23 #include "cxForwardDeclarations.h"
24 
25 #define ViewService_iid "cx::ViewService"
26 
27 class QActionGroup;
28 
29 namespace cx
30 {
31 
32 enum cxResourceVisualization_EXPORT CAMERA_STYLE_TYPE
33 {
35 };
36 
37 } //cx
38 
39 SNW_DECLARE_ENUM_STRING_CONVERTERS(cxResourceVisualization_EXPORT, cx, CAMERA_STYLE_TYPE);
40 
41 namespace cx
42 {
43 
50 class cxResourceVisualization_EXPORT ViewService : public QObject
51 {
52  Q_OBJECT
53 public:
54  virtual ViewPtr get3DView(int group = 0, int index = 0) = 0;
55  RepContainerPtr get3DReps(int group = 0, int index = 0);
56 
57  //TODO: Remove direct access to this internal structure
58  virtual int getActiveGroupId() const = 0;
59  virtual ViewGroupDataPtr getGroup(int groupIdx) const = 0;
60  unsigned groupCount() const;
61 
62  //All above group access needs to be replaced with functions:
63  virtual void setRegistrationMode(REGISTRATION_STATUS mode) = 0;
64 
65  virtual void autoShowData(DataPtr data) = 0;
66  virtual void enableRender(bool val) = 0;
67  virtual bool renderingIsEnabled() const = 0;
68  virtual QWidget* createLayoutWidget(QWidget* parent, int index=0) = 0;
69  virtual QWidget* getLayoutWidget(int index) = 0;
70  virtual QString getActiveLayout(int widgetIndex=0) const = 0;
71  virtual void setActiveLayout(const QString& uid, int widgetIndex=0) = 0;
72  virtual void deactivateLayout();
73  virtual ClippersPtr getClippers() = 0;
74  virtual InteractiveCropperPtr getCropper() = 0;
75  virtual CyclicActionLoggerPtr getRenderTimer() = 0;
76  virtual NavigationPtr getNavigation(int group = 0) = 0;
77  virtual LayoutRepositoryPtr getLayoutRepository() = 0;
78  virtual CameraControlPtr getCameraControl() = 0;
79  virtual QActionGroup* getInteractorStyleActionGroup() = 0;
80  virtual void centerToImageCenterInActiveViewGroup() = 0;
81  virtual void setCameraStyle(CAMERA_STYLE_TYPE style, int groupIdx) = 0;
82  virtual void zoomCamera3D(int viewGroup3DNumber, int zoomFactor) = 0;
83  virtual void addDefaultLayout(LayoutData layoutData) = 0;
84  virtual void enableContextMenuForViews(bool enable=true) = 0;
85 
86  virtual bool isNull() = 0;
87  static ViewServicePtr getNullObject();
88 
89  // extended Data interface
90  ViewGroupDataPtr getActiveViewGroup();
91 signals:
92  void fps(int number);
93  void activeLayoutChanged();
94  void activeViewChanged();
95  void renderingEnabledChanged();
96  void pointSampled(Vector3D p_r);
97  void renderFinished();
98 
99 public slots:
100  virtual void aboutToStop() = 0;
101 
102 };
103 
104 } //cx
105 Q_DECLARE_INTERFACE(cx::ViewService, ViewService_iid)
106 
107 #endif // CXVIEWSERVICE_H_
cx::ViewGroupDataPtr
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:29
cstTOOL_STYLE
cstTOOL_STYLE
Definition: cxViewService.h:34
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxForwardDeclarations.h
cx::ClippersPtr
boost::shared_ptr< class Clippers > ClippersPtr
Definition: cxForwardDeclarations.h:151
cstANGLED_TOOL_STYLE
cstANGLED_TOOL_STYLE
Definition: cxViewService.h:34
cxData.h
cx::LayoutData
Definition: cxLayoutData.h:76
cx::NavigationPtr
boost::shared_ptr< class Navigation > NavigationPtr
Definition: cxForwardDeclarations.h:158
SNW_DECLARE_ENUM_STRING_CONVERTERS
SNW_DECLARE_ENUM_STRING_CONVERTERS(cxResourceVisualization_EXPORT, cx, CAMERA_STYLE_TYPE)
cx::RepContainerPtr
boost::shared_ptr< class RepContainer > RepContainerPtr
Definition: cxForwardDeclarations.h:162
cx::ViewServicePtr
boost::shared_ptr< class ViewService > ViewServicePtr
Definition: cxLogicManager.h:28
cx::DataPtr
boost::shared_ptr< class Data > DataPtr
Definition: cxRegistrationApplicator.h:22
cxEnumConverter.h
cx::ViewPtr
boost::shared_ptr< class View > ViewPtr
Definition: cxForwardDeclarations.h:110
cx::CyclicActionLoggerPtr
boost::shared_ptr< class CyclicActionLogger > CyclicActionLoggerPtr
Definition: cxForwardDeclarations.h:152
cx::LayoutRepositoryPtr
boost::shared_ptr< class LayoutRepository > LayoutRepositoryPtr
Definition: cxForwardDeclarations.h:157
cstUNICAM_STYLE
cstUNICAM_STYLE
Definition: cxViewService.h:34
cx::CameraControlPtr
boost::shared_ptr< class CameraControl > CameraControlPtr
Definition: cxForwardDeclarations.h:150
cx::ViewService
Visualization services.
Definition: cxViewService.h:50
cx::InteractiveCropperPtr
boost::shared_ptr< class InteractiveCropper > InteractiveCropperPtr
Definition: cxForwardDeclarations.h:156
ViewService_iid
#define ViewService_iid
Definition: cxViewService.h:25
cstDEFAULT_STYLE
cstDEFAULT_STYLE
Definition: cxViewService.h:34
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cxLayoutData.h