NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxViewCollectionWidgetMixed.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 CXVIEWCOLLECTIONWIDGETMIXED_H_
13 #define CXVIEWCOLLECTIONWIDGETMIXED_H_
14 
15 #include "cxResourceVisualizationExport.h"
16 
17 #include "cxView.h"
18 #include "cxLayoutData.h"
19 #include "cxViewCache.h"
20 #include "cxViewWidget.h"
21 #include "cxViewCollectionWidget.h"
22 
23 
24 class QGridLayout;
25 
26 namespace cx
27 {
28 
29 typedef boost::shared_ptr<class MultiViewCache> MultiViewCachePtr;
30 class ViewCollectionWidgetUsingViewContainer;
31 class LayoutWidgetUsingViewWidgets;
32 
53 class cxResourceVisualization_EXPORT ViewCollectionWidgetMixed : public ViewCollectionWidget
54 {
55  Q_OBJECT
56 public:
57  ViewCollectionWidgetMixed(RenderWindowFactoryPtr factory, QWidget *parent);
58  virtual ~ViewCollectionWidgetMixed();
59 
60  ViewPtr addView(View::Type type, LayoutRegion region);
61  virtual void setOffScreenRenderingAndClear(bool on);
62  virtual bool getOffScreenRendering() const;
63  virtual void clearViews();
64  virtual void setModified();
65  virtual void render();
66  virtual void setGridSpacing(int val);
67  virtual void setGridMargin(int val);
68  virtual int getGridSpacing() const;
69  virtual int getGridMargin() const;
70  virtual std::vector<ViewPtr> getViews();
71  virtual QPoint getPosition(ViewPtr view);
72  virtual void enableContextMenuForViews(bool enable);
73 
74 protected:
76 
77 private:
78  void addWidgetToLayout(QGridLayout* layout, QWidget* widget, LayoutRegion region);
79  void initBaseLayout();
80  LayoutRegion mBaseRegion;
81  LayoutRegion mTotalRegion;
82  QGridLayout* mLayout;
83  std::vector<ViewWidget*> mOverlays;
84 
85  MultiViewCachePtr mViewCache;
86 };
87 
88 
89 
90 } // namespace cx
91 
92 #endif // CXVIEWCOLLECTIONWIDGETMIXED_H_
cx::ViewCollectionWidgetMixed::mBaseLayout
ViewCollectionWidget * mBaseLayout
Definition: cxViewCollectionWidgetMixed.h:75
cxViewCache.h
cx::MultiViewCachePtr
boost::shared_ptr< class MultiViewCache > MultiViewCachePtr
Definition: cxViewContainer.h:28
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxViewCollectionWidget.h
cx::RenderWindowFactoryPtr
boost::shared_ptr< class RenderWindowFactory > RenderWindowFactoryPtr
Definition: cxForwardDeclarations.h:163
cxViewWidget.h
cxView.h
cx::LayoutRegion
Definition: cxLayoutData.h:40
cx::ViewPtr
boost::shared_ptr< class View > ViewPtr
Definition: cxForwardDeclarations.h:110
cx::ViewCollectionWidgetMixed
Definition: cxViewCollectionWidgetMixed.h:53
cx::View::Type
Type
Definition: cxView.h:52
cxLayoutData.h
cx::ViewCollectionWidget
Definition: cxViewCollectionWidget.h:39