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

vrvGraphics-based implementation of a model-like object that draws a 3d view first person shooter style compass on a channel.

The fps style compass is a pseudo 3d view where directions rotate into a popout center. The compass is located at the top center of the display.

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

Classes

struct  CompassSymbol
 
struct  TickMark
 

Public Member Functions

 DtOsgChannel3dViewCompassInstance (DtDe &de)
 
virtual ~DtOsgChannel3dViewCompassInstance ()
 
 DtOsgChannel3dViewCompassInstance ()=delete
 
 DtOsgChannel3dViewCompassInstance (const DtOsgChannel3dViewCompassInstance &other)=delete
 
DtOsgChannel3dViewCompassInstanceoperator= (const DtOsgChannel3dViewCompassInstance &other)=delete
 
virtual void setVisible (bool isVisible)
 
virtual bool visible ()
 
virtual void setChannelName (const std::string &deName, const std::string &winName, const std::string &channelName)
 
virtual void setModelDefinition (const std::string &modelDefinition)
 
virtual void updateCompass (bool force)
 
virtual void setDarkTickColor (float r, float g, float b, float a)
 
virtual void setLightTickColor (float r, float g, float b, float a)
 
virtual void setSymbolsFilename (const std::string &filename)
 
virtual void setPixelRatio (float pixelRatio)
 
- Public Member Functions inherited from makVrv::DtChannel3dViewCompassInstance
 DtChannel3dViewCompassInstance (DtDe &de)
 
virtual ~DtChannel3dViewCompassInstance ()
 
 DtChannel3dViewCompassInstance (const DtChannel3dViewCompassInstance &other)=delete
 
DtChannel3dViewCompassInstanceoperator= (const DtChannel3dViewCompassInstance &other)=delete
 
virtual void setCompassHeading (double heading)
 
virtual void setMargins (int xMargin, int yMargin)
 
virtual void setSymbolColor (float r, float g, float b, float a)
 
virtual void setPopoutSymbolColor (float r, float g, float b, float a)
 
virtual void setWidth (unsigned int width)
 
virtual void setSymbolSize (unsigned int size)
 
virtual void setPopoutSymbolSize (unsigned int size)
 
- Public Member Functions inherited from makVrv::DtSetVisibilityInterface
virtual ~DtSetVisibilityInterface ()
 

Protected Types

typedef std::vector< float > VertexList
 

Protected Member Functions

virtual void slot_channelCreated (DtChannelManager *, DtChannel *)
 
virtual void slot_channelToBeDestroyed (DtChannelManager *, DtChannel *)
 
virtual void slot_channelConfigurationModified (const std::string &deName, const std::string &winName, const std::string &oldChannelName, const DtChannelConfiguration &config)
 
virtual void slot_windowConfigurationModified (const std::string &deName, const std::string &winName, const DtWindowConfiguration &config)
 
virtual void slot_displayUnitUnitChanged (const DtUnicode &displayUnitCollectionName, const DtUnicode &displayUnitName, unsigned int newUnit, unsigned int oldUnit)
 
virtual void slot_update ()
 
virtual void slot_coordinateSystemChanged ()
 
bool updateCompassCharacter (const std::string &filename, DtQuad *quad, osg::ref_ptr< osg::Texture > &texture, const osg::Vec4 &texCoords)
 
virtual void parseModelDefinition (DtModelDefinition *definition)
 
virtual void createCompass ()
 
void destroyCompass ()
 
osg::Vec2 calcCompassCenterPosition ()
 
DtLineSegmentcreateDarkSide (DtOverlayRenderer &overlay)
 
DtLineSegmentcreateLightSide (DtOverlayRenderer &overlay)
 
virtual bool updateOrientationUnits ()
 
virtual void updateCompass ()
 
virtual void computeCenteringOffsets (float *offsets, const int numCharacters, const float characterWidth)
 
virtual void computeHeadingString (const float radHeading, std::string &outString)
 
