|
AGX Dynamics 2.41.1.2
|
A class to hold a general represenation of a mesh with arbitrary number of vertices in a face. More...
#include <RawMesh.h>
Inheritance diagram for agxUtil::RawMesh:Public Types | |
| typedef agx::VectorPOD< agx::UInt > | IndexVector |
Public Member Functions | |
| RawMesh () | |
| RawMesh (const agx::String &meshName) | |
| size_t | addFace (const IndexVector &vertices) |
| Add a face to the object stored with the specified vertices. | |
| size_t | addVertex (const agx::Vec3 &position) |
| Add a vertex to the object on the specified position. | |
| AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxUtil::RawMesh) | |
| agx::Real | getFaceArea (size_t face) const |
| Get the area of a face. | |
| const IndexVector & | getFacesFromVertex (size_t vertex) const |
| Get the faces which contain a specified vertex. | |
| const IndexVector & | getFaceVertices (size_t face) const |
| Get the index each vertex in the specified face. | |
| const agx::String & | getName () const |
| Get the name of the mesh. | |
| size_t | getNumFaces () const |
| Get the number of faces stored in the mesh. | |
| size_t | getNumVertices () const |
| Get the number of vertices stored in the mesh. | |
| agx::Real | getTotalArea () const |
| Get the area of all the triangles calculated as described for getFaceArea. | |
| agx::Real | getVertexArea (size_t vertex) const |
| Get the area represented by a single vertex. | |
| agx::Vec3 | getVertexPosition (size_t vertex) const |
| Get the position of a vertex. | |
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. | |
Public Member Functions inherited from agxStream::Serializable | |
| virtual | ~Serializable () |
| Destructor for normal C++ use but hidden from SWIG bindings. | |
| virtual const char * | getClassName () const |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. | |
| virtual StorageAgent * | getStorageAgent () const =0 |
| agx::Uuid | getUuid () const |
| bool | isFinished () const |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. | |
Static Public Member Functions | |
| static agxStream::Serializable * | create (agxStream::InputArchive &) |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Public Member Functions inherited from agxStream::Serializable | |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. | |
Additional Inherited Members | |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Protected Member Functions inherited from agxStream::Serializable | |
| Serializable () | |
| Default constructor. | |
| Serializable (const Serializable &other) | |
| Copy constructor. | |
| void | generateUuid () |
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. | |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
A class to hold a general represenation of a mesh with arbitrary number of vertices in a face.
| typedef agx::VectorPOD< agx::UInt > agxUtil::RawMesh::IndexVector |
| agxUtil::RawMesh::RawMesh | ( | ) |
| agxUtil::RawMesh::RawMesh | ( | const agx::String & | meshName | ) |
| size_t agxUtil::RawMesh::addFace | ( | const IndexVector & | vertices | ) |
Add a face to the object stored with the specified vertices.
The vertices is assumed to be stored clockwise from the 'up' side.
| vertices | the IDs of the vertices of the face |
| size_t agxUtil::RawMesh::addVertex | ( | const agx::Vec3 & | position | ) |
Add a vertex to the object on the specified position.
| position | the position of the added vertex |
| agxUtil::RawMesh::AGXSTREAM_DECLARE_SERIALIZABLE_BASE | ( | agxUtil::RawMesh | ) |
|
inlinestatic |
| agx::Real agxUtil::RawMesh::getFaceArea | ( | size_t | face | ) | const |
Get the area of a face.
This is calculated by taking the mid point of all the vertices, and then calculating the area of each triangle defined by two neighbours and the mid point. Unfortunately, this only gives the correct answer if the polygon is convex.
| face | the ID of the face |
| const IndexVector & agxUtil::RawMesh::getFacesFromVertex | ( | size_t | vertex | ) | const |
Get the faces which contain a specified vertex.
| vertex | the ID of the vertex |
| const IndexVector & agxUtil::RawMesh::getFaceVertices | ( | size_t | face | ) | const |
Get the index each vertex in the specified face.
They are ordered clockwise, with the last index being connected to the first.
| const agx::String & agxUtil::RawMesh::getName | ( | ) | const |
Get the name of the mesh.
| size_t agxUtil::RawMesh::getNumFaces | ( | ) | const |
Get the number of faces stored in the mesh.
| size_t agxUtil::RawMesh::getNumVertices | ( | ) | const |
Get the number of vertices stored in the mesh.
Observe, that depending on initialization, not all vertices need to be part of a face.
| agx::Real agxUtil::RawMesh::getTotalArea | ( | ) | const |
Get the area of all the triangles calculated as described for getFaceArea.
| agx::Real agxUtil::RawMesh::getVertexArea | ( | size_t | vertex | ) | const |
Get the area represented by a single vertex.
This is calculated as an equal part of each face the vertex is part of.
| agx::Vec3 agxUtil::RawMesh::getVertexPosition | ( | size_t | vertex | ) | const |
Get the position of a vertex.
| vertex | the ID of the vertex |