CustusX  22.04-rc5
An IGT application
cxViewCollectionWidgetUsingViewWidgets.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 CXVIEWCOLLECTIONWIDGETUSINGVIEWWIDGETS_H_
13 #define CXVIEWCOLLECTIONWIDGETUSINGVIEWWIDGETS_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 class QGridLayout;
24 
25 namespace cx
26 {
27 
28 typedef boost::shared_ptr<class MultiViewCache> MultiViewCachePtr;
29 
38 class cxResourceVisualization_EXPORT LayoutWidgetUsingViewWidgets : public ViewCollectionWidget
39 {
40  Q_OBJECT
41 public:
42  LayoutWidgetUsingViewWidgets(RenderWindowFactoryPtr factory, QWidget *parent);
44 
45  virtual ViewPtr addView(View::Type type, LayoutRegion region);
46  virtual void setOffScreenRenderingAndClear(bool on);
47  virtual bool getOffScreenRendering() const;
48  virtual void clearViews();
49  virtual void setModified();
50  virtual void render();
51  virtual void setGridSpacing(int val);
52  virtual void setGridMargin(int val);
53  virtual int getGridSpacing() const;
54  virtual int getGridMargin() const;
55  virtual std::vector<ViewPtr> getViews();
56  virtual QPoint getPosition(ViewPtr view);
57  virtual void enableContextMenuForViews(bool enable);
58 
59 protected:
60  std::vector<ViewWidget*> mViews;
61 
62 private:
63  ViewWidget* WidgetFromView(ViewPtr view);
64 
65  MultiViewCachePtr mViewCache;
66  QGridLayout* mLayout;
67  bool mOffScreenRendering;
68 };
69 
70 } // namespace cx
71 
72 #endif /* CXVIEWCOLLECTIONWIDGETUSINGVIEWWIDGETS_H_ */
boost::shared_ptr< class MultiViewCache > MultiViewCachePtr
boost::shared_ptr< class View > ViewPtr
boost::shared_ptr< class RenderWindowFactory > RenderWindowFactoryPtr
Namespace for all CustusX production code.