AGXDynamics  2.31.1.0
agxRender::RenderProxyFactory Class Referenceabstract

Abstract class which is responsible for returning a pointer to a specified RenderProxy type. More...

#include <RenderManager.h>

+ Inheritance diagram for agxRender::RenderProxyFactory:

Public Member Functions

 RenderProxyFactory ()
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
SphereProxy * create (float radius)
 Create a SphereProxy without arguments. More...
 
BoxProxy * create (const agx::Vec3 &halfExtents)
 Create a BoxProxy without arguments. More...
 
LineProxy * create (const LineProxy *)
 Create a LineProxy without arguments. More...
 
CylinderProxy * create (const CylinderProxy *)
 Create a CylinderProxy without arguments. More...
 
HollowCylinderProxy * create (const HollowCylinderProxy *)
 Create a CylinderProxy without arguments. More...
 
ConeProxy * create (const ConeProxy *)
 Create a ConeProxy without arguments. More...
 
TruncatedConeProxy * create (const TruncatedConeProxy *)
 Create a TruncatedConeProxy without arguments. More...
 
HollowTruncatedConeProxy * create (const HollowTruncatedConeProxy *)
 Create a HollowTruncatedConeProxy without arguments. More...
 
CapsuleProxy * create (const CapsuleProxy *)
 Create a CapsuleProxy without arguments. More...
 
TextProxy * create (const TextProxy *)
 Create a TextProxy without arguments. More...
 
PlaneProxy * create (const PlaneProxy *)
 Create a PlaneProxy without arguments. More...
 
ContactsProxy * create (const agxCollide::GeometryContactPtrVector &contacts)
 Create a ContactsProxy without arguments. More...
 
RigidBodyBatchRenderProxy * create (const agx::RigidBodyPtrSetVector *enabledBodies)
 Create a rigid body batch render proxy. More...
 
virtual BoxProxy * createBox (const agx::Vec3 &halfExtents)=0
 Interface for creating and returning a BoxProxy. More...
 
virtual CapsuleProxy * createCapsule (float radius, float height)=0
 Interface for creating and returning a CapsuleProxy. More...
 
virtual ConeProxy * createCone (float radius, float height)=0
 Interface for creating and returning a ConeProxy. More...
 
virtual ContactsProxy * createContacts (const agxCollide::GeometryContactPtrVector &)=0
 Interface for creating and returning ContactsProxy. More...
 
virtual CylinderProxy * createCylinder (float radius, float height)=0
 Interface for creating and returning a CylinderProxy. More...
 
virtual HeightFieldProxy * createHeightfield (agxCollide::HeightField *hf)=0
 Interface for creating and returning HeightfieldProxy. More...
 
virtual HollowCylinderProxy * createHollowCylinder (float radius, float height, float thickness)=0
 Interface for creating and returning a HollowCylinderProxy. More...
 
virtual HollowTruncatedConeProxy * createHollowTruncatedCone (float topRadius, float bottomRadius, float height, float thickness)=0
 Interface for creating and returning a HollowTruncatedConeProxy. More...
 
virtual LineProxy * createLine (const agx::Vec3 &p1, const agx::Vec3 &p2)=0
 Interface for creating and returning a LineProxy. More...
 
virtual PlaneProxy * createPlane (const agx::Vec3 &normal, agx::Real distance)=0
 Interface for creating and returning PlaneProxy. More...
 
virtual RigidBodyBatchRenderProxy * createRigidBodies (const agx::RigidBodyPtrSetVector *)=0
 Interface for creating and returning batch rendering of rigid bodies (cm). More...
 
virtual SphereProxy * createSphere (float radius)=0
 Interface for creating and returning a SphereProxy. More...
 
virtual RenderProxy * createSphereBatchRenderer (agxData::Buffer *positions, agxData::Buffer *rotations, agxData::Buffer *radii, agxData::Buffer *colors, agxData::Buffer *enableRendering, agxData::Value *bound, agx::Component *context)=0
 
virtual TextProxy * createText (const agx::String &text, const agx::Vec3 &pos)=0
 Interface for creating and returning TextProxy. More...
 
