VR-Forces 4.1 Class Documentation
DtTextRenderer.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2011 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 DtTexturedGlyphRenderer;
26  class DtOverlayResourceProvider;
27  class DtProjected2DTexturedEffect;
28  typedef boost::weak_ptr<DtFont> DtFontWP;
29  typedef boost::shared_ptr<DtFont> DtFontSP;
30 
34  {
35  public:
36 
37  friend class DtTextProxy;
38 
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 
61  void render( bool geocentric, float geocentricAlpha,
62  const double location[3], const double positionMatrix[16] );
63 
65  void addGroupRef( unsigned int );
66 
68  void removeGroupRef( unsigned int );
69 
70  protected:
71 
73  void deleteProxy( DtTextProxy* );
74 
75  protected:
76 
77  typedef std::vector<DtTextProxy*> TextProxyList;
81 
82  };
83 
84 
88  {
89  public:
90 
91  friend class DtTextRenderer;
92 
94  ~DtTextProxy();
95 
97  void setAlignment( DtFont::TextAlignement alignment );
98 
100  void setPosition( float x, float y, float z, float w = 0 );
101 
103  void setRotation( float angle );
104 
106  void setColor( float r, float g, float b, float a );
107 
109  void setString( const DtUnicode& str );
110 
112  const DtUnicode& string() const;
113 
115  void setFont( DtFontSP font );
116 
118  DtFontSP font();
119 
121  void setBounds( const DtBoundingBox& box );
122 
124  void setGroup( unsigned int group );
125 
127  unsigned int group() const;
128 
129  protected:
130 
132  DtTextProxy( DtTextRenderer* parent );
133 
135  DtTextProxy* clone( DtTextRenderer* parent ) const;
136 
137  protected:
138 
140 
141  float myRotation;
142  float myPosition[4];
143  float myColor[4];
144  unsigned int myGroup;
145 
150 
151  };
152 
153 }

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)