virtual void computeCharacterCoords (const unsigned char value, osg::Vec4 &coords)
 
virtual void initCompassSymbolCharacterDisplay (CompassSymbol &symbol, const std::string &text, DtOverlayRenderer &overlay)
 
virtual void initPopoutSymbolCharacterDisplay (CompassSymbol &symbol, DtOverlayRenderer &overlay)
 
virtual bool initCompassSymbolCharacters (CompassSymbol &symbol)
 

Static Protected Member Functions

static void rotate (const DtOsgChannel3dViewCompassInstance::VertexList &in, double rad, DtOsgChannel3dViewCompassInstance::VertexList &out)
 
static void translate (const DtOsgChannel3dViewCompassInstance::VertexList &in, const osg::Vec2 &translation, DtOsgChannel3dViewCompassInstance::VertexList &out)
 
static void scale (const DtOsgChannel3dViewCompassInstance::VertexList &in, double s, DtOsgChannel3dViewCompassInstance::VertexList &out)
 

Protected Attributes

DtSignalConnectionManager myConnections
 
DtSignalConnectionManager myPixelRatioConnection
 
DtOsgChannelmyChannel
 
bool myCompassIsMagnetic
 
bool myIsExactHeadingAlwaysShown
 
int myCreateState
 
float myPixelRatio
 
osg::ref_ptr< osg::Texture > myCompassSymbolsTexture
 
osg::Vec2 myCompassCenterPosition
 
CompassSymbol myCompassSymbols [24]
 
CompassSymbol myPopoutSymbol
 
TickMark myPopoutL
 
TickMark myPopoutR
 
bool myCompassDirty
 
DtSharedDisplayUnitsSettings::OrientationUnits myOrientationUnit
 
DtCoordinateSystemmyCoordinateSystem = nullptr
 
- Protected Attributes inherited from makVrv::DtChannel3dViewCompassInstance
std::string myModelDefinitionName
 
std::string myDisplayEngineName
 
std::string myWindowName
 
std::string myChannelName
 
int myMargins [2]
 
double myCompassHeading
 
double myCompassDeclination
 
float myDarkTickColor [4]
 
float myLightTickColor [4]
 
unsigned int myCompassWidth
 
unsigned int myCompassSymbolSize
 
unsigned int myCompassPopoutSymbolSize
 
std::string myCompassSymbolsFilename
 
float mySymbolColor [4]
 
float myPopoutSymbolColor [4]
 
DtDemyDe
 

Member Typedef Documentation

typedef std::vector<float> makVrv::DtOsgChannel3dViewCompassInstance::VertexList
protected

This type can be used to provide a list of vertices to the polygon objects.

Constructor & Destructor Documentation

makVrv::DtOsgChannel3dViewCompassInstance::DtOsgChannel3dViewCompassInstance ( DtDe de)

CTOR.

virtual makVrv::DtOsgChannel3dViewCompassInstance::~DtOsgChannel3dViewCompassInstance ( )
virtual

DTOR.

makVrv::DtOsgChannel3dViewCompassInstance::DtOsgChannel3dViewCompassInstance ( )
delete

Default Constructor not implemented.

makVrv::DtOsgChannel3dViewCompassInstance::DtOsgChannel3dViewCompassInstance ( const DtOsgChannel3dViewCompassInstance other)
delete

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

DtOsgChannel3dViewCompassInstance& makVrv::DtOsgChannel3dViewCompassInstance::operator= ( const DtOsgChannel3dViewCompassInstance other)
delete

Assignment Operator not implemented - Assignment not allowed.

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

Set the compass to visible or invisible.

Implements makVrv::DtSetVisibilityInterface.

virtual bool makVrv::DtOsgChannel3dViewCompassInstance::visible ( )
virtual

Return visibility status.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::setChannelName ( const std::string &  deName,
const std::string &  winName,
const std::string &  channelName 
)
virtual

Set the name of the channel that this compass should be drawn on.