virtual TrimeshProxy * createTrimesh (agxCollide::Trimesh *mesh)=0
 Interface for creating and returning TrimeshProxy. More...
 
virtual TruncatedConeProxy * createTruncatedCone (float topRadius, float bottomRadius, float height)=0
 Interface for creating and returning a TruncatedConeProxy. More...
 
virtual WireRenderProxy * createWire (float radius, const agx::Vec3 &color)=0
 
virtual WireShapeProxy * createWireShape (float radius, float height, const agx::Vec3 &previousEndPoint0, const agx::Vec3 &previousEndPoint1)=0
 Interface for creating and returning a WireShapeProxy. More...
 
RenderProxy::RenderMode getDefaultRenderMode () const
 
bool getEnable () const
 
virtual Graph::GraphRenderer * getGraphRenderer ()=0
 This method should create and return an implementation of a GraphRenderer, a class that can render the statistics graphs as described in the class Graph::GraphRenderer. More...
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void setDefaultRenderMode (RenderProxy::RenderMode mode)
 Set the default RenderMode that will be used when a new RenderProxy is created. More...
 
void setEnable (bool flag)
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Static Public Member Functions

template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

virtual ~RenderProxyFactory ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
void setRenderManager (RenderManager *mgr)
 

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

RenderProxy::RenderMode m_defaultRenderMode
 
bool m_enabled
 
RenderManager * m_mgr
 
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Abstract class which is responsible for returning a pointer to a specified RenderProxy type.

This class is to be implemented by the user, depending on the rendering system. The implementation of this factory might have some own cache of Proxies, or not.

This class is also responsible for creating a class derived from agxRender::Graph::GraphRenderer.

Definition at line 645 of file RenderManager.h.

Constructor & Destructor Documentation

◆ RenderProxyFactory()

agxRender::RenderProxyFactory::RenderProxyFactory ( )

◆ ~RenderProxyFactory()

virtual agxRender::RenderProxyFactory::~RenderProxyFactory ( )
protectedvirtual

Reimplemented in agxOSG::RenderProxyFactory.

Member Function Documentation

◆ allocateObserverVector()

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited

◆ as() [1/2]

template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().

◆ as() [2/2]

template<typename T >
const T* agx::Referenced::as ( ) const
inherited

◆ asSafe() [1/2]

template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

◆ asSafe() [2/2]

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited

◆ create() [1/13]

SphereProxy * agxRender::RenderProxyFactory::create ( float  radius)
inline

Create a SphereProxy without arguments.

Definition at line 844 of file RenderManager.h.

◆ create() [2/13]

BoxProxy * agxRender::RenderProxyFactory::create ( const agx::Vec3 &  halfExtents)
inline

Create a BoxProxy without arguments.

Definition at line 849 of file RenderManager.h.

◆ create() [3/13]

LineProxy * agxRender::RenderProxyFactory::create ( const LineProxy *  )
inline

Create a LineProxy without arguments.

Definition at line 854 of file RenderManager.h.

◆ create() [4/13]

CylinderProxy * agxRender::RenderProxyFactory::create ( const CylinderProxy *  )
inline

Create a CylinderProxy without arguments.

Definition at line 859 of file RenderManager.h.

◆ create() [5/13]

HollowCylinderProxy * agxRender::RenderProxyFactory::create ( const HollowCylinderProxy *  )
inline

Create a CylinderProxy without arguments.

Create a HollowCylinderProxy without arguments.

Definition at line 864 of file RenderManager.h.

◆ create() [6/13]

ConeProxy * agxRender::RenderProxyFactory::create ( const ConeProxy *  )
inline

Create a ConeProxy without arguments.

Definition at line 870 of file RenderManager.h.

◆ create() [7/13]

TruncatedConeProxy * agxRender::RenderProxyFactory::create ( const TruncatedConeProxy *  )
inline

Create a TruncatedConeProxy without arguments.

Definition at line 875 of file RenderManager.h.

◆ create() [8/13]

