FlightGear next
canvas::ReplaceStaticTextureVisitor Class Reference

Replace a texture in the airplane model with another. More...

Inherits osg::NodeVisitor.

Public Types

typedef osg::ref_ptr< osg::Group > GroupPtr
 
typedef osg::ref_ptr< osg::Material > MaterialPtr
 

Public Member Functions

 ReplaceStaticTextureVisitor (const char *name, osg::Texture2D *new_texture)
 
 ReplaceStaticTextureVisitor (SGPropertyNode *placement, osg::Texture2D *new_texture, osg::NodeCallback *cull_callback=0, const simgear::canvas::CanvasWeakPtr &canvas=simgear::canvas::CanvasWeakPtr())
 
simgear::canvas::Placements & getPlacements ()
 Get a list of groups which have been inserted into the scene graph to replace the given texture.
 
virtual void apply (osg::Geode &node)
 
void modify_groups ()
 

Protected Types

typedef std::vector< GroupListItemGroupList
 

Protected Member Functions

const std::string & getNodeName (const osg::Node &node) const
 

Protected Attributes

std::string _tex_name
 !
 
std::string _node_name
 ! Only replace if node name matches
 
std::string _parent_name
 !
 
SGPropertyNode_ptr _node
 
osg::Texture2D * _new_texture
 
osg::NodeCallback * _cull_callback
 
GroupList groups_to_modify
 
simgear::canvas::CanvasWeakPtr _canvas
 
simgear::canvas::Placements _placements
 

Detailed Description

Replace a texture in the airplane model with another.

Definition at line 34 of file texture_replace.cxx.

Member Typedef Documentation

◆ GroupList

Definition at line 198 of file texture_replace.cxx.

◆ GroupPtr

typedef osg::ref_ptr<osg::Group> canvas::ReplaceStaticTextureVisitor::GroupPtr

Definition at line 38 of file texture_replace.cxx.

◆ MaterialPtr

typedef osg::ref_ptr<osg::Material> canvas::ReplaceStaticTextureVisitor::MaterialPtr

Definition at line 39 of file texture_replace.cxx.

Constructor & Destructor Documentation

◆ ReplaceStaticTextureVisitor() [1/2]

canvas::ReplaceStaticTextureVisitor::ReplaceStaticTextureVisitor ( const char * name,
osg::Texture2D * new_texture )
inline

Definition at line 41 of file texture_replace.cxx.

◆ ReplaceStaticTextureVisitor() [2/2]

canvas::ReplaceStaticTextureVisitor::ReplaceStaticTextureVisitor ( SGPropertyNode * placement,
osg::Texture2D * new_texture,
osg::NodeCallback * cull_callback = 0,
const simgear::canvas::CanvasWeakPtr & canvas = simgear::canvas::CanvasWeakPtr() )
inline

Definition at line 49 of file texture_replace.cxx.

Member Function Documentation

◆ apply()

virtual void canvas::ReplaceStaticTextureVisitor::apply ( osg::Geode & node)
inlinevirtual

Definition at line 84 of file texture_replace.cxx.

◆ getNodeName()

const std::string & canvas::ReplaceStaticTextureVisitor::getNodeName ( const osg::Node & node) const
inlineprotected

Definition at line 203 of file texture_replace.cxx.

◆ getPlacements()

simgear::canvas::Placements & canvas::ReplaceStaticTextureVisitor::getPlacements ( )
inline

Get a list of groups which have been inserted into the scene graph to replace the given texture.

Definition at line 79 of file texture_replace.cxx.

◆ modify_groups()

void canvas::ReplaceStaticTextureVisitor::modify_groups ( )
inline

Definition at line 150 of file texture_replace.cxx.

Member Data Documentation

◆ _canvas

simgear::canvas::CanvasWeakPtr canvas::ReplaceStaticTextureVisitor::_canvas
protected

Definition at line 200 of file texture_replace.cxx.

◆ _cull_callback

osg::NodeCallback* canvas::ReplaceStaticTextureVisitor::_cull_callback
protected

Definition at line 197 of file texture_replace.cxx.

◆ _new_texture

osg::Texture2D* canvas::ReplaceStaticTextureVisitor::_new_texture
protected

Definition at line 196 of file texture_replace.cxx.

◆ _node

SGPropertyNode_ptr canvas::ReplaceStaticTextureVisitor::_node
protected

Definition at line 195 of file texture_replace.cxx.

◆ _node_name

std::string canvas::ReplaceStaticTextureVisitor::_node_name
protected

! Only replace if node name matches

Definition at line 191 of file texture_replace.cxx.

◆ _parent_name

std::string canvas::ReplaceStaticTextureVisitor::_parent_name
protected

!

Only replace if any parent node matches given name (all the tree upwards)

Definition at line 192 of file texture_replace.cxx.

◆ _placements

simgear::canvas::Placements canvas::ReplaceStaticTextureVisitor::_placements
protected

Definition at line 201 of file texture_replace.cxx.

◆ _tex_name

std::string canvas::ReplaceStaticTextureVisitor::_tex_name
protected

!

PBR texture name to be replaced (base-color, normalmap, orm, etc.). This is not the actual texture filename

Definition at line 188 of file texture_replace.cxx.

◆ groups_to_modify

GroupList canvas::ReplaceStaticTextureVisitor::groups_to_modify
protected

Definition at line 199 of file texture_replace.cxx.


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