VR-Forces Development_Version 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 
32  class DtBufferObject;
33 
37  {
38  public:
41 
43  ~DtTextRenderer();
44 
46  DtTextProxy* createProxy();
47 
49  DtTextProxy* cloneProxy( const DtTextProxy* );
50 
52  virtual int numberOfPrimitives() const;
53 
55  virtual void releaseResources();
56 
58  virtual bool isRenderModeSupported( int mode );
59 
60  bool forceTextShaping(void) const;
61 
63  void render( bool geocentric, float geocentricAlpha,
64  const double location[3]
65  , const double positionMatrix[16]
66  , const double projectionMatrix[16] );
67 
69  void addGroupRef( unsigned int );
70 
72  void removeGroupRef( unsigned int );
73 
75  void deleteProxy( DtTextProxy* );
76 
77  protected:
78 
79  typedef std::vector<DtTextProxy*> TextProxyList;
83 
85  };
86 
87 
91  {
92  public:
93 
95  DtTextProxy( DtTextRenderer* parent );
96 
98  DtTextProxy* clone( DtTextRenderer* parent ) const;
99 
101  virtual ~DtTextProxy();
102 
104  void setAlignment( DtFont::TextAlignement alignment );
105 
107  DtFont::TextAlignement alignment() const { return myAlignment; };
108 
110  void setParent(DtTextRenderer*);
111 
113  void setPosition( float x, float y, float z, float w = 0 );
114 
116  const float* position() const;
117 
119  void setRotation( float angle );
120 
122  float rotation() const;
123 
125  void setColor( float r, float g, float b, float a );
126 
128  const float* color() const;
129 
132  void setString( const DtUnicode& str );
133 
135  const DtUnicode& string() const;
136 
138  void setFont( DtFontSP font );
139 
141  DtFontSP font() const;
142 
144  Dt2dPoint calculateGlyphSize(const DtPen& pen,
145  const DtUnicode& string, unsigned int pos = 0, int len = -1);
146 
148  DtBoundingBox calculateBoundingBox(const DtPen& pen,
149  const DtUnicode& string, unsigned int pos = 0, int len = -1);
150 
152  void setBounds( const DtBoundingBox& box );
153 
155  const DtBoundingBox& bounds() const;
156 
158  void setGroup( unsigned int group );
159 
161  unsigned int group() const;
162 
164  virtual void renderText(DtTexturedGlyphRenderer*);
165 
166  protected:
167 
169 
170  float myRotation;
171  float myPosition[4];
172  float myColor[4];
173  unsigned int myGroup;
174 
180 
181  void makeOrChangeTextLayout(const DtUnicode& str);
182  };
183 
184 }

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)