CustusX  22.04-rc2
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 
75  ViewGroupDataPtr mViewGroupData;
76  std::vector<ViewWrapperPtr> mViewWrappers;
77  CameraStylePtr mCameraStyle;
78  CoreServicesPtr mBackend;
79  SyncedValuePtr mActiveView;
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_ */
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:29
ViewGroupDataPtr mViewGroupData
Definition: cxViewGroup.h:75
CameraStylePtr mCameraStyle
Definition: cxViewGroup.h:77
CoreServicesPtr mBackend
Definition: cxViewGroup.h:78
boost::shared_ptr< class CameraStyle > CameraStylePtr
Definition: cxCameraStyle.h:35
std::vector< ViewPtr > mViews
Definition: cxViewGroup.h:73
boost::shared_ptr< class ViewWrapper > ViewWrapperPtr
bool isViewWrapper2D(ViewWrapperPtr wrapper)
ViewGroupDataPtr getData()
Definition: cxViewGroup.h:59
boost::shared_ptr< class SharedOpenGLContext > SharedOpenGLContextPtr
std::vector< ViewWrapperPtr > mViewWrappers
Definition: cxViewGroup.h:76
CameraStylePtr getCameraStyle()
Definition: cxViewGroup.h:63
SyncedValuePtr mActiveView
Definition: cxViewGroup.h:79
boost::shared_ptr< class CoreServices > CoreServicesPtr
Definition: cxCameraStyle.h:37
boost::shared_ptr< class SyncedValue > SyncedValuePtr
Definition: cxViewGroup.h:30
std::vector< ViewWrapperPtr > getWrappers() const
Definition: cxViewGroup.h:57
Namespace for all CustusX production code.