VR-Forces 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::DtTextProxy Class Reference

A class for controlling text owned by the TextRenderer.

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

Public Member Functions

 DtTextProxy (DtTextRenderer *parent)
 
DtTextProxyclone (DtTextRenderer *parent) const
 
virtual ~DtTextProxy ()
 
void setAlignment (DtFontInterface::TextAlignment alignment)
 
DtFontInterface::TextAlignment alignment () const
 
void setParent (DtTextRenderer *)
 
void setPosition (float x, float y, float z, float w=0)
 
const float * position () const
 
void setMaximumWorldHeight (double worldHeightInMeters)
 
double maximumWorldHeight () const
 
void setMaximumWorldWidth (double worldWidthInMeters)
 
double maximumWorldWidth () const
 
void setIsHiddenWhenExceedingMaximumWorldDimensions (bool)
 
bool isHiddenWhenExceedingMaximumWorldDimensions () const
 
void setRotation (float angle)
 
float rotation () const
 
void setColor (float r, float g, float b, float a)
 
const float * color () const
 
void setString (const DtUnicode &str)
 
const DtUnicodestring () const
 
void setFont (DtFontInterface *font)
 
std::vector< doublefontConfigurationMinimumAltitudes () const
 
void setAltitudeSpecificFonts (const DtAltitudeBasedConfigurationCollection &)
 
void clearAltitudeSpecificFonts ()
 
void setIsForcedAltitudeBasedConfigurationEnabled (bool enabled)
 
bool isForcedAltitudeBasedConfigurationEnabled () const
 
void setBaseAltitudeToUseForForcedAltitudeBasedConfigurations (double minimumAltitudeForUse)
 
DtFontInterfacefont (double altitude=std::numeric_limits< double >::min()) const
 
DtBoundingBox calculateBoundingBox (double cameraAltitude=std::numeric_limits< double >::min(), unsigned int pos=0, int len=-1, const DtPen &pen=DtPen()) const
 
void setBounds (const DtBoundingBox &box)
 
const DtBoundingBoxbounds (double cameraAltitude) const
 
void setBoundsByMinimumAltitude (const DtBoundingBox &box, double minimumAltitudeForUse)
 
void setGroup (unsigned int group)
 
void setLodOutAltitude (double lodOutAltitude)
 
double lodOutAltitude () const
 
void setIsLodOutAltitudeEnabled (bool isLodOutAltitudeEnabled)
 
bool isLodOutAltitudeEnabled () const
 
void setIsRotationInScreenSpace (bool isRotationInScreenSpace)
 
bool isRotationInScreenSpace () const
 
unsigned int group () const
 
virtual void renderText (DtTexturedGlyphRenderer *, DtFontInterface *font, const DtObserverRenderData &channelRenderData, int proxyIndex, DtQuadsRenderData *renderData) const
 
- Public Member Functions inherited from makVrv::DtTextProxyInterface
 DtTextProxyInterface ()
 
virtual ~DtTextProxyInterface ()
 

Protected Member Functions

int computeCollectionIndexFromAltitude (const DtAltitudeBasedConfigurationCollection &collection, const double altitude) const
 
void makeOrChangeTextLayout (const DtUnicode &str)
 

Protected Attributes

DtTextRenderermyParent
 
float myRotation
 
float myPosition [4]
 
float myColor [4]
 
unsigned int myGroup
 
DtFontInterface::TextAlignment myAlignment
 
DtUnicode myString
 
DtAltitudeBasedBoundingBoxConfigurationCollection myAltitudeBasedBounds
 
DtTextLayoutInterfacemyTextLayout
 
bool myIsRotationInScreenSpace
 
bool myIsLodOutAltitudeEnabled
 
double myLodOutAltitude
 
bool myIsHiddenWhenExceedingMaximumWorldWidth
 
double myMaximumWorldWidth
 
double myMaximumWorldHeight
 
bool myIsForcedAltitudeBasedConfigurationEnabled
 
