AGX Dynamics 2.40.0.0
Loading...
Searching...
No Matches
agxOSG::GeometryNode Class Reference

A node that can be associated with a collision geometry so that the transformation of this node is updated from the transformation of the Geometry. More...

#include <GeometryNode.h>

+ Inheritance diagram for agxOSG::GeometryNode:

Public Types

enum  RenderFlag { RENDER_DATA =0x1 , GEOMETRY_DATA =0x2 }
 

Public Member Functions

 GeometryNode ()
 Default constructor.
 
 GeometryNode (agxCollide::Geometry *geometry)
 Constructor that associates this node's transformation with the transformation of the specified geometry.
 
 GeometryNode (const GeometryNode &node, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 
virtual const char * className () const
 
virtual osg::Object * clone (const osg::CopyOp &copyop) const
 
virtual osg::Object * cloneType () const
 
bool getAutoRemove () const
 
agxCollide::GeometrygetGeometry ()
 Get the associated geometry.
 
osg::Node * getRenderChild (RenderFlag flag)
 
const osg::Node * getRenderChild (RenderFlag flag) const
 
RenderFlag getSelectedRenderChild () const
 
virtual bool isSameKindAs (const osg::Object *obj) const
 
virtual const char * libraryName () const
 
void removeFromParents ()
 
void removeNode (agxCollide::Space *space, agxCollide::Geometry *geometry)
 
void selectRenderChild (RenderFlag flag)
 
void setAutoRemove (bool flag)
 Specify whether this node should be removed when the destructor of the associated geometry is called.
 
void setGeometry (agxCollide::Geometry *geometry)
 Associate this node's transformation with the transformation of the specified geometry.
 
void setRenderChild (RenderFlag flag, osg::Node *node)
 Set a child to this node so it can be toggled with the setRenderFlag.
 
virtual void traverse (osg::NodeVisitor &nv)
 
void updateTransform ()
 Read the transform from the geometry and update the visual transform node.
 

Public Attributes

agxCollide::Geometry::ShapeChangeEvent::CallbackType shapeCallback
 

Protected Member Functions

virtual ~GeometryNode ()
 

Protected Attributes

bool m_autoRemove
 
agx::observer_ptr< agxCollide::Geometrym_geometry
 
osg::ref_ptr< osg::Group > m_geometryParent
 
osg::ref_ptr< osg::Group > m_renderParent
 

Detailed Description

A node that can be associated with a collision geometry so that the transformation of this node is updated from the transformation of the Geometry.

If setAutoRemove() is set to true, this node will be removed from the scenegraph whenever the associated Geometry is deallocated.

Definition at line 41 of file GeometryNode.h.

Member Enumeration Documentation

◆ RenderFlag

Enumerator
RENDER_DATA 

Specify the RenderData data of a GeometryNode.

GEOMETRY_DATA 

Specify the renderable data generated directly from the AGX shapes.

Definition at line 45 of file GeometryNode.h.

Constructor & Destructor Documentation

◆ GeometryNode() [1/3]

agxOSG::GeometryNode::GeometryNode ( )

Default constructor.

◆ GeometryNode() [2/3]

agxOSG::GeometryNode::GeometryNode ( agxCollide::Geometry geometry)

Constructor that associates this node's transformation with the transformation of the specified geometry.

◆ GeometryNode() [3/3]

agxOSG::GeometryNode::GeometryNode ( const GeometryNode node,
const osg::CopyOp &  copyop = osg::CopyOp::SHALLOW_COPY 
)

Copy constructor using CopyOp to manage deep vs shallow copy.

◆ ~GeometryNode()

virtual agxOSG::GeometryNode::~GeometryNode ( )
protectedvirtual

Member Function Documentation

◆ className()

virtual const char * agxOSG::GeometryNode::className ( ) const
inlinevirtual

Definition at line 86 of file GeometryNode.h.

◆ clone()

virtual osg::Object * agxOSG::GeometryNode::clone ( const osg::CopyOp &  copyop) const
inlinevirtual

Definition at line 84 of file GeometryNode.h.

◆ cloneType()

virtual osg::Object * agxOSG::GeometryNode::cloneType ( ) const
inlinevirtual

Definition at line 83 of file GeometryNode.h.

◆ getAutoRemove()

bool agxOSG::GeometryNode::getAutoRemove ( ) const
inline
Returns
true if this node should be removed, when the destructor of the associated geometry is called.

Definition at line 75 of file GeometryNode.h.

◆ getGeometry()

agxCollide::Geometry * agxOSG::GeometryNode::getGeometry ( )

Get the associated geometry.

◆ getRenderChild() [1/2]

osg::Node * agxOSG::GeometryNode::getRenderChild ( RenderFlag  flag)
Parameters
flag- Specifies which child that should be returned-
Returns
a pointer to the specified child. Null if the specified child does not exist!

◆ getRenderChild() [2/2]

const osg::Node * agxOSG::GeometryNode::getRenderChild ( RenderFlag  flag) const
Parameters
flag- Specifies which child that should be returned-
Returns
a pointer to the specified child. Null if the specified child does not exist!

◆ getSelectedRenderChild()

RenderFlag agxOSG::GeometryNode::getSelectedRenderChild ( ) const

◆ isSameKindAs()

virtual bool agxOSG::GeometryNode::isSameKindAs ( const osg::Object *  obj) const
inlinevirtual

Definition at line 85 of file GeometryNode.h.

◆ libraryName()

virtual const char * agxOSG::GeometryNode::libraryName ( ) const
inlinevirtual

Definition at line 87 of file GeometryNode.h.

◆ removeFromParents()

void agxOSG::GeometryNode::removeFromParents ( )

◆ removeNode()

void agxOSG::GeometryNode::removeNode ( agxCollide::Space space,
agxCollide::Geometry geometry 
)

◆ selectRenderChild()

void agxOSG::GeometryNode::selectRenderChild ( RenderFlag  flag)

◆ setAutoRemove()

void agxOSG::GeometryNode::setAutoRemove ( bool  flag)
inline

Specify whether this node should be removed when the destructor of the associated geometry is called.

Definition at line 81 of file GeometryNode.h.

◆ setGeometry()

void agxOSG::GeometryNode::setGeometry ( agxCollide::Geometry geometry)

Associate this node's transformation with the transformation of the specified geometry.

◆ setRenderChild()

void agxOSG::GeometryNode::setRenderChild ( RenderFlag  flag,
osg::Node *  node 
)

Set a child to this node so it can be toggled with the setRenderFlag.

Parameters
flag- Specifies which kind of render data this is: RENDER_DATA (as stored in Geometry as RenderData) or RENDER_GEOMETRY (parsed from the AGX Shape).
node- The node to add

◆ traverse()

virtual void agxOSG::GeometryNode::traverse ( osg::NodeVisitor &  nv)
virtual

◆ updateTransform()

void agxOSG::GeometryNode::updateTransform ( )

Read the transform from the geometry and update the visual transform node.

Member Data Documentation

◆ m_autoRemove

bool agxOSG::GeometryNode::m_autoRemove
protected

Definition at line 131 of file GeometryNode.h.

◆ m_geometry

agx::observer_ptr<agxCollide::Geometry> agxOSG::GeometryNode::m_geometry
protected

Definition at line 133 of file GeometryNode.h.

◆ m_geometryParent

osg::ref_ptr<osg::Group> agxOSG::GeometryNode::m_geometryParent
protected

Definition at line 137 of file GeometryNode.h.

◆ m_renderParent

osg::ref_ptr<osg::Group> agxOSG::GeometryNode::m_renderParent
protected

Definition at line 138 of file GeometryNode.h.

◆ shapeCallback

agxCollide::Geometry::ShapeChangeEvent::CallbackType agxOSG::GeometryNode::shapeCallback

Definition at line 127 of file GeometryNode.h.


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