VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtTextRenderer.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2014 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
16 #include <vrvGraphics/DtFont.h>
17 
18 #include <vrvUtil/DtUnicode.h>
19 
20 namespace makVrv
21 {
22 
23  class Dt2DEffect;
24  class DtTextProxy;
25  class DtTextLayoutInterface;
26  class DtTexturedGlyphRenderer;
27  class DtOverlayResourceProvider;
28  class DtProjected2DTexturedEffect;
29  typedef boost::weak_ptr<DtFont> DtFontWP;
30  typedef boost::shared_ptr<DtFont> DtFontSP;
31 
35  {
36  public:
39 
41  ~DtTextRenderer();
42 
44  DtTextProxy* createProxy();
45 
47  DtTextProxy* cloneProxy( const DtTextProxy* );
48 
50  virtual int numberOfPrimitives() const;
51 
53  virtual void releaseResources();
54 
56  virtual bool isRenderModeSupported( int mode );
57 
59  void render( bool geocentric, float geocentricAlpha,
60  const double location[3], const double positionMatrix[16] );
61 
63  void addGroupRef( unsigned int );
64 
66  void removeGroupRef( unsigned int );
67 
69  void deleteProxy( DtTextProxy* );
70 
71  protected:
72 
73  typedef std::vector<DtTextProxy*> TextProxyList;
77 
78  };
79 
80 
84  {
85  public:
86 
88  DtTextProxy( DtTextRenderer* parent );
89 
91  DtTextProxy* clone( DtTextRenderer* parent ) const;
92 
94  virtual ~DtTextProxy();
95 
97  void setAlignment( DtFont::TextAlignement alignment );
98 
100  DtFont::TextAlignement alignment() const { return myAlignment; };
101 
103  void setParent(DtTextRenderer*);
104 
106  void setPosition( float x, float y, float z, float w = 0 );
107 
109  const float* position() const;
110 
112  void setRotation( float angle );
113 
115  float rotation() const;
116 
118  void setColor( float r, float g, float b, float a );
119 
121  const float* color() const;
122 
125  void setString( const DtUnicode& str );
126 
128  const DtUnicode& string() const;
129 
131  void setFont( DtFontSP font );
132 
134  DtFontSP font() const;
135 
137  Dt2dPoint calculateGlyphSize(const DtPen& pen,
138  const DtUnicode& string, unsigned int pos = 0, int len = -1);
139 
141  DtBoundingBox calculateBoundingBox(const DtPen& pen,
142  const DtUnicode& string, unsigned int pos = 0, int len = -1);
143 
145  void setBounds( const DtBoundingBox& box );
146 
148  const DtBoundingBox& bounds() const;
149 
151  void setGroup( unsigned int group );
152 
154  unsigned int group() const;
155 
157  virtual void renderText(DtTexturedGlyphRenderer*);
158 
159  protected:
160 
162 
163  float myRotation;
164  float myPosition[4];
165  float myColor[4];
166  unsigned int myGroup;
167 
173  };
174 
175 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)