VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtInstrumentTextureReplacer Class Reference

Detailed Description

DtInstrumentTextureReplacer traverses a scene graph to find and replace specific textures with render-to-texture (RTT) displays for aircraft instruments. It can also collect geometry information about the textures for proper positioning.

#include <pilotRenderUpdater.h>

Inheritance diagram for makVre::DtInstrumentTextureReplacer:
[legend]

Classes

struct  Geometry
 

Public Member Functions

 DtInstrumentTextureReplacer (const std::string &targetTextureName, osg::ref_ptr< osg::Texture2D > replacementTexture, bool isHud=false, bool findPosition=false, const osg::Vec3 *overrideNormal=NULL)
 
virtual ~DtInstrumentTextureReplacer () override
 
virtual void apply (osg::Node &node) override
 
bool foundTarget () const
 
osg::Vec3 targetNormal () const
 
osg::Vec3 targetBoundsMin () const
 
osg::Vec3 targetBoundsMax () const
 

Protected Member Functions

virtual bool replaceTexture (osg::StateSet &ss, osg::Node &node)
 
virtual bool collectGeometry (const osg::Node &node, const osg::NodePath &nodePath)
 

Protected Attributes

std::string myTargetTextureName
 
osg::ref_ptr< osg::Texture2D > myReplacementTexture
 
bool myIsHud
 
bool myFoundTarget
 
bool myWantsGeometry
 
bool myTraverseOnTarget
 
Geometry myGeometry
 
bool myUseOverrideNormal
 

Constructor & Destructor Documentation

◆ DtInstrumentTextureReplacer()

makVre::DtInstrumentTextureReplacer::DtInstrumentTextureReplacer ( const std::string & targetTextureName,
osg::ref_ptr< osg::Texture2D > replacementTexture,
bool isHud = false,
bool findPosition = false,
const osg::Vec3 * overrideNormal = NULL )

Constructor.

Parameters
targetTextureNameName of the texture to replace
replacementTextureReference to the replacement texture
isHudFlag indicating if this is a HUD texture
findPositionFlag indicating whether to collect geometry information
overrideNormalOptional normal vector to override the calculated normal

◆ ~DtInstrumentTextureReplacer()

virtual makVre::DtInstrumentTextureReplacer::~DtInstrumentTextureReplacer ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ apply()

virtual void makVre::DtInstrumentTextureReplacer::apply ( osg::Node & node)
overridevirtual

The visitor apply method used to traverse the scene-graph.

Parameters
nodeThe osg::Node being visited

Called during scene-graph traversal. Do not directly call this function.

◆ foundTarget()

bool makVre::DtInstrumentTextureReplacer::foundTarget ( ) const

The visitor apply method for geodes.

Parameters
geodeThe osg::Geode being visited

Called during scene-graph traversal. Do not directly call this function. Currently commented out and not used.

Checks if the target texture was found

Returns
True if the target texture was found, false otherwise

◆ targetNormal()

osg::Vec3 makVre::DtInstrumentTextureReplacer::targetNormal ( ) const

Gets the normal vector of the target geometry.

Returns
Normal vector of the target geometry

◆ targetBoundsMin()

osg::Vec3 makVre::DtInstrumentTextureReplacer::targetBoundsMin ( ) const

Gets the minimum bounds of the target geometry.

Returns
Minimum bounds vector

◆ targetBoundsMax()

osg::Vec3 makVre::DtInstrumentTextureReplacer::targetBoundsMax ( ) const

Gets the maximum bounds of the target geometry.

Returns
Maximum bounds vector

◆ replaceTexture()

virtual bool makVre::DtInstrumentTextureReplacer::replaceTexture ( osg::StateSet & ss,
osg::Node & node )
protectedvirtual

Replaces a texture in the given state set.

Parameters
ssState set containing the texture to replace
nodeNode associated with the state set
Returns
True if the texture was replaced, false otherwise

◆ collectGeometry()

virtual bool makVre::DtInstrumentTextureReplacer::collectGeometry ( const osg::Node & node,
const osg::NodePath & nodePath )
protectedvirtual

Collects geometry information for the target texture.

Parameters
nodeNode containing the geometry
nodePathPath to the node in the scene graph
Returns
True if geometry was collected, false otherwise

Member Data Documentation

◆ myTargetTextureName

std::string makVre::DtInstrumentTextureReplacer::myTargetTextureName
protected

Name of the texture to replace.

◆ myReplacementTexture

osg::ref_ptr<osg::Texture2D> makVre::DtInstrumentTextureReplacer::myReplacementTexture
protected

Reference to the replacement texture.

◆ myIsHud

bool makVre::DtInstrumentTextureReplacer::myIsHud
protected

Flag indicating if this is a HUD texture.

◆ myFoundTarget

bool makVre::DtInstrumentTextureReplacer::myFoundTarget
protected

Flag indicating if the target texture was found.

◆ myWantsGeometry

bool makVre::DtInstrumentTextureReplacer::myWantsGeometry
protected

Flag indicating if geometry information should be collected.

◆ myTraverseOnTarget

bool makVre::DtInstrumentTextureReplacer::myTraverseOnTarget
protected

Flag indicating whether to continue traversal after finding the target.

◆ myGeometry

Geometry makVre::DtInstrumentTextureReplacer::myGeometry
protected

Collected geometry information for the target texture.

◆ myUseOverrideNormal

bool makVre::DtInstrumentTextureReplacer::myUseOverrideNormal
protected

Flag indicating whether to use the provided override normal.


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