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

An OSG Implementation of DtWindowTextInstance. Uses a vrvGraphics DtTextProxy to implement 2D text.

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

Public Member Functions

 DtOsgWindowTextInstance (DtDe &de)
 
virtual ~DtOsgWindowTextInstance ()
 
virtual void setVisible (bool isVisible)
 
virtual void setTopLeftCorner (float x, float y)
 
virtual void setColor (float r, float g, float b, float a)
 
virtual void setText (const std::string &textString)
 
virtual void setFont (const std::string &fontFilePath, float sizeInPoints)
 
virtual void setTextBoxWidth (unsigned int widthInPixels)
 
virtual void setAlignment (DtWindowText::TextAlignment alignment)
 
virtual bool visible () const
 
virtual void setTransform (DtMatrix3< double > transform)
 
virtual void update ()
 
virtual void setGroup (int groupId)
 
virtual void setChannelOverlay (const std::string &displayName, const std::string &windowName, const std::string &channelName) override
 
void createText ()
 
- Public Member Functions inherited from makVrv::DtWindowTextInstance
virtual ~DtWindowTextInstance ()
 
- Public Member Functions inherited from makVrv::DtSetVisibilityInterface
virtual ~DtSetVisibilityInterface ()
 

Protected Member Functions

virtual void setClipBox (DtVector2< double > bottomLeftLocation, DtVector2< double > topRightLocation)
 
virtual void slot_releaseResources ()
 
virtual void slot_channelToBeDestroyed (DtChannelManager *, DtChannel *)
 
virtual void slot_onViewCreated ()
 
virtual bool clipTextPosition (osg::Vec2 position)
 

Protected Attributes

DtDemyDe
 
float myColorR
 
float myColorG
 
float myColorB
 
float myColorA
 
std::string myFontFile
 
std::string myTextString
 
std::string myDisplayName
 
std::string myWindowName
 
std::string myChannelName
 
DtFontSP myFont
 
float mySize
 
float myWidth
 
osg::Vec2 myTopLeftPosition
 
osg::Vec2 myClipBoxBottomLeft
 
osg::Vec2 myClipBoxTopRight
 
DtFont::TextAlignement myAlignment
 
DtTextProxymyText
 
bool myIsVisible
 
bool myGeometryDirty
 
bool myUseChannelOverlay
 
osg::Matrix myTransform
 
int myGroup
 
DtSignalConnectionManager myConnections
 

Constructor & Destructor Documentation

makVrv::DtOsgWindowTextInstance::DtOsgWindowTextInstance ( DtDe de)

CTOR.

virtual makVrv::DtOsgWindowTextInstance::~DtOsgWindowTextInstance ( )
virtual

DTOR.

Member Function Documentation

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

Set the text visible or invisible.

Implements makVrv::DtWindowTextInstance.

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

Set the Top left corner of the text in normalized screen coordinates (0..1)

Implements makVrv::DtWindowTextInstance.

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

Set the text's color.

Implements makVrv::DtWindowTextInstance.

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

Set the text to display.

Implements makVrv::DtWindowTextInstance.

virtual void makVrv::DtOsgWindowTextInstance::setFont ( const std::string &  fontFilePath,
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

Implements makVrv::DtWindowTextInstance.

virtual void makVrv::DtOsgWindowTextInstance::setTextBoxWidth ( unsigned int  widthInPixels)
virtual

Set the width of the text box in pixels.

Implements makVrv::DtWindowTextInstance.

virtual void makVrv::DtOsgWindowTextInstance::setAlignment ( DtWindowText::TextAlignment  alignment)
virtual

Set the alignment mode of the text.

Implements makVrv::DtWindowTextInstance.

virtual bool makVrv::DtOsgWindowTextInstance::visible ( ) const
virtual

Get the text's visibility status.

virtual void makVrv::DtOsgWindowTextInstance::setTransform ( DtMatrix3< double transform)
virtual

Sets the line's transform matrix, used to update the position and clockwise rotation of the vertices.

Implements makVrv::DtWindowTextInstance.

virtual void makVrv::DtOsgWindowTextInstance::update ( )
virtual

Called on signal_postUpdate; time to update render data.

Implements makVrv::DtWindowTextInstance.

virtual void makVrv::DtOsgWindowTextInstance::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.

Implements makVrv::DtWindowTextInstance.

virtual void makVrv::DtOsgWindowTextInstance::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.

Implements makVrv::DtWindowTextInstance.

void makVrv::DtOsgWindowTextInstance::createText ( )

Create the text object.

virtual void makVrv::DtOsgWindowTextInstance::setClipBox ( DtVector2< double bottomLeftLocation,
DtVector2< double topRightLocation 
)
protectedvirtual

Set this objects clip box bounds This does not clip text yet.

Implements makVrv::DtWindowTextInstance.

virtual void makVrv::DtOsgWindowTextInstance::slot_releaseResources ( )
protectedvirtual

Destroy the text when the resources are released since it's fonts won't work anymore.

virtual void makVrv::DtOsgWindowTextInstance::slot_channelToBeDestroyed ( DtChannelManager ,
DtChannel  
)
protectedvirtual

Destroy the text when the channel its being rendered on is going to be destroyed.

virtual void makVrv::DtOsgWindowTextInstance::slot_onViewCreated ( )
protectedvirtual

Recreate the text if needed when a new window is created.

virtual bool makVrv::DtOsgWindowTextInstance::clipTextPosition ( osg::Vec2  position)
protectedvirtual

Check whether the position of this text box is within the clip box. Checks against top left position.

Member Data Documentation

DtDe& makVrv::DtOsgWindowTextInstance::myDe
protected
float makVrv::DtOsgWindowTextInstance::myColorR
protected
float makVrv::DtOsgWindowTextInstance::myColorG
protected
float makVrv::DtOsgWindowTextInstance::myColorB
protected
float makVrv::DtOsgWindowTextInstance::myColorA
protected
std::string makVrv::DtOsgWindowTextInstance::myFontFile
protected
std::string makVrv::DtOsgWindowTextInstance::myTextString
protected
std::string makVrv::DtOsgWindowTextInstance::myDisplayName
protected
std::string makVrv::DtOsgWindowTextInstance::myWindowName
protected
std::string makVrv::DtOsgWindowTextInstance::myChannelName
protected
DtFontSP makVrv::DtOsgWindowTextInstance::myFont
protected
float makVrv::DtOsgWindowTextInstance::mySize
protected
float makVrv::DtOsgWindowTextInstance::myWidth
protected
osg::Vec2 makVrv::DtOsgWindowTextInstance::myTopLeftPosition
protected
osg::Vec2 makVrv::DtOsgWindowTextInstance::myClipBoxBottomLeft
protected
osg::Vec2 makVrv::DtOsgWindowTextInstance::myClipBoxTopRight
protected
DtFont::TextAlignement makVrv::DtOsgWindowTextInstance::myAlignment
protected
DtTextProxy* makVrv::DtOsgWindowTextInstance::myText
protected
bool makVrv::DtOsgWindowTextInstance::myIsVisible
protected
bool makVrv::DtOsgWindowTextInstance::myGeometryDirty
protected
bool makVrv::DtOsgWindowTextInstance::myUseChannelOverlay
protected
osg::Matrix makVrv::DtOsgWindowTextInstance::myTransform
protected
int makVrv::DtOsgWindowTextInstance::myGroup
protected
DtSignalConnectionManager makVrv::DtOsgWindowTextInstance::myConnections
protected

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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)