double myAltitudeToUseForForcedAltitudeBasedConfiguration
 

Constructor & Destructor Documentation

makVrv::DtTextProxy::DtTextProxy ( DtTextRenderer parent)

CTOR.

virtual makVrv::DtTextProxy::~DtTextProxy ( )
virtual

DTOR.

Member Function Documentation

DtTextProxy* makVrv::DtTextProxy::clone ( DtTextRenderer parent) const
virtual

Clone the given DtTextProxy.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setAlignment ( DtFontInterface::TextAlignment  alignment)
virtual

Set the position.

Implements makVrv::DtTextProxyInterface.

DtFontInterface::TextAlignment makVrv::DtTextProxy::alignment ( ) const
inlinevirtual

Returns alignment.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setParent ( DtTextRenderer )
virtual

Sets the parent of this proxy.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setPosition ( float  x,
float  y,
float  z,
float  w = 0 
)
virtual

Set the position.

Implements makVrv::DtTextProxyInterface.

const float* makVrv::DtTextProxy::position ( ) const
virtual

Returns position.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setMaximumWorldHeight ( double  worldHeightInMeters)
virtual

Set the maximum world-space height for the this proxy, in meters. Once the text proxy exceeds the maximum world-space height, the text will not be rendered. To disable this mechanism for height altogether, set this property to -1.0. Calling setIsHiddenWhenExceedingMaximumWorldDimensions(false) will cause width to not be used either. By default, this property is set to -1.0 (and as a result this mechanism is unused by default).

Implements makVrv::DtTextProxyInterface.

double makVrv::DtTextProxy::maximumWorldHeight ( ) const
virtual

Returns the maximum world-space height for the this proxy, in meters.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setMaximumWorldWidth ( double  worldWidthInMeters)
virtual

Set the maximum world-space width for the this proxy, in meters. Once the text proxy exceeds the maximum world-space width, the text will not be rendered. To disable this mechanism for width altogether, set this property to -1.0. //! Calling setIsHiddenWhenExceedingMaximumWorldDimensions(false) will cause width to not be used either. By default, this property is set to -1.0 (and as a result this mechanism is unused by default).

Implements makVrv::DtTextProxyInterface.

double makVrv::DtTextProxy::maximumWorldWidth ( ) const
virtual

Returns the maximum world-space width for the this proxy, in meters.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setIsHiddenWhenExceedingMaximumWorldDimensions ( bool  )
virtual

Set whether or not to hide this proxy when either of the maximum world-space dimensions is exceeded based on the current altitude of the observer rendering the text proxy. If the text is not hidden when either of the maximum world-space dimensions is exceeded, then the text is always shown regardless of what has been set for the text's world dimensions. By default, this value is true (text will be hidden if world dimensions are exceeded)

Implements makVrv::DtTextProxyInterface.

bool makVrv::DtTextProxy::isHiddenWhenExceedingMaximumWorldDimensions ( ) const
virtual

Set whether or not to hide this proxy when either of the maximum world-space dimensions is exceeded based on the current altitude of the observer rendering the text proxy. If the text is not hidden when the maximum world-space dimensions is exceeded, then the text is always shown regardless of what has been set for the text's world dimensions.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setRotation ( float  angle)
virtual

Sets the rotation, in screen space or in world space.

See Also
setIsRotationInScreenSpace(bool)

Implements makVrv::DtTextProxyInterface.

float makVrv::DtTextProxy::rotation ( ) const
virtual

Returns rotation, in screen space or in world space.

See Also
isRotationInScreenSpace()

Implements makVrv::DtTextProxyInterface.

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

Set the color of the text.

Implements makVrv::DtTextProxyInterface.

const float* makVrv::DtTextProxy::color ( ) const
virtual

Returns color.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setString ( const DtUnicode str)
virtual

Set the text string. If this string is left to right will create a DtGenericTextLayoutRenderer to render the text, else will create a DtHarfbuzzTextRenderer to layout the text.

Implements makVrv::DtTextProxyInterface.

