VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtWindowText Class Reference

A model-like object that draws a 2D text on screen. This window text class inherits from DtWindowObject() which means it can be included in a parent/child relationship with other window objects, including surfaces, lines, polygons, and ellipses. Rotations are around the Top Left Corner that is set, the top left position is relative to the position set in the base class. Text is not currently clipped by each letter, clipping that occurs if this object is attached to a surface, is based on the top left position. If the object is clipped, it is clipped entirely. If this object is a child of another object, the position set is relative to the parent. Scale does not currently work for DtWindowText, please change the font size.

Inheritance diagram for makVrv::DtWindowText:
Inheritance graph
[legend]

Public Types

enum  TextAlignment { Left = 0, Center = 1, Right = 2, Justify = 3 }
 
- Public Types inherited from makVrv::DtWindowObject
typedef std::list< DtUniqueIDChildList
 
typedef DtVector2< doubleDtVector2d
 
typedef DtMatrix3< doubleTransform
 

Public Member Functions

 DtWindowText (DtDe &de, DtUniqueID id)
 
virtual ~DtWindowText ()
 
virtual void setTopLeftCorner (float x, float y)
 
virtual void setVisible (bool isVisible)
 
virtual void setColor (float r, float g, float b, float a)
 
virtual void setText (const std::string &textString)
 
virtual void setFont (const std::string &fontFile, float sizeInPoints)
 
virtual void setTextBoxWidth (unsigned int widthInPixels)
 
virtual void setAlignment (unsigned int alignment)
 
virtual void setInstance (DtWindowTextInstance *instance)
 
virtual DtWindowTextInstancefindInstance ()
 
virtual void setGroup (int groupId)
 
virtual void setChannelOverlay (const std::string &displayName, const std::string &windowName, const std::string &channelName) override
 
- Public Member Functions inherited from makVrv::DtWindowObject
 DtWindowObject (DtDe &de, DtUniqueID id)
 
virtual ~DtWindowObject ()
 
virtual bool visible ()
 
virtual DtUniqueID uniqueId ()
 
DtWindowObjectgetParent ()
 
virtual ChildList childList ()
 
virtual void addChild (DtUniqueID id)
 
virtual void removeChild (DtUniqueID id)
 
virtual void getColor (float &r, float &g, float &b, float &a)
 
virtual void slot_postTick ()
 
virtual Transform windowTransform ()
 
virtual DtClipBox clipBox ()
 
virtual void setParentId (DtUniqueID parentId)
 
virtual DtUniqueID getParentId ()
 
virtual void setPosition (double x, double y)
 
virtual void getPosition (double &x, double &y)
 
virtual void setScale (double scale)
 
virtual void setScale (double x, double y)
 
virtual void getScale (double &x, double &y)
 
virtual void setRotation (double rotation)
 
virtual void getRotation (double &rotation)
 
virtual void setInheritColor (bool inheritColor)
 
virtual bool inheritColor ()
 
virtual int group ()
 
virtual void setFlashing (bool flashing, double interval)
 
virtual void getFlashing (bool &flashing, double &interval)
 
virtual void getChannelOverlay (std::string &displayName, std::string &windowName, std::string &channelName)
 

Protected Member Functions

virtual void update ()
 
virtual void needsUpdate ()
 

Protected Attributes

DtWindowTextInstancemyInstance
 
bool myConnectedToPostUpdate
 
- Protected Attributes inherited from makVrv::DtWindowObject
DtDemyDe
 
DtUniqueID myUniqueId
 
DtUniqueID myParentId
 
ChildList myChildIdList
 
DtVector2d myPosition
 
DtVector2d myScale
 
DtVector2d myWindowScale
 
double myRotation
 
double myFlashInterval
 
double myLastFlashTime
 
double myLastSimTime
 
bool myVisible
 
bool myLastVisibilityFlash
 
bool myInheritColor
 
bool myFlashing
 
float myColorR
 
float myColorG
 
float myColorB
 
float myColorA
 
Transform myWindowTransform
 
DtClipBox myClipBox
 
int myGroup
 
std::string myDisplayName
 
std::string myWindowName
 
std::string myChannelName
 

Member Enumeration Documentation

Enumerator
Left 
Center 
Right 
Justify 

Constructor & Destructor Documentation

makVrv::DtWindowText::DtWindowText ( DtDe de,
DtUniqueID  id 
)

CTOR.

virtual makVrv::DtWindowText::~DtWindowText ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtWindowText::setTopLeftCorner ( float  x,
float  y 
)
virtual

Set the Top left corner of the text in normalized screen coordinates (0..1) This position is relative to the position set in the base DtWindowObject::setPosition, if no position is set it defaults to (0.0,0.0)

virtual void makVrv::DtWindowText::setVisible ( bool  isVisible)
virtual

Set the text visible or invisible.

Reimplemented from makVrv::DtWindowObject.

virtual void makVrv::DtWindowText::setColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Set the text's color.

Reimplemented from makVrv::DtWindowObject.

virtual void makVrv::DtWindowText::setText ( const std::string &  textString)
virtual

Set the text to display.

virtual void makVrv::DtWindowText::setFont ( const std::string &  fontFile,
float  sizeInPoints 
)
virtual

Set the font file path and size in points to display the text in The fontFilePath provided can make use of VRV Path Macros, e.g. the fontFilePath could be: /Fonts/arial.ttf.

See Also
DtDePathConfiguration
virtual void makVrv::DtWindowText::setTextBoxWidth ( unsigned int  widthInPixels)
virtual

Set the width of the text box in pixels.

virtual void makVrv::DtWindowText::setAlignment ( unsigned int  alignment)
virtual

Set the alignment mode of the text.

virtual void makVrv::DtWindowText::setInstance ( DtWindowTextInstance instance)
virtual

Set or replace the text instance that implements the text graphically Transfers ownership.

virtual DtWindowTextInstance* makVrv::DtWindowText::findInstance ( )
virtual

Get the text instance that implements the text graphically.

virtual void makVrv::DtWindowText::setGroup ( int  groupId)
virtual

Set this object's group ID for z order. The higher the Z order the "closer" the element will be drawn to the eye point.

Reimplemented from makVrv::DtWindowObject.

virtual void makVrv::DtWindowText::setChannelOverlay ( const std::string &  displayName,
const std::string &  windowName,
const std::string &  channelName 
)
overridevirtual

By default window objects are placed on the RemoteDisplayWorldOverlay, which is rendered on all channels that have the "showRemoteGraphics" channel keyword. If a user wishes to draw a specific window object on a specific channel, use this method. This does not work for remote displays.

Reimplemented from makVrv::DtWindowObject.

virtual void makVrv::DtWindowText::update ( )
protectedvirtual

Called on signal_postUpdate; time to update render data.

virtual void makVrv::DtWindowText::needsUpdate ( )
protectedvirtual

Called by all mutators to set up a postUpdate signal if not already connected.

Reimplemented from makVrv::DtWindowObject.

Member Data Documentation

DtWindowTextInstance* makVrv::DtWindowText::myInstance
protected
bool makVrv::DtWindowText::myConnectedToPostUpdate
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)