Fraxinus  16.5.0-fx-rc7
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxViewGroup.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 CXVIEWGROUP_H_
34 #define CXVIEWGROUP_H_
35 
36 #include "org_custusx_core_view_Export.h"
37 
38 #include <vector>
39 #include <QObject>
40 #include <QDomDocument>
41 #include "cxDefinitions.h"
42 #include "cxForwardDeclarations.h"
43 #include "cxVector3D.h"
44 
45 class QMenu;
46 class QPoint;
47 
48 namespace cx
49 {
50 typedef boost::shared_ptr<class ViewGroupData> ViewGroupDataPtr;
51 typedef boost::shared_ptr<class SyncedValue> SyncedValuePtr;
52 typedef boost::shared_ptr<class CameraStyle> CameraStylePtr;
53 typedef boost::shared_ptr<class CoreServices> CoreServicesPtr;
54 typedef boost::shared_ptr<class Navigation> NavigationPtr;
55 
69 class org_custusx_core_view_EXPORT ViewGroup: public QObject
70 {
71  Q_OBJECT
72 public:
73  explicit ViewGroup(CoreServicesPtr backend);
74  virtual ~ViewGroup();
75 
76  void addView(ViewWrapperPtr wrapper);
77  void removeViews();
78  ViewWrapperPtr getViewWrapperFromViewUid(QString viewUid);
79  std::vector<ViewWrapperPtr> getWrappers() const { return mViewWrappers; }
80  std::vector<ViewPtr> getViews() const;
81  ViewGroupDataPtr getData() { return mViewGroupData; }
82  virtual void addXml(QDomNode& dataNode);
83  virtual void parseXml(QDomNode dataNode);
84  void clearPatientData();
85  CameraStylePtr getCameraStyle() { return mCameraStyle; }
86 
87  bool contains3DView() const;
88  void initializeActiveView(SyncedValuePtr val);
89 protected slots:
90 // void activateManualToolSlot();
91  void mouseClickInViewGroupSlot();
92 
93 protected:
94  std::vector<ViewPtr> mViews;
95 
97  std::vector<ViewWrapperPtr> mViewWrappers;
101 
102 private:
103  template<class T>
104  bool shouldUpdateActiveData(T activeData, std::vector<T> datas) const;
105 };
106 
107 bool isViewWrapper2D(ViewWrapperPtr wrapper);
108 
112 } // namespace cx
113 
114 #endif /* CXVIEWGROUP_H_ */
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:50
ViewGroupDataPtr mViewGroupData
Definition: cxViewGroup.h:96
CameraStylePtr mCameraStyle
Definition: cxViewGroup.h:98
CoreServicesPtr mBackend
Definition: cxViewGroup.h:99
boost::shared_ptr< class CameraStyle > CameraStylePtr
Definition: cxCameraStyle.h:57
std::vector< ViewPtr > mViews
Definition: cxViewGroup.h:94
boost::shared_ptr< class ViewWrapper > ViewWrapperPtr
bool isViewWrapper2D(ViewWrapperPtr wrapper)
boost::shared_ptr< class Navigation > NavigationPtr
Definition: cxViewGroup.h:54
ViewGroupDataPtr getData()
Definition: cxViewGroup.h:81
std::vector< ViewWrapperPtr > mViewWrappers
Definition: cxViewGroup.h:97
CameraStylePtr getCameraStyle()
Definition: cxViewGroup.h:85
SyncedValuePtr mActiveView
Definition: cxViewGroup.h:100
boost::shared_ptr< class CoreServices > CoreServicesPtr
Definition: cxCameraStyle.h:59
boost::shared_ptr< class SyncedValue > SyncedValuePtr
Definition: cxViewGroup.h:51
std::vector< ViewWrapperPtr > getWrappers() const
Definition: cxViewGroup.h:79