VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
makVrv::DtOsgEffectTextureVisitor Class Reference

Visitor that locates effect textures and installs them into the scene graph. More...

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

Public Member Functions

 DtOsgEffectTextureVisitor (DtOsgFileCache &fileCache)
 CTOR.
 DtOsgEffectTextureVisitor (DtOsgFileCache &, const osgDB::Options *options)
 CTOR.
virtual void setDbOptions (const osgDB::Options *options)
 Set the database options.
virtual ~DtOsgEffectTextureVisitor ()
 DTOR.
virtual void reset ()
 Resets the visitor to its initial state.
virtual unsigned numEffectTexturesInstalled () const
 After visiting, call this to see how many effect textures the visitor installed.
void apply (osg::Node &node)
void apply (osg::Geode &geode)

Static Public Member Functions

static const charignoreHint (void)

Protected Member Functions

void initialize ()
 Non-virtual, called in the CTOR.
void apply (osg::StateSet *stateSet)
 scan a stateset and apply effect textures as necessary.
virtual bool isEffectTexture (osg::Texture *tex, const std::string &texName) const
 Checks whether a texture is an effect texture.
virtual bool checkIfAlreadyVisited (osg::StateSet *stateSet, osg::ExtendedMaterial *extendedMaterial)
virtual void installEffectTexture (osg::StateSet *stateSet, osg::Texture *baseTexture, int baseUnit, osg::ExtendedMaterial *extendedMaterial)
virtual bool installExtendedEffectTexture (const DtOsgEffectTextureController *controller, osg::StateSet *stateSet, osg::Texture *baseTexture, osg::Texture *effectTexture, int baseUnit, int effectUnit)
virtual bool installExtendedEffectTexture (const DtOsgEffectTextureController *controller, osg::StateSet *stateSet, osg::Texture *baseTexture, int baseUnit, osg::ExtendedMaterial *extendedMaterial)
virtual bool installPostfixEffectTexturesFromTextureLayers (const DtOsgEffectTextureController *controller, osg::Texture *baseTex, int baseTexUnit, osg::StateSet *stateSet)
 Install the effect texture from the postfix way, it will try find the suffix texture in the texture layers in the stateSet itself.
virtual bool installPostfixEffectTexturesFromFileSystem (const DtOsgEffectTextureController *controller, osg::Texture *baseTex, int baseTexUnit, osg::StateSet *stateSet)
 Install the effect texture from the postfix way, it will try find the suffix texture in the file system.
virtual bool checkForGlassMaterial (osg::StateSet *stateSet)
 Checks if the stateSet has any texture contains "GlassMat", if so, we treate this object as glass.

Protected Attributes

unsigned myCount
osg::ref_ptr< const
osgDB::Options > 
myDbOptions
DtOsgFileCachemyFileCache
DtPossibleFileNamesCache myPossibleFileNamesCache

Static Protected Attributes

static const chartheIgnoreHint

Detailed Description

Visitor that locates effect textures and installs them into the scene graph.

Run this prior to running the Shader Generator to pick up normal maps, reflectivity maps, specular maps, ambient occlusion maps, and emissivity maps.

Constructor & Destructor Documentation

makVrv::DtOsgEffectTextureVisitor::DtOsgEffectTextureVisitor ( DtOsgFileCache fileCache)

CTOR.

makVrv::DtOsgEffectTextureVisitor::DtOsgEffectTextureVisitor ( DtOsgFileCache ,
const osgDB::Options *  options 
)

CTOR.

virtual makVrv::DtOsgEffectTextureVisitor::~DtOsgEffectTextureVisitor ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtOsgEffectTextureVisitor::setDbOptions ( const osgDB::Options *  options)
virtual

Set the database options.

virtual void makVrv::DtOsgEffectTextureVisitor::reset ( )
virtual

Resets the visitor to its initial state.

If you plan to use the same instance more than once, call reset() before each use.

virtual unsigned makVrv::DtOsgEffectTextureVisitor::numEffectTexturesInstalled ( ) const
virtual

