graph::Graph Class Reference

Graph class (per-object graph). More...

#include <_src_graph_graph.hh>

Inheritance diagram for graph::Graph:

graph::GraphEnablement

List of all members.

Public Member Functions

 Graph (RefPtr< Node > node, const string &name=string())
 ~Graph ()
void SetName (const string &name)
void Enable (const bool enable=true)
bool IfEnabled (void)
CLASS_METHOD shptr< GraphMakeMinimalGraph (void)
void AttachNode (RefPtr< Node > node)
RefPtr< NodeGetRootNode (void)
RefPtr< TransformNodeGetTransformNode (void)
RefPtr< osg::Group > GetGroupNode (void)

Private Attributes

RefPtr< osg::Switch > mSwitchNode
RefPtr< TransformNodemTransformNode
 outer-level transform node
RefPtr< osg::StateSet > mStateSet


Detailed Description

Graph class (per-object graph).

This can be thought of as ObjectGraph. Graph defines the set of nodes of one individual Object.

Graph arrangement (OSG): osg::Switch --> osg::Transform --> node

Graph and Object have their own separate Transform nodes. Graph's Transform is used for orienting 3D models transparently to an Object (Objects are attached to a Graph).

SUBTLE: Another transform node can be passed to the ctor as the root node. Having two transform nodes is useful, since it allows setting the correct orientation of a 3D model, which then is transformed by the usual transform node.

Use AttachNode() [instead of addChild() with GetRootNode()/GetTransformNode()]. GetRootNode() must return the actual root node (this cannot be faked, if World::Attach() were to attach its child then the root node would be outside the scene graph). There is no separate Group node (it is really the Transform node), but accomodates clients that only need a Group node.


Constructor & Destructor Documentation

graph::Graph::Graph ( RefPtr< Node node,
const string &  name = string() 
)

graph::Graph::~Graph (  ) 


Member Function Documentation

void graph::Graph::SetName ( const string &  name  ) 

Set name of graph.

void graph::Graph::Enable ( const bool  enable = true  ) 

Enable/disable rendering a Graph.

NOTE: This isn't effective for enabling models per-view in OSG. The reason is that OSG generates a render list from the scene graph, then renders every camera. So trying to alter nodes is too late in the pipeline. Rather, use an "cull mask" for the osg::Camera with a "node mask" for the model. See View::ExcludeFromMainView().

bool graph::Graph::IfEnabled ( void   ) 

shptr< Graph > graph::Graph::MakeMinimalGraph ( void   ) 

Make a minimal-but-usable Graph for use with an Object.

void graph::Graph::AttachNode ( RefPtr< Node node  ) 

RefPtr<Node> graph::Graph::GetRootNode ( void   )  [inline]

RefPtr<TransformNode> graph::Graph::GetTransformNode ( void   )  [inline]

RefPtr<osg::Group> graph::Graph::GetGroupNode ( void   )  [inline]


Member Data Documentation

RefPtr<osg::Switch> graph::Graph::mSwitchNode [private]

outer-level transform node

RefPtr<osg::StateSet> graph::Graph::mStateSet [private]


The documentation for this class was generated from the following files:
Palomino Flight Simulator documents generated by doxygen 1.5.6 on Tue Sep 28 11:37:49 2010