CustusX  15.8
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 class QActionGroup;
43 
44 #define VisualizationService_iid "cx::VisualizationService"
45 
46 namespace cx
47 {
48 
49 typedef boost::shared_ptr<class VisualizationService> VisualizationServicePtr;
50 typedef boost::shared_ptr<class ViewGroup> ViewGroupPtr;
51 typedef boost::shared_ptr<class ViewGroupData> ViewGroupDataPtr;
52 typedef boost::shared_ptr<class InteractiveClipper> InteractiveClipperPtr;
53 typedef boost::shared_ptr<class InteractiveCropper> InteractiveCropperPtr;
54 
55 typedef boost::shared_ptr<class CyclicActionLogger> CyclicActionLoggerPtr;
56 typedef boost::shared_ptr<class Navigation> NavigationPtr;
57 typedef boost::shared_ptr<class LayoutRepository> LayoutRepositoryPtr;
58 typedef boost::shared_ptr<class CameraControl> CameraControlPtr;
59 typedef boost::shared_ptr<class RepContainer> RepContainerPtr;
60 
61 
68 class cxResourceVisualization_EXPORT VisualizationService : public QObject
69 {
70  Q_OBJECT
71 public:
72  virtual ViewPtr get3DView(int group = 0, int index = 0) = 0;
73  RepContainerPtr get3DReps(int group = 0, int index = 0);
74 
75  virtual int getActiveGroupId() const = 0;
76  virtual ViewGroupDataPtr getGroup(int groupIdx) const = 0;
77  unsigned groupCount() const;
78 
79  virtual void autoShowData(DataPtr data) = 0;
80  virtual void enableRender(bool val) = 0;
81  virtual bool renderingIsEnabled() const = 0;
82  virtual QWidget* getLayoutWidget(QWidget* parent, int index=0) = 0;
83  virtual QString getActiveLayout(int widgetIndex=0) const = 0;
84  virtual void setActiveLayout(const QString& uid, int widgetIndex=0) = 0;
85  virtual void deactivateLayout();
86  virtual InteractiveClipperPtr getClipper() = 0;
87  virtual InteractiveCropperPtr getCropper() = 0;
88  virtual CyclicActionLoggerPtr getRenderTimer() = 0;
89  virtual NavigationPtr getNavigation() = 0;
90  virtual LayoutRepositoryPtr getLayoutRepository() = 0;
91  virtual CameraControlPtr getCameraControl() = 0;
92  virtual QActionGroup* createInteractorStyleActionGroup() = 0;
93 
94  virtual bool isNull() = 0;
95  static VisualizationServicePtr getNullObject();
96 
97  // extended Data interface
98  ViewGroupDataPtr getActiveViewGroup();
99 signals:
100  void fps(int number);
101  void activeLayoutChanged();
102  void activeViewChanged();
103  void renderingEnabledChanged();
104 
105 public slots:
106  virtual void aboutToStop() = 0;
107 
108 };
109 
111 
112 } //cx
114 
115 #endif // CXVIEWSERVICE_H_
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:50
boost::shared_ptr< class LayoutRepository > LayoutRepositoryPtr
boost::shared_ptr< class InteractiveClipper > InteractiveClipperPtr
boost::shared_ptr< class View > ViewPtr
boost::shared_ptr< class Navigation > NavigationPtr
Definition: cxViewGroup.h:54
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class RepContainer > RepContainerPtr
boost::shared_ptr< class VisualizationService > VisualizationServicePtr
Definition: cxRegServices.h:43
boost::shared_ptr< class CyclicActionLogger > CyclicActionLoggerPtr
VisualizationService ViewService
Visualization services.
Definition: cxViewService.h:68
boost::shared_ptr< class InteractiveCropper > InteractiveCropperPtr
boost::shared_ptr< class CameraControl > CameraControlPtr
Definition: cxMainWindow.h:58
#define VisualizationService_iid
Definition: cxViewService.h:44
boost::shared_ptr< class ViewGroup > ViewGroupPtr