VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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  virtual ~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 }
Generic base class for text layout renderers.
Definition: DtTextLayoutInterface.h:24
DtTextLayoutInterface * myTextLayout
Definition: DtTextRenderer.h:179
DtFontSP myFont
Definition: DtTextRenderer.h:178
A unicode string.
Definition: DtUnicode.h:33
DtProjected2DTexturedEffect * myEffect
Definition: DtTextRenderer.h:82
Contains the makVrv::DtBoundingBox class declaration.
A 2D point.
Definition: DtBoundingBox.h:19
A class the wraps a OpenGL Array Buffer object.
Definition: DtBufferObject.h:17
DtTexturedGlyphRenderer * myGlyphRenderer
Definition: DtTextRenderer.h:81
A glyph renderer which renders the texture associated with a glyph.
Definition: DtTexturedGlyphRenderer.h:23
A class for controlling text owned by the TextRenderer.
Definition: DtTextRenderer.h:90
DtFont::TextAlignement myAlignment
Definition: DtTextRenderer.h:175
A extended precision 2D quad rendering effect.
Definition: DtProjected2DTexturedEffect.h:19
DtTextRenderer * myParent
Definition: DtTextRenderer.h:168
TextAlignement
Definition: DtFont.h:33
A class for rendering text object.
Definition: DtTextRenderer.h:36
The overlay resource provider class provies resources for overlay drawing classes.
Definition: DtOverlayResourceProvider.h:23
TextProxyList myProxyList
Definition: DtTextRenderer.h:80
#define DT_DLL_VRVGRAPHICS
Contains DLL export macros.
Definition: vrvGraphics.h:19
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
Abstract primitive rendering base class.
Definition: DtPrimitiveRenderer.h:18
unsigned int myGroup
Definition: DtTextRenderer.h:173
DtBufferObject * myBufferObject
Definition: DtTextRenderer.h:84
boost::weak_ptr< DtFont > DtFontWP
Definition: DtFontManager.h:23
float myRotation
Definition: DtTextRenderer.h:170
boost::shared_ptr< DtFont > DtFontSP
Definition: DtFontManager.h:20
std::vector< DtTextProxy * > TextProxyList
Definition: DtTextRenderer.h:79
A pen object with parameters on how to draw text.
Definition: DtBoundingBox.h:80
DtUnicode myString
Definition: DtTextRenderer.h:176
const char int mode
Definition: ioapi.h:38
Contains makVrv::DtFont class.
Contains the makVrv::DtTextured2DRenderer class declaration.
DtBoundingBox myBounds
Definition: DtTextRenderer.h:177
DtFont::TextAlignement alignment() const
Returns alignment.
Definition: DtTextRenderer.h:107
A simple bounding box.
Definition: DtBoundingBox.h:101

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)