FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
SegmentationLabelRenderer.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 #include <FAST/Data/Color.hpp>
5 
6 namespace fast {
7 
8 class RegionList;
9 class Image;
10 
11 class FAST_EXPORT SegmentationLabelRenderer : public Renderer {
13  public:
14  void setLabelName(int label, std::string name);
15  void setLabelColor(int label, Color color);
16  void setAreaThreshold(float threshold);
17  void draw(Matrix4f perspectiveMatrix, Matrix4f viewingMatrix, float zNear, float zFar, bool mode2D) override;
18  void loadAttributes() override;
19  protected:
21  void execute() override;
22 
23  std::unordered_map<uint, uint> mTexturesToRender;
24  std::unordered_map<uint, uint> mVAO;
25  std::unordered_map<uint, uint> mVBO;
26  std::unordered_map<uint, uint> mEBO;
27  std::unordered_map<uint, std::shared_ptr<RegionList>> m_regions;
28  std::unordered_map<uint, std::shared_ptr<Image>> mImageUsed;
32  std::unordered_map<uint, uint64_t> mDataTimestamp;
33  std::unordered_map<uint, float> mScales;
34  std::unordered_map<int, Color> m_labelColors;
35  std::unordered_map<int, std::string> m_labelNames;
36 
38  Vector2f m_worldPosition;
39  Vector2f m_viewPosition;
40  float m_textHeightInMM = 1.0f;
41  bool m_centerPosition = true;
42  bool m_dynamicSize = true;
44 };
45 
46 }
fast::Renderer
Definition: Renderer.hpp:14
fast::SegmentationLabelRenderer::m_viewPosition
Vector2f m_viewPosition
Definition: SegmentationLabelRenderer.hpp:39
fast
Definition: AffineTransformation.hpp:7
fast::SegmentationLabelRenderer::mVBO
std::unordered_map< uint, uint > mVBO
Definition: SegmentationLabelRenderer.hpp:25
fast::SegmentationLabelRenderer::m_labelColors
std::unordered_map< int, Color > m_labelColors
Definition: SegmentationLabelRenderer.hpp:34
FAST_OBJECT
#define FAST_OBJECT(className)
Definition: Object.hpp:9
fast::SegmentationLabelRenderer::m_areaThreshold
float m_areaThreshold
Definition: SegmentationLabelRenderer.hpp:43
fast::SegmentationLabelRenderer::mVAO
std::unordered_map< uint, uint > mVAO
Definition: SegmentationLabelRenderer.hpp:24
fast::SegmentationLabelRenderer::m_labelNames
std::unordered_map< int, std::string > m_labelNames
Definition: SegmentationLabelRenderer.hpp:35
fast::SegmentationLabelRenderer
Definition: SegmentationLabelRenderer.hpp:11
fast::SegmentationLabelRenderer::m_regions
std::unordered_map< uint, std::shared_ptr< RegionList > > m_regions
Definition: SegmentationLabelRenderer.hpp:27
Renderer.hpp
fast::SegmentationLabelRenderer::mFontSize
uint mFontSize
Definition: SegmentationLabelRenderer.hpp:37
fast::SegmentationLabelRenderer::mScales
std::unordered_map< uint, float > mScales
Definition: SegmentationLabelRenderer.hpp:33
fast::SegmentationLabelRenderer::m_worldPosition
Vector2f m_worldPosition
Definition: SegmentationLabelRenderer.hpp:38
fast::SegmentationLabelRenderer::mImageUsed
std::unordered_map< uint, std::shared_ptr< Image > > mImageUsed
Definition: SegmentationLabelRenderer.hpp:28
fast::SegmentationLabelRenderer::mTexturesToRender
std::unordered_map< uint, uint > mTexturesToRender
Definition: SegmentationLabelRenderer.hpp:23
fast::SegmentationLabelRenderer::mDataTimestamp
std::unordered_map< uint, uint64_t > mDataTimestamp
Definition: SegmentationLabelRenderer.hpp:32
Color.hpp
uint
unsigned int uint
Definition: DataTypes.hpp:16
fast::Color
Definition: Color.hpp:8
fast::SegmentationLabelRenderer::mEBO
std::unordered_map< uint, uint > mEBO
Definition: SegmentationLabelRenderer.hpp:26