VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtBaseTextAttribute.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2012 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 #include <vrvCore/DtWidget.h>
14 #include <vrvGraphics/DtFont.h>
15 #include <vrvOsg/DtAttribute.h>
16 #include <osg/Vec2>
17 
18 namespace makVrv
19 {
20 
21  class DtDe;
22  class DtTextProxy;
23 
27  {
28  public:
29 
32 
34  virtual ~DtBaseTextAttribute();
35 
37  virtual void setString( const DtUnicode& str );
38 
41  virtual void setPosition( float x, float y, float z, float w );
42 
44  virtual void getMinSize( double& xOut, double& yOut );
45 
47  virtual void setOffset( double x, double y );
48 
50  virtual void setVisible( bool isVisible );
51 
53  virtual void setColor( float r,float g,float b,float a );
54 
56  virtual void setFont( const std::string& fontFile, float sizeInPoints );
57 
59  virtual bool visible() const;
60 
62  virtual void setSize( double x, double y );
63 
66  static float pointsToPixelsAprox( float points );
67 
70  virtual void setOverlay( unsigned int overlayId );
71 
78  virtual void setGroup( unsigned int group );
79 
81  virtual void setForegroundGroup( unsigned int group );
82 
84  virtual void setBackgroundGroup( unsigned int group );
85 
87  virtual float fontSize();
88 
90  virtual const std::string& fontFile();
91 
93  virtual void setShadowText( bool enabled );
94 
95  protected:
96 
98  void setStringForText( const DtUnicode& str, DtTextProxy& text );
99 
101  void setFontForText( const std::string& fontFile, float sizeInPoints, DtTextProxy& text );
102 
104  void setOffsetForText( double x, double y, DtTextProxy& text );
105 
107  void setVisibleForText( DtTextProxy& text );
108 
110  void createText();
111 
112  protected:
113 
115  float myColorR, myColorG, myColorB, myColorA;
116  std::string myFontFile;
117 
118  float myFontSize;
119  float myWidth;
120 
121  float myOffsetX;
122  float myOffsetY;
123 
124  float myWorldX;
125  float myWorldY;
126  float myWorldZ;
127  float myWorldW;
128 
129  double mySizeX;
130  double mySizeY;
134 
136 
137  unsigned int myOverlayId;
140 
142 
143  };
144 
145 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)