AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxOSG::WireRenderProxy Class Reference

#include <RenderProxy.h>

+ Inheritance diagram for agxOSG::WireRenderProxy:

Public Member Functions

 WireRenderProxy (float radius, const agx::Vec3 &color, osg::Geode *segmentGeode, osg::Geode *edgeGeode, osg::Geode *nodeGeode, agxOSG::RenderProxyFactory *factory)
 
osg::MatrixTransform * getEdgeTransform ()
 
osg::MatrixTransform * getSegmentTransform ()
 
osg::MatrixTransform * getSphereTransform ()
 
- Public Member Functions inherited from agxRender::WireRenderProxy
 WireRenderProxy (float radius, const agx::Vec3 &color)
 
void addEdge (const agx::Vec3 &startPoint, const agx::Vec3 &endPoint)
 Edges are always red and same radius as others.
 
void addNode (const agx::Vec3 &point)
 Node with default color (lumped node).
 
void addNode (const agx::Vec3 &point, float radius, const agx::Vec3 &color, agxRender::RenderManager *manager) const
 Node with different color and/or size.
 
void addSegment (const agx::Vec3 &startPoint, const agx::Vec3 &endPoint, const agx::Vec3 &prevStartPoint, const agx::Vec3 &prevEndPoint)
 Add segment with global radius and color.
 
void addSegment (const agx::Vec3 &startPoint, const agx::Vec3 &endPoint, float radius, const agx::Vec3 &color, agxRender::RenderManager *manager) const
 Slow, non-batch-rendered, segment.
 
void commit ()
 Commit the current state to the renderer.
 
virtual void onAddNotification ()
 Called when the wire is added to the simulation.
 
virtual void onRemoveNotification ()
 Called when the wire is removed from the simulation.
 
void prepare (agx::UInt numSegmentEstimate, agx::UInt numEdgesEstimate, agx::UInt numNodesEstimate)
 Prepare buffers.
 
- Public Member Functions inherited from agxRender::RenderProxy
 RenderProxy (agxCollide::Shape *shape=nullptr)
 Constructor.
 
void callOnChange (EventType type)
 Explicitly fires event of type.
 
bool compare () const
 Compare the modified count with its associated shape.
 
virtual float getAlpha () const
 
virtual agx::Vec3 getColor () const
 
bool getEnable () const
 
const agxCollide::Geometry * getGeometry () const
 
agx::UInt32 getModifiedCount () const
 This value tells us that if the proxy is synchronized with the associated shape.
 
RenderMode getRenderMode () const
 
const agxCollide::Shape * getShape () const
 
const agx::AffineMatrix4x4 & getTransform () const
 
bool isEnabled () const
 
virtual void reset ()
 Will reset color, alpha and enabled state back to default state (as when initially created).
 
virtual void setAlpha (float alpha)
 Set the alpha value of this proxy.
 
virtual void setColor (const agx::Vec3 &color)
 Set the color of this proxy.
 
void setEnable (bool flag)
 Toggle this proxy for rendering on/off.
 
void setRenderMode (RenderMode mode)
 Set the render mode for this Proxy.
 
void setShape (agxCollide::Shape *shape, const agxCollide::Geometry *geometry)
 Set the shape for this proxy.
 
virtual void setTransform (const agx::AffineMatrix4x4 &transform)
 Set the transform of this RenderProxy, if overridden, set the m_transform and call onUpdate(TRANSFORM)
 
virtual bool updateShape ()
 Called when a Shape has been changed (for example radius on a sphere is changed).
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 

Protected Member Functions

virtual ~WireRenderProxy ()
 
 ADD_COMMON_PROXY_METHODS ()
 
virtual void onAddNotification () override
 Called when the wire is added to the simulation.
 
virtual void onRemoveNotification () override
 Called when the wire is removed from the simulation.
 
void onRemoveOSG ()
 
virtual void reset () override
 Will reset color, alpha and enabled state back to default state (as when initially created).
 
void setAlphaOSG (float transparency)
 
void setColorOSG (const agx::Vec3 &color, float alpha)
 
void setEnableOSG (bool flag)
 
void setRenderModeOSG (agxRender::RenderProxy::RenderMode mode)
 
void setTransformOSG (const agx::AffineMatrix4x4 &transform)
 
virtual ~WireRenderProxy ()
 
- Protected Member Functions inherited from agxRender::RenderProxy
virtual ~RenderProxy ()
 Destructor.
 
virtual void onChange (EventType)
 Pure virtual method that should response on the different events.
 
void setBeginToEndTransform (const agx::Vec3 &begin, const agx::Vec3 &end, float &retHeight, bool signalShapeChanged, bool offsetHalfHeight=true)
 Calculates and sets the transform given begin and end points.
 
void setModifiedCount (agx::UInt32 c)
 
virtual void synchronizeParameters ()
 This method should be implemented so that it extracts size parameters from an associated shape and store it in the Proxy parameters (radius/length etc).
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

