55
66namespace fast {
77
8+ /* *
9+ * @brief Abstract base class use by ImageRenderer and SegmentationRenderer
10+ * @ingroup renderers
11+ */
12+ class ImageRendererBase : public virtual Renderer {
13+ protected:
14+ ImageRendererBase () {};
15+ virtual void deleteAllTextures ();
16+ std::unordered_map<uint, uint> mTexturesToRender ;
17+ std::unordered_map<uint, Image::pointer> mImageUsed ;
18+ /* *
19+ * Timestamp used to generate texture
20+ */
21+ std::unordered_map<uint, uint64_t > mDataTimestamp ;
22+ std::unordered_map<uint, uint> mVAO ;
23+ std::unordered_map<uint, uint> mVBO ;
24+ std::unordered_map<uint, uint> mEBO ;
25+
26+ cl::Kernel mKernel ;
27+
28+ // Level and window intensities
29+ float mWindow = -1 ;
30+ float mLevel = -1 ;
31+ float m_opacity = -1 ;
32+ bool m_applyTransformationsIn2D = false ;
33+
34+ void drawTextures (std::unordered_map<uint, std::shared_ptr<SpatialDataObject>> copy, Matrix4f &perspectiveMatrix, Matrix4f &viewingMatrix, bool mode2D, bool useInterpolation = false , bool useWindowLevel = true );
35+ };
36+
837/* *
938 * @brief Renders 2D Image data objects, both in 2D and 3D.
1039 *
1140 * @ingroup renderers
1241 */
13- class FAST_EXPORT ImageRenderer : public virtual Renderer {
42+ class FAST_EXPORT ImageRenderer : public ImageRendererBase {
1443 FAST_PROCESS_OBJECT (ImageRenderer)
1544 public:
1645 /* *
@@ -39,28 +68,7 @@ class FAST_EXPORT ImageRenderer : public virtual Renderer {
3968 void
4069 draw (Matrix4f perspectiveMatrix, Matrix4f viewingMatrix, float zNear, float zFar, bool mode2D, int viewWidth,
4170 int viewHeight);
42- virtual void deleteAllTextures ();
4371
44-
45- std::unordered_map<uint, uint> mTexturesToRender ;
46- std::unordered_map<uint, Image::pointer> mImageUsed ;
47- /* *
48- * Timestamp used to generate texture
49- */
50- std::unordered_map<uint, uint64_t > mDataTimestamp ;
51- std::unordered_map<uint, uint> mVAO ;
52- std::unordered_map<uint, uint> mVBO ;
53- std::unordered_map<uint, uint> mEBO ;
54-
55- cl::Kernel mKernel ;
56-
57- // Level and window intensities
58- float mWindow = -1 ;
59- float mLevel = -1 ;
60- float m_opacity = -1 ;
61- bool m_applyTransformationsIn2D = false ;
62-
63- void drawTextures (std::unordered_map<uint, std::shared_ptr<SpatialDataObject>> copy, Matrix4f &perspectiveMatrix, Matrix4f &viewingMatrix, bool mode2D, bool useInterpolation = false , bool useWindowLevel = true );
6472};
6573
6674}
0 commit comments