Reimplemented from makVrv::DtChannel3dViewCompassInstance.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::setModelDefinition ( const std::string &  modelDefinition)
virtual

Set the model definition; note that this (potentially) includes all the other parameters enumeration below.

Reimplemented from makVrv::DtChannel3dViewCompassInstance.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::updateCompass ( bool  force)
virtual

Called anytime any of the compass frame parameters change; calls redraw compass needle.

Implements makVrv::DtChannel3dViewCompassInstance.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::setDarkTickColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Override base class method to change dark color on all tick marks.

Reimplemented from makVrv::DtChannel3dViewCompassInstance.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::setLightTickColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Override base class method to change dark color on all tick marks.

Reimplemented from makVrv::DtChannel3dViewCompassInstance.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::setSymbolsFilename ( const std::string &  filename)
virtual

Override base class method to change the symbols file.

Reimplemented from makVrv::DtChannel3dViewCompassInstance.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::setPixelRatio ( float  pixelRatio)
virtual

Sets the pixel density ratio to scale grid lines on high dpi screens.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::slot_channelCreated ( DtChannelManager ,
DtChannel  
)
protectedvirtual

Called when a channel is created.

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

Called when a channel is about to be destroyed.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::slot_channelConfigurationModified ( const std::string &  deName,
const std::string &  winName,
const std::string &  oldChannelName,
const DtChannelConfiguration config 
)
protectedvirtual

Redraws the compass if it is associated with the given channel configuration.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::slot_windowConfigurationModified ( const std::string &  deName,
const std::string &  winName,
const DtWindowConfiguration config 
)
protectedvirtual

Redraws the compass if it is associated with the given window configuration.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::slot_displayUnitUnitChanged ( const DtUnicode displayUnitCollectionName,
const DtUnicode displayUnitName,
unsigned int  newUnit,
unsigned int  oldUnit 
)
protectedvirtual

Detect when the unit of measurement to use for a display unit has changed.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::slot_update ( )
protectedvirtual

Updates the compass. Triggered from the renderer post update signal.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::slot_coordinateSystemChanged ( )
protectedvirtual

slot for when the coordinate system changes

bool makVrv::DtOsgChannel3dViewCompassInstance::updateCompassCharacter ( const std::string &  filename,
DtQuad quad,
osg::ref_ptr< osg::Texture > &  texture,
const osg::Vec4 &  texCoords 
)
protected

Updates a character for the compass. Returns true on success or false on error.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::parseModelDefinition ( DtModelDefinition definition)
protectedvirtual

Parse settings specific to the compass.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::createCompass ( )
protectedvirtual

Create the compass resources.

void makVrv::DtOsgChannel3dViewCompassInstance::destroyCompass ( )
protected

delete / clear the DtQuad and DtFilledPolygons, if they exist

osg::Vec2 makVrv::DtOsgChannel3dViewCompassInstance::calcCompassCenterPosition ( )
protected

Calculates the compass center position based on Location enum, margins, current window size and channel parameters.

DtLineSegment* makVrv::DtOsgChannel3dViewCompassInstance::createDarkSide ( DtOverlayRenderer overlay)
protected

Creates a dark line segment used for tick marks.

DtLineSegment* makVrv::DtOsgChannel3dViewCompassInstance::createLightSide ( DtOverlayRenderer overlay)
protected

Creates a light line segment used for tick marks.

virtual bool makVrv::DtOsgChannel3dViewCompassInstance::updateOrientationUnits ( )
protectedvirtual

Updates the orientation units and returns true if it is changed.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::updateCompass ( )
protectedvirtual

Updates the compass.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::computeCenteringOffsets ( float *  offsets,
const int  numCharacters,
const float  characterWidth 
)
protectedvirtual

Computes horizontal offsets for centering character quads.

Parameters
offsetsThe output offsets array.
numCharactersThe number of characters to display.
characterWidthThe character quad width.
virtual void makVrv::DtOsgChannel3dViewCompassInstance::computeHeadingString ( const float  radHeading,
std::string &  outString 
)
protectedvirtual