HollowTruncatedConeProxy * agxRender::RenderProxyFactory::create ( const HollowTruncatedConeProxy *  )
inline

Create a HollowTruncatedConeProxy without arguments.

Create a TruncatedConeProxy without arguments.

Definition at line 880 of file RenderManager.h.

◆ create() [9/13]

CapsuleProxy * agxRender::RenderProxyFactory::create ( const CapsuleProxy *  )
inline

Create a CapsuleProxy without arguments.

Definition at line 886 of file RenderManager.h.

◆ create() [10/13]

TextProxy * agxRender::RenderProxyFactory::create ( const TextProxy *  )
inline

Create a TextProxy without arguments.

Definition at line 891 of file RenderManager.h.

References agxOSG::createText().

◆ create() [11/13]

PlaneProxy * agxRender::RenderProxyFactory::create ( const PlaneProxy *  )
inline

Create a PlaneProxy without arguments.

Definition at line 896 of file RenderManager.h.

◆ create() [12/13]

ContactsProxy * agxRender::RenderProxyFactory::create ( const agxCollide::GeometryContactPtrVector &  contacts)
inline

Create a ContactsProxy without arguments.

Definition at line 902 of file RenderManager.h.

◆ create() [13/13]

RigidBodyBatchRenderProxy * agxRender::RenderProxyFactory::create ( const agx::RigidBodyPtrSetVector *  enabledBodies)
inline

Create a rigid body batch render proxy.

Definition at line 907 of file RenderManager.h.

◆ createBox()

virtual BoxProxy* agxRender::RenderProxyFactory::createBox ( const agx::Vec3 &  halfExtents)
pure virtual

Interface for creating and returning a BoxProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createCapsule()

virtual CapsuleProxy* agxRender::RenderProxyFactory::createCapsule ( float  radius,
float  height 
)
pure virtual

Interface for creating and returning a CapsuleProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createCone()

virtual ConeProxy* agxRender::RenderProxyFactory::createCone ( float  radius,
float  height 
)
pure virtual

Interface for creating and returning a ConeProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createContacts()

virtual ContactsProxy* agxRender::RenderProxyFactory::createContacts ( const agxCollide::GeometryContactPtrVector &  )
pure virtual

Interface for creating and returning ContactsProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createCylinder()

virtual CylinderProxy* agxRender::RenderProxyFactory::createCylinder ( float  radius,
float  height 
)
pure virtual

Interface for creating and returning a CylinderProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createHeightfield()

virtual HeightFieldProxy* agxRender::RenderProxyFactory::createHeightfield ( agxCollide::HeightField *  hf)
pure virtual

Interface for creating and returning HeightfieldProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createHollowCylinder()

virtual HollowCylinderProxy* agxRender::RenderProxyFactory::createHollowCylinder ( float  radius,
float  height,
float  thickness 
)
pure virtual

Interface for creating and returning a HollowCylinderProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createHollowTruncatedCone()

virtual HollowTruncatedConeProxy* agxRender::RenderProxyFactory::createHollowTruncatedCone ( float  topRadius,
float  bottomRadius,
float  height,
float  thickness 
)
pure virtual

Interface for creating and returning a HollowTruncatedConeProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createLine()

virtual LineProxy* agxRender::RenderProxyFactory::createLine ( const agx::Vec3 &  p1,
const agx::Vec3 &  p2 
)
pure virtual

Interface for creating and returning a LineProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createPlane()

virtual PlaneProxy* agxRender::RenderProxyFactory::createPlane ( const agx::Vec3 &  normal,
agx::Real  distance 
)
pure virtual

Interface for creating and returning PlaneProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createRigidBodies()

virtual RigidBodyBatchRenderProxy* agxRender::RenderProxyFactory::createRigidBodies ( const agx::RigidBodyPtrSetVector *  )
pure virtual

Interface for creating and returning batch rendering of rigid bodies (cm).

Implemented in agxOSG::RenderProxyFactory.

◆ createSphere()

virtual SphereProxy* agxRender::RenderProxyFactory::createSphere ( float  radius)
pure virtual

