NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
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) 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 CXVIEWGROUP_H_
13 #define CXVIEWGROUP_H_
14 
15 #include "org_custusx_core_view_Export.h"
16 
17 #include <vector>
18 #include <QObject>
19 #include <QDomDocument>
20 #include "cxDefinitions.h"
21 #include "cxForwardDeclarations.h"
22 #include "cxVector3D.h"
23 
24 class QMenu;
25 class QPoint;
26 
27 namespace cx
28 {
29 typedef boost::shared_ptr<class ViewGroupData> ViewGroupDataPtr;
30 typedef boost::shared_ptr<class SyncedValue> SyncedValuePtr;
31 typedef boost::shared_ptr<class CameraStyle> CameraStylePtr;
32 typedef boost::shared_ptr<class CoreServices> CoreServicesPtr;
33 
47 class org_custusx_core_view_EXPORT ViewGroup: public QObject
48 {
49  Q_OBJECT
50 public:
51  explicit ViewGroup(CoreServicesPtr backend, QString uid);
52  virtual ~ViewGroup();
53 
54  void addView(ViewWrapperPtr wrapper, SharedOpenGLContextPtr sharedOpenGLContext);
55  void removeViews();
56  ViewWrapperPtr getViewWrapperFromViewUid(QString viewUid);
57  std::vector<ViewWrapperPtr> getWrappers() const { return mViewWrappers; }
58  std::vector<ViewPtr> getViews() const;
59  ViewGroupDataPtr getData() { return mViewGroupData; }
60  virtual void addXml(QDomNode& dataNode);
61  virtual void parseXml(QDomNode dataNode);
62  void clearPatientData();
63  CameraStylePtr getCameraStyle() { return mCameraStyle; }
64 
65  bool contains3DView() const;
66  void initializeActiveView(SyncedValuePtr val);
67 
68 protected slots:
69 // void activateManualToolSlot();
70  void mouseClickInViewGroupSlot();
71 
72 protected:
73  std::vector<ViewPtr> mViews;
74 
76  std::vector<ViewWrapperPtr> mViewWrappers;
80 
81 private:
82  template<class T>
83  bool shouldUpdateActiveData(T activeData, std::vector<T> datas) const;
84  void optionChangedSlot();
85 };
86 
87 bool isViewWrapper2D(ViewWrapperPtr wrapper);
88 
92 } // namespace cx
93 
94 #endif /* CXVIEWGROUP_H_ */
cx::ViewGroupDataPtr
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:29
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxForwardDeclarations.h
cxDefinitions.h
cx::isViewWrapper2D
bool isViewWrapper2D(ViewWrapperPtr wrapper)
cxVector3D.h
cx::CameraStylePtr
boost::shared_ptr< class CameraStyle > CameraStylePtr
Definition: cxCameraStyle.h:35
cx::ViewGroup::mBackend
CoreServicesPtr mBackend
Definition: cxViewGroup.h:78
cx::CoreServicesPtr
boost::shared_ptr< class CoreServices > CoreServicesPtr
Definition: cxCameraStyle.h:37
cx::ViewGroup::mViewWrappers
std::vector< ViewWrapperPtr > mViewWrappers
Definition: cxViewGroup.h:76
cx::ViewGroup::getWrappers
std::vector< ViewWrapperPtr > getWrappers() const
Definition: cxViewGroup.h:57
cx::ViewGroup::getData
ViewGroupDataPtr getData()
Definition: cxViewGroup.h:59
cx::ViewGroup::mCameraStyle
CameraStylePtr mCameraStyle
Definition: cxViewGroup.h:77
cx::ViewWrapperPtr
boost::shared_ptr< class ViewWrapper > ViewWrapperPtr
Definition: cxForwardDeclarations.h:173
cx::ViewGroup::mActiveView
SyncedValuePtr mActiveView
Definition: cxViewGroup.h:79
cx::ViewGroup::mViewGroupData
ViewGroupDataPtr mViewGroupData
Definition: cxViewGroup.h:75
cx::SyncedValuePtr
boost::shared_ptr< class SyncedValue > SyncedValuePtr
Definition: cxViewGroup.h:30
cx::ViewGroup
Definition: cxViewGroup.h:47
cx::ViewGroup::mViews
std::vector< ViewPtr > mViews
Definition: cxViewGroup.h:73
cx::ViewGroup::getCameraStyle
CameraStylePtr getCameraStyle()
Definition: cxViewGroup.h:63
cx::SharedOpenGLContextPtr
boost::shared_ptr< class SharedOpenGLContext > SharedOpenGLContextPtr
Definition: cxForwardDeclarations.h:166