Computes the heading string to display.

Parameters
radHeadingThe heading in radians.
outStringThe output string to display.
virtual void makVrv::DtOsgChannel3dViewCompassInstance::computeCharacterCoords ( const unsigned char  value,
osg::Vec4 &  coords 
)
protectedvirtual

Computes texture coordinates for the given character.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::initCompassSymbolCharacterDisplay ( CompassSymbol symbol,
const std::string &  text,
DtOverlayRenderer overlay 
)
protectedvirtual

Initialize the character display for a symbol. Sets specific characters, initializes quads, and initilizes tick marks for the symbol.

virtual void makVrv::DtOsgChannel3dViewCompassInstance::initPopoutSymbolCharacterDisplay ( CompassSymbol symbol,
DtOverlayRenderer overlay 
)
protectedvirtual

Initialize the character display for a popout symbol. Sets default characters and creates quads for the symbol.

virtual bool makVrv::DtOsgChannel3dViewCompassInstance::initCompassSymbolCharacters ( CompassSymbol symbol)
protectedvirtual

Initialize the characters for a symbol. Sets texture coordinates and textures for character quads. Returns true on success or false on error.

static void makVrv::DtOsgChannel3dViewCompassInstance::rotate ( const DtOsgChannel3dViewCompassInstance::VertexList in,
double  rad,
DtOsgChannel3dViewCompassInstance::VertexList out 
)
staticprotected

Utility function to rotate a list of vertices.

static void makVrv::DtOsgChannel3dViewCompassInstance::translate ( const DtOsgChannel3dViewCompassInstance::VertexList in,
const osg::Vec2 &  translation,
DtOsgChannel3dViewCompassInstance::VertexList out 
)
staticprotected

Utility function to translate a list of vertices.

static void makVrv::DtOsgChannel3dViewCompassInstance::scale ( const DtOsgChannel3dViewCompassInstance::VertexList in,
double  s,
DtOsgChannel3dViewCompassInstance::VertexList out 
)
staticprotected

Utility function to scale a list of vertices.

Member Data Documentation

DtSignalConnectionManager makVrv::DtOsgChannel3dViewCompassInstance::myConnections
protected
DtSignalConnectionManager makVrv::DtOsgChannel3dViewCompassInstance::myPixelRatioConnection
protected
DtOsgChannel* makVrv::DtOsgChannel3dViewCompassInstance::myChannel
protected
bool makVrv::DtOsgChannel3dViewCompassInstance::myCompassIsMagnetic
protected
bool makVrv::DtOsgChannel3dViewCompassInstance::myIsExactHeadingAlwaysShown
protected
int makVrv::DtOsgChannel3dViewCompassInstance::myCreateState
protected
float makVrv::DtOsgChannel3dViewCompassInstance::myPixelRatio
protected
osg::ref_ptr<osg::Texture> makVrv::DtOsgChannel3dViewCompassInstance::myCompassSymbolsTexture
protected
osg::Vec2 makVrv::DtOsgChannel3dViewCompassInstance::myCompassCenterPosition
protected
CompassSymbol makVrv::DtOsgChannel3dViewCompassInstance::myCompassSymbols[24]
protected
CompassSymbol makVrv::DtOsgChannel3dViewCompassInstance::myPopoutSymbol
protected
TickMark makVrv::DtOsgChannel3dViewCompassInstance::myPopoutL
protected
TickMark makVrv::DtOsgChannel3dViewCompassInstance::myPopoutR
protected
bool makVrv::DtOsgChannel3dViewCompassInstance::myCompassDirty
protected
DtSharedDisplayUnitsSettings::OrientationUnits makVrv::DtOsgChannel3dViewCompassInstance::myOrientationUnit
protected
DtCoordinateSystem* makVrv::DtOsgChannel3dViewCompassInstance::myCoordinateSystem = nullptr
protected

local clone of the system wide coordinate system. for thread safety.


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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)