ContainerShapeBatchRenderer< agxRender::WireRenderProxy::SegmentDefContainer, osg::MatrixTransform > m_edgeBatch
 
ContainerShapeBatchRenderer< agxRender::WireRenderProxy::SegmentDefContainer, osg::MatrixTransform > m_segmentBatch
 
ContainerShapeBatchRenderer< agxRender::WireRenderProxy::SphereDefContainer, osg::MatrixTransform > m_sphereBatch
 
- Protected Attributes inherited from agxRender::WireRenderProxy
SegmentDefContainer m_edges
 
SphereDefContainer m_nodes
 
float m_radius
 
SegmentDefContainer m_segments
 
- Protected Attributes inherited from agxRender::RenderProxy
agx::observer_ptr< agxCollide::Shape > m_shape
 
agx::AffineMatrix4x4 m_transform
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Public Types inherited from agxRender::WireRenderProxy
typedef agx::VectorPOD< SegmentDef > SegmentDefContainer
 
typedef agx::VectorPOD< SphereDef > SphereDefContainer
 
- Public Types inherited from agxRender::RenderProxy
enum  EventType {
  ENABLE , TRANSFORM , ALPHA , COLOR ,
  SHAPE , REMOVE , RENDERMODE
}
 Enum for specifying a type of event which might change a RenderProxy. More...
 
enum  RenderMode { NOT_SET = 0x0 , SOLID = 0x1 , WIREFRAME = 0x2 }
 
- Static Public Member Functions inherited from agxRender::RenderProxy
static agx::Bool shouldRender (const agx::RigidBody *rb)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ WireRenderProxy()

agxOSG::WireRenderProxy::WireRenderProxy ( float  radius,
const agx::Vec3 &  color,
osg::Geode *  segmentGeode,
osg::Geode *  edgeGeode,
osg::Geode *  nodeGeode,
agxOSG::RenderProxyFactory *  factory 
)

◆ ~WireRenderProxy()

virtual agxOSG::WireRenderProxy::~WireRenderProxy ( )
protectedvirtual

Reimplemented from agxRender::WireRenderProxy.

Member Function Documentation

◆ ADD_COMMON_PROXY_METHODS()

agxOSG::WireRenderProxy::ADD_COMMON_PROXY_METHODS ( )
protected

◆ getEdgeTransform()

osg::MatrixTransform * agxOSG::WireRenderProxy::getEdgeTransform ( )

◆ getSegmentTransform()

osg::MatrixTransform * agxOSG::WireRenderProxy::getSegmentTransform ( )

◆ getSphereTransform()

osg::MatrixTransform * agxOSG::WireRenderProxy::getSphereTransform ( )

◆ onAddNotification()

virtual void agxOSG::WireRenderProxy::onAddNotification ( )
overrideprotectedvirtual

Called when the wire is added to the simulation.

Reimplemented from agxRender::WireRenderProxy.

◆ onRemoveNotification()

virtual void agxOSG::WireRenderProxy::onRemoveNotification ( )
overrideprotectedvirtual

Called when the wire is removed from the simulation.

Reimplemented from agxRender::WireRenderProxy.

◆ onRemoveOSG()

void agxOSG::WireRenderProxy::onRemoveOSG ( )
protected

◆ reset()

virtual void agxOSG::WireRenderProxy::reset ( )
inlineoverrideprotectedvirtual

Will reset color, alpha and enabled state back to default state (as when initially created).

Reimplemented from agxRender::RenderProxy.

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

◆ setAlphaOSG()

void agxOSG::WireRenderProxy::setAlphaOSG ( float  transparency)
protected

◆ setColorOSG()

void agxOSG::WireRenderProxy::setColorOSG ( const agx::Vec3 &  color,
float  alpha 
)
protected

◆ setEnableOSG()

void agxOSG::WireRenderProxy::setEnableOSG ( bool  flag)
protected

◆ setRenderModeOSG()

void agxOSG::WireRenderProxy::setRenderModeOSG ( agxRender::RenderProxy::RenderMode  mode)
protected

◆ setTransformOSG()

void agxOSG::WireRenderProxy::setTransformOSG ( const agx::AffineMatrix4x4 &  transform)
protected

Member Data Documentation

◆ m_edgeBatch

ContainerShapeBatchRenderer< agxRender::WireRenderProxy::SegmentDefContainer, osg::MatrixTransform > agxOSG::WireRenderProxy::m_edgeBatch
protected

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

◆ m_segmentBatch

ContainerShapeBatchRenderer< agxRender::WireRenderProxy::SegmentDefContainer, osg::MatrixTransform > agxOSG::WireRenderProxy::m_segmentBatch
protected

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

◆ m_sphereBatch

ContainerShapeBatchRenderer< agxRender::WireRenderProxy::SphereDefContainer, osg::MatrixTransform > agxOSG::WireRenderProxy::m_sphereBatch
protected

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


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