Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SmTextureText2Collector.h
Go to the documentation of this file.
1 #ifndef SMTEXTURETEXT2COLLECTOR_H
2 #define SMTEXTURETEXT2COLLECTOR_H
3 
4 /**************************************************************************/
5 
6 #include <vector>
7 #include <Inventor/elements/SoSubElement.h>
8 #include <Inventor/elements/SoElement.h>
9 #include <Inventor/SbColor4f.h>
10 
13 
14 class SMALLCHANGE_DLL_API SmTextureText2CollectorElement : public SoElement {
15  typedef SoElement inherited;
16 
17  SO_ELEMENT_HEADER(SmTextureText2CollectorElement);
18 public:
19  static void initClass(void);
20 protected:
22 
23 public:
24 
25  typedef struct {
29  float maxdist;
33  } TextItem;
34 
35 
36  virtual void init(SoState * state);
37  static void startCollecting(SoState * state, const bool storeitems = true);
38 
39  static void add(SoState * state,
40  const SbString & text,
41  const SmTextureFont::FontImage * font,
42  const SbVec3f & worldpos,
43  const float maxdist,
44  const SbColor4f & color,
47 
48  static const std::vector <TextItem> & finishCollecting(SoState * state);
49  static bool isCollecting(SoState * state);
50 
51  virtual SbBool matches(const SoElement * elt) const;
52  virtual SoElement * copyMatchInfo(void) const;
53 
54 private:
55  bool collecting;
56  bool storeitems;
57  std::vector <TextItem> items;
58 };
59 
60 /**************************************************************************/
61 
62 #include <Inventor/nodes/SoSubNode.h>
63 #include <Inventor/nodes/SoSeparator.h>
64 #include <Inventor/fields/SoSFBool.h>
65 
66 #include <SmallChange/basic.h>
67 
68 class SMALLCHANGE_DLL_API SmTextureText2Collector : public SoSeparator {
69  typedef SoSeparator inherited;
70 
72 
73  public:
75 
76  static void initClass(void);
78 
79  virtual void GLRenderBelowPath(SoGLRenderAction * action);
80  virtual void GLRenderInPath(SoGLRenderAction * action);
81 
82  protected:
83  virtual ~SmTextureText2Collector();
84 
85  virtual void renderText(SoGLRenderAction * action,
86  const std::vector<SmTextureText2CollectorElement::TextItem> &);
87 };
88 
89 /**************************************************************************/
90 
91 #endif // SMTEXTURETEXT2COLLECTOR_H
SbVec3f worldpos
Definition: SmTextureText2Collector.h:28
VerticalJustification
Definition: SmTextureText2.h:68
#define SO_NODE_HEADER(classname)
virtual void GLRenderInPath(SoGLRenderAction *action)
Definition: SmTextureFont.h:54
static void initClass(void)
virtual SbBool matches(const SoElement *element) const=0
virtual void GLRenderBelowPath(SoGLRenderAction *action)
SbColor4f color
Definition: SmTextureText2Collector.h:30
SbString text
Definition: SmTextureText2Collector.h:26
Definition: SmTextureText2Collector.h:14
virtual void init(SoState *state)
Definition: SmTextureText2Collector.h:25
static void initClass(void)
virtual SoElement * copyMatchInfo(void) const=0
float maxdist
Definition: SmTextureText2Collector.h:29
const SmTextureFont::FontImage * font
Definition: SmTextureText2Collector.h:27
The SmTextureText2Collector node is a group node which optimizes SmTextureText2 rendering.
Definition: SmTextureText2Collector.h:68
SoSFBool depthMask
Definition: SmTextureText2Collector.h:74
SmTextureText2::Justification justification
Definition: SmTextureText2Collector.h:31
Justification
Definition: SmTextureText2.h:62
SmTextureText2::VerticalJustification vjustification
Definition: SmTextureText2Collector.h:32