CustusX  2021.09.21-dev+develop.e3cd0
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_
boost::shared_ptr< class CyclicActionLogger > CyclicActionLoggerPtr
boost::shared_ptr< class LayoutRepository > LayoutRepositoryPtr
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:29
Visualization services.
Definition: cxViewService.h:50
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:34
boost::shared_ptr< class Clippers > ClippersPtr
cstDEFAULT_STYLE
Definition: cxViewService.h:34
boost::shared_ptr< class Data > DataPtr
SNW_DECLARE_ENUM_STRING_CONVERTERS(cxResourceVisualization_EXPORT, cx, CAMERA_STYLE_TYPE)
cstANGLED_TOOL_STYLE
Definition: cxViewService.h:34
#define ViewService_iid
Definition: cxViewService.h:25
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cstUNICAM_STYLE
Definition: cxViewService.h:34
boost::shared_ptr< class Navigation > NavigationPtr
Namespace for all CustusX production code.