CustusX  22.04-rc5
An IGT application
cxMultiViewCache.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 CXMULTIVIEWCACHE_H
13 #define CXMULTIVIEWCACHE_H
14 
15 #include "cxResourceVisualizationExport.h"
16 
17 #include <QWidget>
18 #include <QLayout>
19 #include <vector>
20 #include "cxTypeConversions.h"
21 #include "cxOSXHelper.h"
22 #include "cxViewWidget.h"
23 #include "cxViewCache.h"
24 
25 namespace cx
26 {
42 typedef boost::shared_ptr<class MultiViewCache> MultiViewCachePtr;
43 
44 class cxResourceVisualization_EXPORT MultiViewCache
45 {
46 public:
47  static MultiViewCachePtr create(RenderWindowFactoryPtr factory) { return MultiViewCachePtr(new MultiViewCache(factory)); }
49 
50  ViewWidget* retrieveView(QWidget* widget, View::Type type, bool offScreenRendering);
51  void clearViews();
52  void clearCache();
53 
54 private:
55  typedef boost::shared_ptr<ViewCache<ViewWidget> > ViewCachePtr;
56  std::map<QString, ViewCachePtr> mViewCache;
57  vtkRenderWindowPtr mStaticRenderWindow;
58  RenderWindowFactoryPtr mRenderWindowFactory;
59 };
60 
64 } // namespace cx
65 
66 
67 #endif // CXMULTIVIEWCACHE_H
boost::shared_ptr< class MultiViewCache > MultiViewCachePtr
vtkSmartPointer< class vtkRenderWindow > vtkRenderWindowPtr
static MultiViewCachePtr create(RenderWindowFactoryPtr factory)
boost::shared_ptr< class RenderWindowFactory > RenderWindowFactoryPtr
Namespace for all CustusX production code.