const DtUnicode& makVrv::DtTextProxy::string ( ) const
virtual

Gets the text string.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setFont ( DtFontInterface font)
virtual

Set the font to render using.

Implements makVrv::DtTextProxyInterface.

std::vector<double> makVrv::DtTextProxy::fontConfigurationMinimumAltitudes ( ) const
virtual

Get a vector of minimum altitude the text has a font configuration for.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setAltitudeSpecificFonts ( const DtAltitudeBasedConfigurationCollection )
virtual

Set the altitude-based fonts this text proxy should use.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::clearAltitudeSpecificFonts ( )
virtual

Clear altitude-based fonts, if any were defined. Altitude-specific fonts are defined using setAltitudeSpecificFonts(...).

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setIsForcedAltitudeBasedConfigurationEnabled ( bool  enabled)
virtual

Set whether or not a particular altitude-based configuration is always used for this text proxy. This only matters if altitude-based configurations are specified for this text proxy. The altitude-based configuration used for rendering must meet the following conditions: (1) The configuration's base altitude is less than the altitude provided using the DtTextProxy::setBaseAltitudeToUseForForcedFont API. (2) The configuration's base altitude is larger than all other altitude-based configurations, defined for this text proxy, that also meet condition (1).

Altitude is in meters from mean sea level. Default is false.

Implements makVrv::DtTextProxyInterface.

bool makVrv::DtTextProxy::isForcedAltitudeBasedConfigurationEnabled ( ) const
virtual

Get whether or not a particular altitude-based configuration is always used for this text proxy. This only matters if altitude-based configurations are specified for this text proxy.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setBaseAltitudeToUseForForcedAltitudeBasedConfigurations ( double  minimumAltitudeForUse)
virtual

Set the altitude to always use when determining the altitude-based configurations to use for any given frame. This is only used if setIsForcedFontScaleByAltitudeEnabled(true). Default is std::numeric_limits<double>::min().

Implements makVrv::DtTextProxyInterface.

DtFontInterface* makVrv::DtTextProxy::font ( double  altitude = std::numeric_limits< double >::min()) const
virtual

Get the font to use for rendering based on the provided base altitude. The result of this API only differs if altitude-based fonts are specified for this text proxy.

The returned font is provided by the altitude-based configuration that meets both of the following conditions: (1) The configuration's base altitude is less than the altitude provided. (2) The configuration's base altitude is larger than all other altitude-based configurations, defined for this text proxy, that also meet condition (1).

Implements makVrv::DtTextProxyInterface.

DtBoundingBox makVrv::DtTextProxy::calculateBoundingBox ( double  cameraAltitude = std::numeric_limits< double >::min(),
unsigned int  pos = 0,
int  len = -1,
const DtPen pen = DtPen() 
) const
virtual

Calculates the bounding box, in screen space, for the passed in string and font. By default, this function calculates the bounding box for the entire passed in string but it can also calculate the bounding box for a substring of the passed in string.

Parameters
cameraAltitudeThe camera altitude to use when determining the bounding box.
posThe position, within the passed in string, of the first character for the substring to calculate the bounding box for.
lenThe number of characters, from pos, to consider in the passed in string. If -1, consider all remaining characters in the string.
penSpecifies the spacing and starting position to use when calculating the bounding box.
See Also
DtFont::calculateBoundingBox
DtTextLayoutInterface::calculateBoundingBox

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setBounds ( const DtBoundingBox box)
virtual

Set the bounds of the text.

Implements makVrv::DtTextProxyInterface.

const DtBoundingBox& makVrv::DtTextProxy::bounds ( double  cameraAltitude) const
virtual

Get the bounding box to use for rendering based on the provided base altitude. The result of this API only differs if altitude-based bounds are specified for this text proxy.

The returned bounding box is provided by the altitude-based configuration that meets both of the following conditions: (1) The configuration's base altitude is less than the altitude provided. (2) The configuration's base altitude is larger than all other altitude-based configurations, defined for this text proxy, that also meet condition (1).

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setBoundsByMinimumAltitude ( const DtBoundingBox box,
double  minimumAltitudeForUse 
)
virtual

