Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SceneTextScreen.hh
1 #ifndef __SCENE_TEXT_SCREEN_HH__
2 #define __SCENE_TEXT_SCREEN_HH__
3 
4 #include <bias_config.h>
5 
6 #ifdef BIAS_HAVE_OPENGL
7 #ifdef BIAS_HAVE_FONTGL
8 #include <Utils/DrawTextGL.hh>
9 #endif
10 #endif
11 
12 #ifdef BIAS_HAVE_XML2
13 #include <Base/Common/XMLBase.hh>
14 #endif
15 
16 #include <GLviewer/Scenes/SceneBase.hh>
17 #include <Base/Geometry/HomgPoint3D.hh>
18 #include <Base/Math/RGB.hh>
19 #include <string>
20 #include <vector>
21 
22 namespace BIAS {
23  /** \class SceneTextScreen
24  \brief wrapping bias::drawtextgl to BIAS::Scene
25  \author haase
26  \ingroup g_glviewer
27  */
28  class BIASGLviewer_EXPORT SceneTextScreen : public SceneBase
29 #ifdef BIAS_HAVE_XML2
30  , public BIAS::XMLBase
31 #endif
32  {
33  public:
34  virtual ~SceneTextScreen() {}
35  SceneTextScreen(bool MakeDemoText = true);
36 
37 
38  void SetText(const std::vector<BIAS::HomgPoint3D>& textPositions,
39  const std::vector<std::string>& textContents,
40  const std::vector<BIAS::RGBf>& colors) {
41  textPositions_ = textPositions;
42  textContents_ = textContents;
43  textColors_ = colors;
44  }
45 
46 
47 
48  void Free();
49  protected:
50  virtual void Draw();
51 
52 
53 #ifdef BIAS_HAVE_XML2
54  /** @brief specialization of XML block name function */
55  virtual int XMLGetClassName(std::string& TopLevelTag,
56  double& Version) const;
57 
58  /** @brief specialization of XML write function */
59  virtual int XMLOut(const xmlNodePtr Node, BIAS::XMLIO& XMLObject) const;
60 
61  /** @brief specialization of XML read function */
62  virtual int XMLIn(const xmlNodePtr Node, BIAS::XMLIO& XMLObject);
63 #endif
64 
65 #ifdef BIAS_HAVE_OPENGL
66 #ifdef BIAS_HAVE_FONTGL
68 #endif
69 #endif
70  std::vector<BIAS::HomgPoint3D> textPositions_;
71  std::vector<std::string> textContents_;
72  std::vector<BIAS::RGBf> textColors_;
73 
74  std::string fontName_;
77  };
78 }//end of namespace
79 
80 #endif
void SetText(const std::vector< BIAS::HomgPoint3D > &textPositions, const std::vector< std::string > &textContents, const std::vector< BIAS::RGBf > &colors)
Wrapper class for reading and writing XML files based on the XML library libxml2. ...
Definition: XMLIO.hh:72
std::vector< BIAS::RGBf > textColors_
std::vector< std::string > textContents_
Base class with interface for xml output.
Definition: XMLBase.hh:56
Base class for all scenes.
Definition: SceneBase.hh:68
std::vector< BIAS::HomgPoint3D > textPositions_
BIAS::DrawTextGL drawer_
Draw text to OpenGL as 2D bitmap font.
Definition: DrawTextGL.hh:71
wrapping bias::drawtextgl to BIAS::Scene