FlightGear next
canvas Namespace Reference

Classes

class  FGCanvasSystemAdapter
 
struct  GroupListItem
 
class  ReplaceStaticTextureVisitor
 Replace a texture in the airplane model with another. More...
 

Functions

simgear::canvas::Placements set_texture (osg::Node *branch, const char *name, osg::Texture2D *new_texture)
 Replace an opengl texture name inside a given branch of the scene graph.
 
simgear::canvas::Placements set_aircraft_texture (const char *name, osg::Texture2D *new_texture)
 Replace an opengl texture name inside the aircraft scene graph.
 
simgear::canvas::Placements set_texture (osg::Node *branch, SGPropertyNode *placement, osg::Texture2D *new_texture, osg::NodeCallback *cull_callback=0, const simgear::canvas::CanvasWeakPtr &canvas=simgear::canvas::CanvasWeakPtr())
 Replace an opengl texture name inside a given branch of the scene graph.
 
simgear::canvas::Placements set_aircraft_texture (SGPropertyNode *placement, osg::Texture2D *new_texture, osg::NodeCallback *cull_callback=0, const simgear::canvas::CanvasWeakPtr &canvas=simgear::canvas::CanvasWeakPtr())
 Replace an opengl texture name inside the aircraft scene graph.
 

Function Documentation

◆ set_aircraft_texture() [1/2]

simgear::canvas::Placements canvas::set_aircraft_texture ( const char * name,
osg::Texture2D * new_texture )

Replace an opengl texture name inside the aircraft scene graph.

This is to replace a static texture by a dynamic one

Parameters
branchScene graph branch to search for matching
namePBR texture name
new_texturedynamic texture to replace the old one
Returns
A list of groups which override the given texture

Definition at line 233 of file texture_replace.cxx.

◆ set_aircraft_texture() [2/2]

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

Replace an opengl texture name inside the aircraft scene graph.

Parameters
placementthe node containing the replacement criteria
new_texturedynamic texture to replace the old one
anoptional cull callback which will be installed on any matching object
Returns
A list of groups which override the given texture

Definition at line 263 of file texture_replace.cxx.

◆ set_texture() [1/2]

simgear::canvas::Placements canvas::set_texture ( osg::Node * branch,
const char * name,
osg::Texture2D * new_texture )

Replace an opengl texture name inside a given branch of the scene graph.

This is to replace a static texture by a dynamic one

Parameters
branchScene graph branch to use for search
namePBR texture name
new_texturedynamic texture to replace the old one
Returns
A list of groups which override the given texture

Definition at line 221 of file texture_replace.cxx.

◆ set_texture() [2/2]

simgear::canvas::Placements canvas::set_texture ( osg::Node * branch,
SGPropertyNode * placement,
osg::Texture2D * new_texture,
osg::NodeCallback * cull_callback = 0,
const simgear::canvas::CanvasWeakPtr & canvas = simgear::canvas::CanvasWeakPtr() )

Replace an opengl texture name inside a given branch of the scene graph.

This is to replace a static texture by a dynamic one. The replacement is base on certain filtering criteria which have to be stored in string value childs of the placement node. Recognized nodes are:

  • texture Match the PBR texture name
  • node Match the name of the object
  • parent Match any of the object parents names (all the tree upwards)
Parameters
placementthe node containing the replacement criteria
new_texturedynamic texture to replace the old one
anoptional cull callback which will be installed on any matching object
Returns
A list of groups which override the given texture

Definition at line 246 of file texture_replace.cxx.