-
Notifications
You must be signed in to change notification settings - Fork 7
/
CornerOverlay.h
33 lines (25 loc) · 970 Bytes
/
CornerOverlay.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include <map>
#include <string>
#include <vtkNew.h>
#include <vtkOpenGLTextActor.h>
class CornerOverlay
{
public:
CornerOverlay() = default;
~CornerOverlay() = default;
//getters
[[nodiscard]] int getNumberOfCorner() const { return m_numberOfCorner; }
[[nodiscard]] vtkOpenGLTextActor* getTextActor();
[[nodiscard]] std::string getOverlayFromInfo();
//setters
void setNumberOfCorner(const int& t_nr) { m_numberOfCorner = t_nr; }
void setOverlayInfo(const std::string& t_key, const std::string& t_value) { m_overlaysInfo[t_key] = t_value; }
void setTextActorProperty(vtkTextProperty* t_property) const { m_textActor->SetTextProperty(t_property); }
void initTextActor() { m_textActor->SetInput(getOverlayFromInfo().c_str()); }
void clearOverlaysInfo() { m_overlaysInfo.clear(); }
private:
std::map<std::string, std::string> m_overlaysInfo = {};
int m_numberOfCorner = -1;
vtkNew<vtkOpenGLTextActor> m_textActor;
};