After visiting, call this to see how many effect textures the visitor installed.

Calling reset() will reset this to zero.

static const char* makVrv::DtOsgEffectTextureVisitor::ignoreHint ( void  )
static
void makVrv::DtOsgEffectTextureVisitor::apply ( osg::Node &  node)
void makVrv::DtOsgEffectTextureVisitor::apply ( osg::Geode &  geode)
void makVrv::DtOsgEffectTextureVisitor::initialize ( )
protected

Non-virtual, called in the CTOR.

void makVrv::DtOsgEffectTextureVisitor::apply ( osg::StateSet *  stateSet)
protected

scan a stateset and apply effect textures as necessary.

virtual bool makVrv::DtOsgEffectTextureVisitor::isEffectTexture ( osg::Texture *  tex,
const std::string &  texName 
) const
protectedvirtual

Checks whether a texture is an effect texture.

virtual bool makVrv::DtOsgEffectTextureVisitor::checkIfAlreadyVisited ( osg::StateSet *  stateSet,
osg::ExtendedMaterial *  extendedMaterial 
)
protectedvirtual
virtual void makVrv::DtOsgEffectTextureVisitor::installEffectTexture ( osg::StateSet *  stateSet,
osg::Texture *  baseTexture,
int  baseUnit,
osg::ExtendedMaterial *  extendedMaterial 
)
protectedvirtual
virtual bool makVrv::DtOsgEffectTextureVisitor::installExtendedEffectTexture ( const DtOsgEffectTextureController controller,
osg::StateSet *  stateSet,
osg::Texture *  baseTexture,
osg::Texture *  effectTexture,
int  baseUnit,
int  effectUnit 
)
protectedvirtual
virtual bool makVrv::DtOsgEffectTextureVisitor::installExtendedEffectTexture ( const DtOsgEffectTextureController controller,
osg::StateSet *  stateSet,
osg::Texture *  baseTexture,
int  baseUnit,
osg::ExtendedMaterial *  extendedMaterial 
)
protectedvirtual
virtual bool makVrv::DtOsgEffectTextureVisitor::installPostfixEffectTexturesFromTextureLayers ( const DtOsgEffectTextureController controller,
osg::Texture *  baseTex,
int  baseTexUnit,
osg::StateSet *  stateSet 
)
protectedvirtual

Install the effect texture from the postfix way, it will try find the suffix texture in the texture layers in the stateSet itself.

Parameters
controllerThe controller we are trying to apply.
baseTexThe pointer to the base texture.
baseTexUnitThe texture unit of the base texture.
stateSetThe osg::StateSet that the base texture resides in.
virtual bool makVrv::DtOsgEffectTextureVisitor::installPostfixEffectTexturesFromFileSystem ( const DtOsgEffectTextureController controller,
osg::Texture *  baseTex,
int  baseTexUnit,
osg::StateSet *  stateSet 
)
protectedvirtual

Install the effect texture from the postfix way, it will try find the suffix texture in the file system.

Parameters
controllerThe controller we are trying to apply.
baseTexThe pointer to the base texture.
baseTexUnitThe texture unit of the base texture.
stateSetThe osg::StateSet that the base texture resides in.
virtual bool makVrv::DtOsgEffectTextureVisitor::checkForGlassMaterial ( osg::StateSet *  stateSet)
protectedvirtual

Checks if the stateSet has any texture contains "GlassMat", if so, we treate this object as glass.

Returns
Return whether this we treate this object as glass.

Member Data Documentation

unsigned makVrv::DtOsgEffectTextureVisitor::myCount
protected
osg::ref_ptr<const osgDB::Options> makVrv::DtOsgEffectTextureVisitor::myDbOptions
protected
DtOsgFileCache& makVrv::DtOsgEffectTextureVisitor::myFileCache
protected
DtPossibleFileNamesCache makVrv::DtOsgEffectTextureVisitor::myPossibleFileNamesCache
protected
const char* makVrv::DtOsgEffectTextureVisitor::theIgnoreHint
staticprotected

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

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)