FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
ValuesDisplayBase.h
1
11#ifdef FH_VISUALIZATION
12
13# ifndef ValuesDisplayBase_H
14# define ValuesDisplayBase_H
15
16# include <fhsim/visual/renderer/TextRenderer.h>
17# include <vector>
18
20{
21public:
22 struct DisplayValue
23 {
24 std::string description;
25 std::string format;
26 std::string unit;
27 int size;
28 double multiplier;
29 DisplayValue(int size, std::string description = "Output value:", std::string format = "{:4.2}", std::string unit = "", double multiplier = 1.0)
30 {
31 this->description = description;
32 this->format = format;
33 this->unit = unit;
34 this->multiplier = multiplier;
35 this->size = size;
36 }
37 };
38
40 ValuesDisplayBase(std::vector<DisplayValue> valueSpec,
41 double x, double y, double width, double height,
42 Ogre::ColourValue color = Ogre::ColourValue(1.0, 1.0, 1.0, 1.0),
43 int fontSize = 16,
44 std::string fontname = "cour",
45 std::string arrayBegin = "[",
46 std::string arrayEnd = "]");
47
50
51 void UpdateVals(std::vector<double> vals);
52 void UpdateVals(const double* const vals);
53 Ogre::OverlayElement* GetOverlayElement();
54 void SetMaterialName(std::string material);
55
56protected:
57 TextRenderer* m_textRenderer;
58 std::string m_ID;
59 std::string m_text;
60 double m_x;
61 double m_y;
62 double m_width;
63 double m_height;
64 Ogre::ColourValue m_color;
65 int m_fontSize;
66 int m_numVals;
67 std::string m_fontname;
68 std::string m_name;
69 Ogre::OverlayElement* m_overlayElement;
70 std::vector<size_t> m_values_element;
71 std::vector<double> m_multipliers;
72 std::vector<std::string> m_formats;
73};
74
75# endif
76#endif
Class for displaying a range of values in Ogre.