Set the bounds of the text based on the current altitude of the observer rendering the text.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setGroup ( unsigned int  group)
virtual

Sets the text group.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setLodOutAltitude ( double  lodOutAltitude)
virtual

Set the minimum altitude, in meters, at which this text will no longer render. Only used if setIsLodOutAltitudeEnabled(true). Default is the maximum value a double can hold.

Implements makVrv::DtTextProxyInterface.

double makVrv::DtTextProxy::lodOutAltitude ( ) const
virtual

Get the minimum altitude, in meters, at which this text will no longer render.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setIsLodOutAltitudeEnabled ( bool  isLodOutAltitudeEnabled)
virtual

Set whether or not to use the LOD Out Altitude property. Default is true.

Implements makVrv::DtTextProxyInterface.

bool makVrv::DtTextProxy::isLodOutAltitudeEnabled ( ) const
virtual

Get whether or not to use the LOD Out Altitude property.

Implements makVrv::DtTextProxyInterface.

void makVrv::DtTextProxy::setIsRotationInScreenSpace ( bool  isRotationInScreenSpace)
virtual

Set whether or not the rotation of the text object is in screen space. If rotation is in screen space, a 0 degrees rotation means the top of the user's computer monitor. If rotation is not in screen space, it is in world space with a 0 degrees rotation meaning the direction of True North. Default is true.

Implements makVrv::DtTextProxyInterface.

bool makVrv::DtTextProxy::isRotationInScreenSpace ( ) const
virtual

Get whether or not the rotation of the text object is in screen space.

Implements makVrv::DtTextProxyInterface.

unsigned int makVrv::DtTextProxy::group ( ) const
virtual

Gets the group of the text.

Implements makVrv::DtTextProxyInterface.

virtual void makVrv::DtTextProxy::renderText ( DtTexturedGlyphRenderer ,
DtFontInterface font,
const DtObserverRenderData channelRenderData,
int  proxyIndex,
DtQuadsRenderData renderData 
) const
virtual

Renders text using the layout renderer to the given glyph renderer.

int makVrv::DtTextProxy::computeCollectionIndexFromAltitude ( const DtAltitudeBasedConfigurationCollection collection,
const double  altitude 
) const
protected

Computes the collection index should be used based on the given altitude.

void makVrv::DtTextProxy::makeOrChangeTextLayout ( const DtUnicode str)
protected

Member Data Documentation

DtTextRenderer* makVrv::DtTextProxy::myParent
protected
float makVrv::DtTextProxy::myRotation
protected
float makVrv::DtTextProxy::myPosition[4]
protected
float makVrv::DtTextProxy::myColor[4]
protected
unsigned int makVrv::DtTextProxy::myGroup
protected
DtFontInterface::TextAlignment makVrv::DtTextProxy::myAlignment
protected
DtUnicode makVrv::DtTextProxy::myString
protected
DtAltitudeBasedBoundingBoxConfigurationCollection makVrv::DtTextProxy::myAltitudeBasedBounds
protected
DtTextLayoutInterface* makVrv::DtTextProxy::myTextLayout
protected
bool makVrv::DtTextProxy::myIsRotationInScreenSpace
protected
bool makVrv::DtTextProxy::myIsLodOutAltitudeEnabled
protected
double makVrv::DtTextProxy::myLodOutAltitude
protected
bool makVrv::DtTextProxy::myIsHiddenWhenExceedingMaximumWorldWidth
protected
double makVrv::DtTextProxy::myMaximumWorldWidth
protected
double makVrv::DtTextProxy::myMaximumWorldHeight
protected
bool makVrv::DtTextProxy::myIsForcedAltitudeBasedConfigurationEnabled
protected
double makVrv::DtTextProxy::myAltitudeToUseForForcedAltitudeBasedConfiguration
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)