version 3.3

VRS::LODNode Class Reference

#include <vrs/sg/lodnode.h>

Inheritance diagram for VRS::LODNode:

VRS::SceneNode VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 LODNode ()
 constructs an empty LODNode
 LODNode (const SO< Iterator< double > > &distances, const SO< Iterator< SO< SceneNode > > > &nodes)
 constructs an LODNode with the given distances and corresponding SceneNode objects
void append (double distance, const SO< SceneNode > &node)
void remove (double distance)
 Removes the specified distance and the corresponding node.
void clear ()
 Removes all distance/node-pairs.
unsigned int size () const
 Returns the number of distance/node-pairs.
double getDistance (unsigned int index) const
 Returns the distance for the node at the specified index.
SO< SceneNodegetLodNode (unsigned int index) const
 Returns the node at the specified index (can return NULL).
SO< SceneNodegetCurrentLodNode (double distance) const
 Returns the node for a specified distance (can return NULL).
virtual Bounds boundingBox (Engine *engine) const
 Bounding box of the nodes.
virtual void evaluate (Engine *engine)
 Evaluates the node corresponding to the current camera distance.
virtual
SceneNodeVisitor::TraversalFlag 
traverse (SceneNodeVisitor *visitor)
virtual void modified ()
 Overridden to invalidate the m_bbox.
 VRS_TYPEINFO (LODNode, SceneNode)
 VRS_SERIALIZABLE (LODNode)

Protected Member Functions

virtual void acceptChildren (std::vector< Visitable * > &appendChildrenHere) const
virtual double getDistanceFromCamera (Engine *engine)
 Computes the distance to the current camera position.

Protected Attributes

Bounds m_bbox


Detailed Description

Node for level-of-detail rendering This node manages distance-node pairs. The first given node will be rendered if the distance of the center of the bounding box (union of all given shapes) with the camera position is between the first given distance and the second one. The n-th shape will be rendered if it's distance to the camera position is in the interval of the n-th with the (n+1)-th distance. The first distance usually should be 0.0. The distance-shape pairs will be re-ordered, so the given order doesn't matter. The node pointers can be NULL to omit rendering for certain ranges.

Constructor & Destructor Documentation

VRS::LODNode::LODNode (  ) 

constructs an empty LODNode

VRS::LODNode::LODNode ( const SO< Iterator< double > > &  distances,
const SO< Iterator< SO< SceneNode > > > &  nodes 
)

constructs an LODNode with the given distances and corresponding SceneNode objects


Member Function Documentation

void VRS::LODNode::append ( double  distance,
const SO< SceneNode > &  node 
)

Inserts the given distance/node-pair into the already contained pairs, sorted by distance; node can be NULL.

void VRS::LODNode::remove ( double  distance  ) 

Removes the specified distance and the corresponding node.

void VRS::LODNode::clear (  ) 

Removes all distance/node-pairs.

unsigned int VRS::LODNode::size (  )  const

Returns the number of distance/node-pairs.

double VRS::LODNode::getDistance ( unsigned int  index  )  const

Returns the distance for the node at the specified index.

SO<SceneNode> VRS::LODNode::getLodNode ( unsigned int  index  )  const

Returns the node at the specified index (can return NULL).

SO<SceneNode> VRS::LODNode::getCurrentLodNode ( double  distance  )  const

Returns the node for a specified distance (can return NULL).

virtual Bounds VRS::LODNode::boundingBox ( Engine engine  )  const [virtual]

Bounding box of the nodes.

Reimplemented from VRS::SceneNode.

virtual void VRS::LODNode::evaluate ( Engine engine  )  [virtual]

Evaluates the node corresponding to the current camera distance.

Reimplemented from VRS::SceneNode.

virtual SceneNodeVisitor::TraversalFlag VRS::LODNode::traverse ( SceneNodeVisitor visitor  )  [virtual]

A "visitor" can be sent through a scene graph, e.g., for detecting certain shapes or finding attribute objects etc. The visitor is informed about all shapes, attributes, and scene nodes encountered during a traversal.

Reimplemented from VRS::SceneNode.

virtual void VRS::LODNode::modified (  )  [virtual]

Overridden to invalidate the m_bbox.

Reimplemented from VRS::SharedObj.

VRS::LODNode::VRS_TYPEINFO ( LODNode  ,
SceneNode   
)

VRS::LODNode::VRS_SERIALIZABLE ( LODNode   ) 

virtual void VRS::LODNode::acceptChildren ( std::vector< Visitable * > &  appendChildrenHere  )  const [protected, virtual]

Reimplemented from VRS::Visitable.

virtual double VRS::LODNode::getDistanceFromCamera ( Engine engine  )  [protected, virtual]

Computes the distance to the current camera position.

Parameters:
 Engine * engine Engine evaluating the scene


Member Data Documentation

Bounds VRS::LODNode::m_bbox [mutable, protected]


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

Generated on Sat May 25 06:00:32 2013 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact