VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgWidgetLabel.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 
14 #include <vrvCore/DtWidgetLabel.h>
15 
17 
18 #include <osg/ref_ptr>
19 #include <osg/Texture>
20 
21 namespace osg
22 {
23  class Texture;
24 }
25 
26 namespace makVrv
27 {
28 
29  class DtSprite;
30  class DtTextProxy;
31 
35  {
36  public:
37 
39  DtOsgWidgetLabel( DtDe& de, DtUniqueID id );
40 
42  virtual ~DtOsgWidgetLabel();
43 
45  virtual void setOverlay( unsigned int layer );
46 
48  virtual unsigned int overlay() const;
49 
51  virtual void setOrderGroup( unsigned int group );
52 
54  virtual unsigned int orderGroup() const;
55 
57  virtual void setPosition( float x, float y, float z, float w = 0 );
58 
61  virtual void setText( const DtUnicode& string );
62 
64  virtual void setFont( const std::string& font, float size );
65 
67  virtual void setFontScale( float scale );
68 
70  virtual float fontScale() const;
71 
73  virtual void setBackgroundImage( const std::string& filename );
74  virtual void setBackgroundImage( const std::string& filename,
75  float left, float right, float bottom, float top );
76 
78  virtual void setTextColor( float r,float g,float b, float a );
79 
81  virtual void setColor( float r, float g, float b, float a );
82 
85  virtual void setOrigin( float originX, float originY);
86 
88  virtual void setSize( float w, float h);
89 
91  virtual void getSize(float& width, float& height);
92 
94  virtual void setPadding( float paddingX, float paddingY );
95 
97  virtual void setModelDefinition( const std::string& str );
98 
100  virtual void setTextAlignment( DtWidgetLabel::HorizontalAlignment ha );
101 
103  virtual void setGlyphCenterPolicy( DtWidgetLabel::GlyphCenterPolicy gcp );
104 
106  virtual void setEventsEnabled( bool enabled );
107 
109  virtual void setVisible( bool visible );
110 
113  virtual void setBoundsLength( int len );
114 
116  virtual void setRotation( float angle );
117 
119  virtual double getRotation() const;
120 
123  virtual void setSizeConstraints(SizeConstraints);
124  protected:
125 
126  void updateBounds( bool calculateText );
127  void updateTextBounds( DtBoundingBox box, bool calculateText );
128  void updateFont( const std::string& font );
129 
130  protected:
131 
136  unsigned int myOverlay;
137  float myWidth;
138  float myHeight;
139  float myOriginX;
140  float myOriginY;
141  float myPaddingX;
142  float myPaddingY;
143  float myRotation;
144  unsigned int myGroup;
145  float myFontScale;
150  };
151 
152 }
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
GlyphCenterPolicy
Definition: DtWidgetLabel.h:33
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
A unicode string.
Definition: DtUnicode.h:33
float myOriginX
Definition: DtOsgWidgetLabel.h:139
A synchronized Quad and Widget for a interactive visible 2D graphic.
Definition: DtSprite.h:25
GlyphCenterPolicy myCenterPolicy
Definition: DtOsgWidgetLabel.h:148
Contains the makVrv::DtBoundingBox class declaration.
int myFontSize
Definition: DtOsgWidgetLabel.h:146
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
float myOriginY
Definition: DtOsgWidgetLabel.h:140
voidpf void uLong size
Definition: ioapi.h:39
A class for controlling text owned by the TextRenderer.
Definition: DtTextRenderer.h:90
float myPaddingX
Definition: DtOsgWidgetLabel.h:141
unsigned int myOverlay
Definition: DtOsgWidgetLabel.h:136
DtTextProxy * myText
Definition: DtOsgWidgetLabel.h:134
int myBoundsLength
Definition: DtOsgWidgetLabel.h:147
The osg implementation of a label.
Definition: DtOsgWidgetLabel.h:34
SizeConstraints mySizeConstraints
Definition: DtOsgWidgetLabel.h:149
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
float myHeight
Definition: DtOsgWidgetLabel.h:138
Contains the makVrv::DtWidgetLabel class declaration.
SizeConstraints
Definition: DtWidgetLabel.h:42
This is the implementation independent widget class for showing text.
Definition: DtWidgetLabel.h:21
unsigned long long DtUniqueID
Definition: DtUniqueID.h:22
osg::ref_ptr< osg::Texture > myTexture
Definition: DtOsgWidgetLabel.h:132
float myWidth
Definition: DtOsgWidgetLabel.h:137
float myFontScale
Definition: DtOsgWidgetLabel.h:145
float myRotation
Definition: DtOsgWidgetLabel.h:143
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
float myPaddingY
Definition: DtOsgWidgetLabel.h:142
HorizontalAlignment
Definition: DtWidgetLabel.h:25
DtBoundingBox myTextBounds
Definition: DtOsgWidgetLabel.h:135
DtSprite * mySprite
Definition: DtOsgWidgetLabel.h:133
unsigned int myGroup
Definition: DtOsgWidgetLabel.h:144
A simple bounding box.
Definition: DtBoundingBox.h:101

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)