|
AGXDynamics
2.31.1.0
|
Class for storing rendering information for a Shape. More...
#include <RenderData.h>
Inheritance diagram for agxCollide::RenderData:Public Types | |
| enum | Mode { TRIANGLES =4 } |
| Specifies which type of primitive this render data represents. More... | |
| enum | StateInfo { STANDARD =0x0, NO_RENDER =0x1 } |
Public Member Functions | |
| RenderData () | |
| Constructor. More... | |
| 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 |
| RenderData * | clone () const |
| Returns an exact copy of the render data as a new object. More... | |
| const char * | getClassName () const override |
| const agx::Vec4Vector & | getColorArray () const |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. More... | |
| const agx::UInt32Vector & | getIndexArray () const |
| Mode | getMode () const |
| const agx::Vec3Vector & | getNormalArray () const |
| int | getReferenceCount () const |
| agxCollide::RenderMaterial * | getRenderMaterial () const |
| bool | getShouldRender () const |
| agxStream::StorageAgent * | getStorageAgent () const override |
| const agx::Vec2Vector & | getTexCoordArray () const |
| agx::Uuid | getUuid () const |
| const agx::Vec3Vector & | getVertexArray () const |
| bool | hasRenderMaterial () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| bool | isFinished () const |
| 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... | |
| virtual void | restore (agxStream::InputArchive &in) override |
| void | setColorArray (const agx::Vec4Vector &color) |
| Set and copy the colors. More... | |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. More... | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More... | |
| void | setIndexArray (const agx::UInt32Vector &indices, Mode mode) |
| Set (and copy) the indices. More... | |
| void | setNormalArray (const agx::Vec3Vector &normals) |
| Set (and copy) the normals. More... | |
| void | setRenderMaterial (agxCollide::RenderMaterial *renderMaterial) |
| Set the renderMaterial of this RenderData. More... | |
| void | setShouldRender (bool shouldRender) |
| Set if the data stored should be rendered at all. More... | |
| void | setTexCoordArray (const agx::Vec2Vector &texCoords) |
| Set (and copy) the texture coordinates. More... | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. More... | |
| void | setVertexArray (const agx::Vec3Vector &vertices) |
| Set (and copy) the vertices. More... | |
| virtual void | store (agxStream::OutputArchive &out) const override |
| 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 | |
| static agxStream::Serializable * | create () |
| static agxStream::Serializable * | create (agxStream::InputArchive &) |
| static const char * | getConstructClassId () |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More... | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions | |
| virtual | ~RenderData () |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
| void | generateUuid () |
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... | |
Class for storing rendering information for a Shape.
This data can later be accessed by a rendering engine. You can also derive from this class and implement your own containing more relevant information for your specific needs, such as textures, multitexcoords, shaders etc. Just make sure you implement the store/restore method too.
Definition at line 39 of file RenderData.h.
Specifies which type of primitive this render data represents.
| Enumerator | |
|---|---|
| TRIANGLES | |
Definition at line 44 of file RenderData.h.
| Enumerator | |
|---|---|
| STANDARD | |
| NO_RENDER | |
Definition at line 58 of file RenderData.h.
| agxCollide::RenderData::RenderData | ( | ) |
Constructor.
|
protectedvirtual |
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
| RenderData* agxCollide::RenderData::clone | ( | ) | const |
Returns an exact copy of the render data as a new object.
|
inlinestatic |
Definition at line 120 of file RenderData.h.
|
inlinestatic |
Definition at line 120 of file RenderData.h.
|
protectedinherited |
|
protectedinherited |
|
inlineoverridevirtual |
Reimplemented from agxStream::Serializable.
Definition at line 120 of file RenderData.h.
| const agx::Vec4Vector& agxCollide::RenderData::getColorArray | ( | ) | const |
|
inlinestatic |
Definition at line 120 of file RenderData.h.
|
staticprotectedinherited |
|
inherited |
Definition at line 273 of file Serializable.h.
|
inherited |
|
inherited |
This index is given at creation of this object.
It is guaranteed to be unique for the lifetime of this library instance. As long as the application is running. This value is not serialized or restored. A new object will always get a new index no matter how it is created.
Definition at line 247 of file Serializable.h.
| const agx::UInt32Vector& agxCollide::RenderData::getIndexArray | ( | ) | const |
| Mode agxCollide::RenderData::getMode | ( | ) | const |
| const agx::Vec3Vector& agxCollide::RenderData::getNormalArray | ( | ) | const |
|
inherited |
| agxCollide::RenderMaterial* agxCollide::RenderData::getRenderMaterial | ( | ) | const |
| bool agxCollide::RenderData::getShouldRender | ( | ) | const |
|
inlineoverridevirtual |
Implements agxStream::Serializable.
Definition at line 120 of file RenderData.h.
| const agx::Vec2Vector& agxCollide::RenderData::getTexCoordArray | ( | ) | const |
|
inherited |
Definition at line 268 of file Serializable.h.
| const agx::Vec3Vector& agxCollide::RenderData::getVertexArray | ( | ) | const |
| bool agxCollide::RenderData::hasRenderMaterial | ( | ) | const |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::Buffer::getElement(), and agx::Object::getResource().
|
inherited |
Definition at line 252 of file Serializable.h.
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.
Referenced by agxData::Val< UInt >::Val().
|
overridevirtual |
| void agxCollide::RenderData::setColorArray | ( | const agx::Vec4Vector & | color | ) |
Set and copy the colors.
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
|
inherited |
Set to false to disable serialization of this object.
It will just be ignored during serialization (writing). It is still possible to restore TO this object.
|
staticinherited |
Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
|
inherited |
Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
| void agxCollide::RenderData::setIndexArray | ( | const agx::UInt32Vector & | indices, |
| Mode | mode | ||
| ) |
Set (and copy) the indices.
| void agxCollide::RenderData::setNormalArray | ( | const agx::Vec3Vector & | normals | ) |
Set (and copy) the normals.
| void agxCollide::RenderData::setRenderMaterial | ( | agxCollide::RenderMaterial * | renderMaterial | ) |
Set the renderMaterial of this RenderData.
| void agxCollide::RenderData::setShouldRender | ( | bool | shouldRender | ) |
Set if the data stored should be rendered at all.
| void agxCollide::RenderData::setTexCoordArray | ( | const agx::Vec2Vector & | texCoords | ) |
Set (and copy) the texture coordinates.
Explicitly set a Uuid on a serializable object.
Use this method with great care, as it can result in non-unique identifiers in the system!
| void agxCollide::RenderData::setVertexArray | ( | const agx::Vec3Vector & | vertices | ) |
Set (and copy) the vertices.
|
overridevirtual |
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.
|
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.
|
staticinherited |
|
protected |
Definition at line 129 of file RenderData.h.
|
protected |
Definition at line 135 of file RenderData.h.
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
protected |
Definition at line 130 of file RenderData.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
protected |
Definition at line 133 of file RenderData.h.
|
protected |
Definition at line 134 of file RenderData.h.
|
protected |
Definition at line 131 of file RenderData.h.
|
protected |
Definition at line 132 of file RenderData.h.
|
protected |
Definition at line 128 of file RenderData.h.