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

DtOceanExtractorVisitor tags nodes as static ocean via the setUserValue capability, based on a texture name or texture regular expression. Terrain nodes have a DtOsgTextureKeyHolder in their userData fields which holds a list of the keys to a texture map of all the textures applied to the node. If one of the textures on the node matches the search string or regular expression than the node has a setUserValue( "isStaticOcean", true ) set on it.

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

Public Types

typedef std::vector< boost::regex > RegexVector
 

Public Member Functions

 DtOceanExtractorVisitor (DtTextureVisitor::TextureMap &textureMap, const std::string &rule, bool isRegEx, bool indirect)
 
virtual ~DtOceanExtractorVisitor ()
 
virtual void apply (osg::Group &group)
 
virtual void apply (osg::Node &node)
 
virtual bool nodesExtracted () const
 

Protected Member Functions

virtual bool extractStaticOcean (osg::Node &node)
 
virtual bool checkTextures (const osg::Node &node)
 
virtual bool makeNodeStaticOcean (osg::Node &node)
 

Protected Attributes

std::string mySearchForString
 
RegexVector mySearchForRegularExpressions
 
bool myExpressionIsRegEx
 
osg::Group * myStartGroup
 
DtTextureVisitor::TextureMapmyTextureMap
 
std::unordered_set< intmyTexturesRemoved
 
std::unordered_set< intmyTextureNonMatchCache
 
bool myNodesExtracted
 
std::vector< osg::ref_ptr
< osg::Node > > 
myNodesToRemove
 
const bool myOceanIsIndirect
 

Member Typedef Documentation

typedef std::vector<boost::regex> makVrv::DtOceanExtractorVisitor::RegexVector

typdef a vector of regex for convenience

Constructor & Destructor Documentation

makVrv::DtOceanExtractorVisitor::DtOceanExtractorVisitor ( DtTextureVisitor::TextureMap textureMap,
const std::string &  rule,
bool  isRegEx,
bool  indirect 
)

Default CTOR Inputs are the map of textures held be the terrain pactch, the search string or regular expression, and a flag saying if the rule is a regular expression or not.

virtual makVrv::DtOceanExtractorVisitor::~DtOceanExtractorVisitor ( )
virtual

Virtual DTOR.

Member Function Documentation

virtual void makVrv::DtOceanExtractorVisitor::apply ( osg::Group &  group)
virtual

This is the method called when the visitor is visiting groups We detect the DtTerrainPatchGroup (via dynamic cast) as the top-most group, allowing the visitor to do initialization and cleanup. Cleanup includes removing any texture names from the texture map that are 'extracted'.

virtual void makVrv::DtOceanExtractorVisitor::apply ( osg::Node &  node)
virtual

This is the method called when the visitor visits any non-group node.

virtual bool makVrv::DtOceanExtractorVisitor::nodesExtracted ( ) const
virtual

Return whether any nodes were marked as static ocean.

virtual bool makVrv::DtOceanExtractorVisitor::extractStaticOcean ( osg::Node &  node)
protectedvirtual

Method called on a node to attempt extraction.

virtual bool makVrv::DtOceanExtractorVisitor::checkTextures ( const osg::Node &  node)
protectedvirtual

Check the textures pointed to by a node against the search criteria.

virtual bool makVrv::DtOceanExtractorVisitor::makeNodeStaticOcean ( osg::Node &  node)
protectedvirtual

When a static ocean node is discovered, mark it.

Member Data Documentation

std::string makVrv::DtOceanExtractorVisitor::mySearchForString
protected
RegexVector makVrv::DtOceanExtractorVisitor::mySearchForRegularExpressions
protected
bool makVrv::DtOceanExtractorVisitor::myExpressionIsRegEx
protected
osg::Group* makVrv::DtOceanExtractorVisitor::myStartGroup
protected
DtTextureVisitor::TextureMap& makVrv::DtOceanExtractorVisitor::myTextureMap
protected
std::unordered_set<int> makVrv::DtOceanExtractorVisitor::myTexturesRemoved
protected
std::unordered_set<int> makVrv::DtOceanExtractorVisitor::myTextureNonMatchCache
protected
bool makVrv::DtOceanExtractorVisitor::myNodesExtracted
protected
std::vector<osg::ref_ptr<osg::Node> > makVrv::DtOceanExtractorVisitor::myNodesToRemove
protected
const bool makVrv::DtOceanExtractorVisitor::myOceanIsIndirect
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)