|
AGX Dynamics 2.42.3.0
|
Abstract base class which encapsulated information for rendering a specific shape. More...
#include <RenderProxy.h>
Inheritance diagram for agxRender::RenderProxy:Public Types | |
| 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 } |
Public Member Functions | |
| 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. | |
Static Public Member Functions | |
| 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) |
Protected Member Functions | |
| 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 | |
| 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 | |
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. | |
Abstract base class which encapsulated information for rendering a specific shape.
Definition at line 52 of file agxRender/RenderProxy.h.
Enum for specifying a type of event which might change a RenderProxy.
| Enumerator | |
|---|---|
| ENABLE | A RenderProxy is enabled/disabled. |
| TRANSFORM | The transformation for a proxy is updated. |
| ALPHA | The alpha value for a proxy is updated. |
| COLOR | The color value for a proxy is updated. |
| SHAPE | The Shape has been modified a rebuild is needed. |
| REMOVE | The Shape has been removed from space, need to be removed from rendering. |
| RENDERMODE | The RenderMode has been changed. |
Definition at line 57 of file agxRender/RenderProxy.h.
| Enumerator | |
|---|---|
| NOT_SET | |
| SOLID | |
| WIREFRAME | |
Definition at line 67 of file agxRender/RenderProxy.h.
| agxRender::RenderProxy::RenderProxy | ( | agxCollide::Shape * | shape = nullptr | ) |
Constructor.
|
protectedvirtual |
Destructor.
| void agxRender::RenderProxy::callOnChange | ( | EventType | type | ) |
Explicitly fires event of type.
| type | - type of event to fire to this render proxy |
Referenced by setAlpha(), setColor(), setEnable(), setRenderMode(), and setTransform().
| bool agxRender::RenderProxy::compare | ( | ) | const |
Compare the modified count with its associated shape.
|
inlinevirtual |
Definition at line 862 of file agxRender/RenderProxy.h.
|
inlinevirtual |
Definition at line 848 of file agxRender/RenderProxy.h.
|
inline |
Definition at line 903 of file agxRender/RenderProxy.h.
|
inline |
Definition at line 889 of file agxRender/RenderProxy.h.
|
inline |
This value tells us that if the proxy is synchronized with the associated shape.
When a shape change any of its attributes, it will increment its own number. If it does not match this, it will trigger onChange(SHAPE).
Definition at line 872 of file agxRender/RenderProxy.h.
|
inline |
Definition at line 916 of file agxRender/RenderProxy.h.
|
inline |
Definition at line 884 of file agxRender/RenderProxy.h.
References m_shape.
|
inline |
Definition at line 835 of file agxRender/RenderProxy.h.
References m_transform.
|
inline |
Definition at line 137 of file agxRender/RenderProxy.h.
|
inlineprotectedvirtual |
Pure virtual method that should response on the different events.
This method is (indirectly via callOnChange) called from most set* methods. Should really never be called direct from anywhere else but from callOnChange.
Definition at line 170 of file agxRender/RenderProxy.h.
|
virtual |
Will reset color, alpha and enabled state back to default state (as when initially created).
Reimplemented in agxOSG::RigidBodyBatchRenderProxy< ContainerType, TransformType >, agxOSG::ContactProxy, and agxOSG::WireRenderProxy.
|
inlinevirtual |
Set the alpha value of this proxy.
If overridden, store color in m_alpha and call onUpdate(ALPHA)
Definition at line 853 of file agxRender/RenderProxy.h.
References ALPHA, callOnChange(), and agx::equivalent().
|
protected |
Calculates and sets the transform given begin and end points.
The transform is oriented along the direction towards end and is located at the midpoint between begin and end.
| begin | - begin position | |
| end | - end position | |
| [out] | retHeight | - distance between begin and end |
| signalShapeChanged | - true to trigger callOnChange(EventType::SHAPE) | |
| offsetHalfHeight | - true to center transform between begin and end, otherwise at begin |
|
inlinevirtual |
Set the color of this proxy.
If overridden, store color in m_color and call onUpdate(COLOR)
Definition at line 840 of file agxRender/RenderProxy.h.
References callOnChange(), COLOR, and agx::equivalent().
|
inline |
Toggle this proxy for rendering on/off.
Will trigger onUpdate(ENABLE)
Definition at line 894 of file agxRender/RenderProxy.h.
References callOnChange(), and ENABLE.
|
inlineprotected |
Definition at line 867 of file agxRender/RenderProxy.h.
Referenced by setShape().
|
inline |
Set the render mode for this Proxy.
Will trigger onUpdate(RENDERMODE)
Definition at line 908 of file agxRender/RenderProxy.h.
References callOnChange(), and RENDERMODE.
|
inline |
Set the shape for this proxy.
Definition at line 877 of file agxRender/RenderProxy.h.
References m_shape, and setModifiedCount().
|
inlinevirtual |
Set the transform of this RenderProxy, if overridden, set the m_transform and call onUpdate(TRANSFORM)
Definition at line 829 of file agxRender/RenderProxy.h.
References callOnChange(), m_transform, and TRANSFORM.
Referenced by agxOSG::RigidBodyBatchRenderProxy< ContainerType, TransformType >::ADD_COMMON_PROXY_METHODS().
|
static |
|
inlineprotectedvirtual |
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).
Reimplemented in agxRender::SphereProxy, agxRender::PlaneProxy, agxRender::LineProxy, agxRender::CylinderProxy, agxRender::HollowCylinderProxy, agxRender::ConeProxy, agxRender::TruncatedConeProxy, agxRender::HollowConeProxy, agxRender::CapsuleProxy, agxRender::WireShapeProxy, and agxRender::BoxProxy.
Definition at line 163 of file agxRender/RenderProxy.h.
|
inlinevirtual |
Called when a Shape has been changed (for example radius on a sphere is changed).
Definition at line 101 of file agxRender/RenderProxy.h.
|
protected |
Definition at line 194 of file agxRender/RenderProxy.h.
Referenced by getShape(), and setShape().
|
protected |
Definition at line 195 of file agxRender/RenderProxy.h.
Referenced by getTransform(), and setTransform().