Classes | Public Member Functions | Private Member Functions | Private Attributes

graph::Subgraph Class Reference

Defines a partition of a graph (subtree). More...

#include <_src_graph_subgraph.hh>

Inheritance diagram for graph::Subgraph:
graph::GraphEnablement

List of all members.

Classes

struct  LimitedRotation
 Defines rotation limited to one axis and a range of degrees. More...

Public Member Functions

 Subgraph (shptr< Graph > graph, const string &name)
 ~Subgraph ()
RefPtr< NodeGetRootNode (void)
void Enable (const bool enable=true)
bool IfEnabled (void)
void SetLimitedRotation (uint axis, const Degree degreeMin, const Degree degreeMax)
void Reset (void)
void Rotate (uint axis, Radian radian)
void Translate (uint axis, fp inc)
void Translate (const Vector3 &v)
void SetMatrix (const Matrix &m)
Matrix GetMatrix (void)

Private Member Functions

bool IfAllowRotation (uint axis, Radian radian)

Private Attributes

RefPtr< osg::Switch > mSwitchNode
 spliced over the subgraph
RefPtr< osg::MatrixTransform > mTransformNode
 also spliced over the subgraph
LimitedRotation mLimitedRotation

Detailed Description

Defines a partition of a graph (subtree).

Subgraph, by default, allows unlimited rotation (by computing a matrix).

Limited rotation: ----------------- Optionally, Subgraph can model a part that has a limited range of movement such as landing gear. Subgraph::SetRotationLimit( axis, minDegree, maxDegree ) limits the axis and degree of rotation. Subgraph::RotateLimited( Degree ) then does limited rotation according to those stored parameters.

Implementation: --------------- The subgraph is found by a visitor that searches for a node by its name. Then a MatrixTransform is spliced over the found node.


Constructor & Destructor Documentation

graph::Subgraph::Subgraph ( shptr< Graph graph,
const string &  name 
)
graph::Subgraph::~Subgraph (  ) 

Member Function Documentation

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

Enable/disable rendering a Subgraph.

Matrix graph::Subgraph::GetMatrix ( void   ) 
RefPtr<Node> graph::Subgraph::GetRootNode ( void   )  [inline]
bool graph::Subgraph::IfAllowRotation ( uint  axis,
Radian  radian 
) [private]
bool graph::Subgraph::IfEnabled ( void   ) 
Returns:
True if Subgraph is enabled/drawable.
void graph::Subgraph::Reset ( void   ) 

Reset matrix of subgraph (undo rotation and translation).

void graph::Subgraph::Rotate ( uint  axis,
Radian  radian 
)
void graph::Subgraph::SetLimitedRotation ( uint  axis,
const Degree  degreeMin,
const Degree  degreeMax 
)
void graph::Subgraph::SetMatrix ( const Matrix &  m  ) 
void graph::Subgraph::Translate ( const Vector3 &  v  ) 
void graph::Subgraph::Translate ( uint  axis,
fp  inc 
)

Move subgraph along one of its local axis.


Member Data Documentation

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

spliced over the subgraph

RefPtr<osg::MatrixTransform> graph::Subgraph::mTransformNode [private]

also spliced over the subgraph


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Palomino Flight Simulator documents generated by doxygen 1.7.1 on Tue May 15 2012 22:40:11