Interface for creating and returning a SphereProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createSphereBatchRenderer()

virtual RenderProxy* agxRender::RenderProxyFactory::createSphereBatchRenderer ( agxData::Buffer *  positions,
agxData::Buffer *  rotations,
agxData::Buffer *  radii,
agxData::Buffer *  colors,
agxData::Buffer *  enableRendering,
agxData::Value *  bound,
agx::Component *  context 
)
pure virtual

Implemented in agxOSG::RenderProxyFactory.

◆ createText()

virtual TextProxy* agxRender::RenderProxyFactory::createText ( const agx::String &  text,
const agx::Vec3 &  pos 
)
pure virtual

Interface for creating and returning TextProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createTrimesh()

virtual TrimeshProxy* agxRender::RenderProxyFactory::createTrimesh ( agxCollide::Trimesh *  mesh)
pure virtual

Interface for creating and returning TrimeshProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createTruncatedCone()

virtual TruncatedConeProxy* agxRender::RenderProxyFactory::createTruncatedCone ( float  topRadius,
float  bottomRadius,
float  height 
)
pure virtual

Interface for creating and returning a TruncatedConeProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ createWire()

virtual WireRenderProxy* agxRender::RenderProxyFactory::createWire ( float  radius,
const agx::Vec3 &  color 
)
pure virtual

Implemented in agxOSG::RenderProxyFactory.

◆ createWireShape()

virtual WireShapeProxy* agxRender::RenderProxyFactory::createWireShape ( float  radius,
float  height,
const agx::Vec3 &  previousEndPoint0,
const agx::Vec3 &  previousEndPoint1 
)
pure virtual

Interface for creating and returning a WireShapeProxy.

Implemented in agxOSG::RenderProxyFactory.

◆ deleteUsingDeleteHandler()

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited

◆ getDefaultRenderMode()

RenderProxy::RenderMode agxRender::RenderProxyFactory::getDefaultRenderMode ( ) const
inline
Returns
The RenderMode used when new RenderProxy's are created

Definition at line 912 of file RenderManager.h.

◆ getDeleteHandler()

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.

◆ getEnable()

bool agxRender::RenderProxyFactory::getEnable ( ) const
inline

Definition at line 785 of file RenderManager.h.

◆ getGraphRenderer()

virtual Graph::GraphRenderer* agxRender::RenderProxyFactory::getGraphRenderer ( )
pure virtual

This method should create and return an implementation of a GraphRenderer, a class that can render the statistics graphs as described in the class Graph::GraphRenderer.

Returns
a pointer to the GraphRenderer

Implemented in agxOSG::RenderProxyFactory.

◆ getReferenceCount()

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.

◆ is()

template<typename T >
bool agx::Referenced::is ( ) const
inherited

◆ reference()

void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

◆ setDefaultRenderMode()

void agxRender::RenderProxyFactory::setDefaultRenderMode ( RenderProxy::RenderMode  mode)

Set the default RenderMode that will be used when a new RenderProxy is created.

Parameters
mode- New RenderMode

◆ setDeleteHandler()

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

◆ setEnable()

void agxRender::RenderProxyFactory::setEnable ( bool  flag)
inline

Definition at line 781 of file RenderManager.h.

◆ setRenderManager()

void agxRender::RenderProxyFactory::setRenderManager ( RenderManager *  mgr)
inlineprotected

Definition at line 772 of file RenderManager.h.

◆ unreference()

void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().

◆ unreference_nodelete()

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

◆ ValidateCast()

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

◆ m_defaultRenderMode

RenderProxy::RenderMode agxRender::RenderProxyFactory::m_defaultRenderMode
protected

Definition at line 777 of file RenderManager.h.

◆ m_enabled

bool agxRender::RenderProxyFactory::m_enabled
protected

Definition at line 778 of file RenderManager.h.

◆ m_mgr

RenderManager* agxRender::RenderProxyFactory::m_mgr
protected

Definition at line 776 of file RenderManager.h.

◆ m_mutex

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

◆ m_observers

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

◆ m_refCount

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.


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