Code_TYMPAN  4.4.0
Industrial site acoustic simulation
OGLScalarBarElement.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
16 /*
17  *
18  *
19  *
20  *
21  */
22 
23 #ifndef __OGL_SCALARBAR_ELEMENT
24 #define __OGL_SCALARBAR_ELEMENT
25 
26 #include <qvector3d.h>
27 #include "OGLElement.h"
28 #include "Tympan/core/color.h"
30 
31 #include <qstring.h>
32 
33 class OGLRectangle;
34 class OGLFont;
35 
40 {
41 public:
46 
50  virtual ~OGLScalarBarElement();
51 
52  virtual int render();
53 
54  void setFont(const QString& qsFontPath)
55  {
56  m_qsFontPath = qsFontPath;
57  };
58  void setFontColor(const OColor& oFontColor)
59  {
60  m_oFontColor = oFontColor;
61  };
62 
63  void setPosition(const QVector3D& position)
64  {
65  m_oPosition = position;
66  };
67  void setTexts(const std::string& text0, const std::string& text1, const std::string& text2)
68  {
69  m_stdText0 = text0;
70  m_stdText1 = text1;
71  m_stdText2 = text2;
72  };
73  void setSizes(float width, float height)
74  {
75  m_fWidth = width;
76  m_fHeight = height;
77  };
78  void initPositions();
79 
80  const QVector3D& getPosition()
81  {
82  return m_oPosition;
83  };
84 
85  const float getWidth()
86  {
87  return m_fWidth;
88  }
89 
90 protected:
91  QVector3D m_oPosition;
92  QVector3D m_oPosA; // A ----- B ------ C
93  QVector3D m_oPosB; // | | |
94  QVector3D m_oPosC; // D ----- E ------ F
95  QVector3D m_oPosD;
96  QVector3D m_oPosE;
97  QVector3D m_oPosF;
98  std::string m_stdText0;
99  std::string m_stdText1;
100  std::string m_stdText2;
101  float m_fWidth;
102  float m_fHeight;
108  QString m_qsFontPath;
110 };
111 
112 #endif //__OGL_SCALARBAR_ELEMENT
All base classes related to 3D manipulation.
Definition: color.h:36
void setSizes(float width, float height)
void setTexts(const std::string &text0, const std::string &text1, const std::string &text2)
OGLRectangle * m_pOGLRectangleRightToDisplay
OGLRectangle * m_pOGLRectangleLeftToDisplay
void setFontColor(const OColor &oFontColor)
void setFont(const QString &qsFontPath)
void setPosition(const QVector3D &position)
const QVector3D & getPosition()