AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxOSG::ShapeBatchRenderer< TransformType > Class Template Reference

Base class for batch rendering of any shape or shape composite. More...

#include <RenderProxy.h>

+ Inheritance diagram for agxOSG::ShapeBatchRenderer< TransformType >:

Public Member Functions

void clear ()
 Clear the root transform node from all child transforms. More...
 
float getScale () const
 
void setScale (float scale)
 Assign transform scale. More...
 

Protected Member Functions

 ShapeBatchRenderer (osg::Shape *shape, agxOSG::RenderProxyFactory *factory, agxRender::RenderProxy *proxy)
 Construct given single shape. More...
 
 ShapeBatchRenderer (osg::Geode *geode, agxOSG::RenderProxyFactory *factory, agxRender::RenderProxy *proxy)
 Construct given geode. More...
 
virtual ~ShapeBatchRenderer ()
 Destructor. More...
 
void prepare (size_t numObjects)
 Prepare the root transform with the current amount of child nodes. More...
 
void prepareWithScale (size_t numObjects)
 Including scale transform. More...
 
void setTransform (TransformType *obj, const agx::AffineMatrix4x4 &transform, const agx::Vec3f &scale)
 Assign transform (given agx type) to a supported osg transform. More...
 

Protected Attributes

osg::ref_ptr< osg::Geode > m_geode
 
float m_scale
 

Detailed Description

template<typename TransformType>
class agxOSG::ShapeBatchRenderer< TransformType >

Base class for batch rendering of any shape or shape composite.

This class currently handles osg::MatrixTransform and osg::AutoTransform.

Definition at line 615 of file agxOSG/RenderProxy.h.

Constructor & Destructor Documentation

template<typename TransformType>
agxOSG::ShapeBatchRenderer< TransformType >::ShapeBatchRenderer ( osg::Shape *  shape,
agxOSG::RenderProxyFactory *  factory,
agxRender::RenderProxy *  proxy 
)
protected

Construct given single shape.

Parameters
shape- only instantiated shape
factory- the render proxy factory
proxy- render proxy (often the subclass)
template<typename TransformType>
agxOSG::ShapeBatchRenderer< TransformType >::ShapeBatchRenderer ( osg::Geode *  geode,
agxOSG::RenderProxyFactory *  factory,
agxRender::RenderProxy *  proxy 
)
protected

Construct given geode.

Parameters
geode- geode with one or many shapes
factory- the render proxy factory
proxy- render proxy (often the subclass)
template<typename TransformType>
virtual agxOSG::ShapeBatchRenderer< TransformType >::~ShapeBatchRenderer ( )
inlineprotectedvirtual

Destructor.

Definition at line 654 of file agxOSG/RenderProxy.h.

References agxOSG::ShapeBatchRenderer< TransformType >::clear().

Member Function Documentation

template<typename TransformType >
void agxOSG::ShapeBatchRenderer< TransformType >::clear ( )

Clear the root transform node from all child transforms.

Definition at line 857 of file agxOSG/RenderProxy.h.

Referenced by agxOSG::ContainerShapeBatchRenderer< ContainerType, TransformType >::clear(), and agxOSG::ShapeBatchRenderer< TransformType >::~ShapeBatchRenderer().

template<typename TransformType >
float agxOSG::ShapeBatchRenderer< TransformType >::getScale ( ) const
template<typename TransformType>
void agxOSG::ShapeBatchRenderer< TransformType >::prepare ( size_t  numObjects)
protected

Prepare the root transform with the current amount of child nodes.

Parameters
numObjects- number of child transforms
template<typename TransformType>
void agxOSG::ShapeBatchRenderer< TransformType >::prepareWithScale ( size_t  numObjects)
protected

Including scale transform.

template<typename TransformType >
void agxOSG::ShapeBatchRenderer< TransformType >::setScale ( float  scale)

Assign transform scale.

Default: 1.

Parameters
scale- new scale

Definition at line 864 of file agxOSG/RenderProxy.h.

Referenced by agxOSG::RigidBodyBatchRenderProxy< ContainerType, TransformType >::ADD_COMMON_METHODS().

template<typename TransformType>
void agxOSG::ShapeBatchRenderer< TransformType >::setTransform ( TransformType *  obj,
const agx::AffineMatrix4x4 &  transform,
const agx::Vec3f &  scale 
)
protected

Assign transform (given agx type) to a supported osg transform.

Parameters
obj- transform object to be assigned
transform- transform to a assign
scale- scale factor

Member Data Documentation

template<typename TransformType>
osg::ref_ptr< osg::Geode > agxOSG::ShapeBatchRenderer< TransformType >::m_geode
protected

Definition at line 676 of file agxOSG/RenderProxy.h.

template<typename TransformType>
float agxOSG::ShapeBatchRenderer< TransformType >::m_scale
protected

Definition at line 677 of file agxOSG/RenderProxy.h.


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