|
AGXDynamics
2.31.1.0
|
Class for reading a mesh object from file and extracting vertices, normals and indices for collision detection Notice that this class will read the mesh vertices/indices as is. More...
#include <MeshReader.h>
Inheritance diagram for agxIO::MeshReader:Public Member Functions | |
| MeshReader () | |
| 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 |
| const agx::UInt32Vector & | getIndices () const |
| Get indices from previously read mesh file. More... | |
| const agx::Vec3Vector & | getNormals () const |
| Get normals from previously read mesh file. More... | |
| size_t | getNumTriangles () const |
| Get number of triangles from previously read mesh file. More... | |
| int | getReferenceCount () const |
| const agx::Vec2Vector & | getTextureCoordinates () const |
| Get texture coordinates from previously read mesh file. More... | |
| const agx::Vec3Vector & | getVertices () const |
| Get vertices from previously read mesh file. More... | |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| virtual size_t | readFile (const agx::String &filename) |
| Read a specified filename containing a mesh description in some mesh format. More... | |
| virtual size_t | readStream (std::istream &stream, FileExtension::FileType fet) |
| Read a specified stream containing a mesh description in some mesh format. More... | |
| virtual size_t | readString (const agx::String &mesh, FileExtension::FileType fet) |
| Read a specified string containing a mesh description in some mesh format defined as a string. 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 | 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 agx::String | getFileExtension (FileExtension::FileType type) |
| Convert a filetype enum to a string with the file extension (without '. More... | |
| static FileExtension::FileType | getFileExtensionType (const agx::String &fileName) |
| Convert a filename to a known (or unknown) file extension enum. More... | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions | |
| virtual | ~MeshReader () |
| void | allocateObserverVector () const |
| void | clear () |
| Reset all allocated memory. More... | |
| void | deleteUsingDeleteHandler () const |
| size_t | readShlStream (std::istream &stream) |
| Read a specified stream containing a mesh description in SHL format. More... | |
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 | |
| agx::UInt32Vector | m_indices |
| Mutex | m_mutex |
| agx::Vec3Vector | m_normals |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
| agx::Vec2Vector | m_texCoordinates |
| agx::Vec3Vector | m_vertices |
Static Protected Attributes | |
| static agx::StringVector | m_extensions |
Class for reading a mesh object from file and extracting vertices, normals and indices for collision detection Notice that this class will read the mesh vertices/indices as is.
No merging of nearby vertices will be done.
Definition at line 82 of file MeshReader.h.
| agxIO::MeshReader::MeshReader | ( | ) |
|
inlineprotectedvirtual |
Definition at line 170 of file MeshReader.h.
|
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 |
|
protected |
Reset all allocated memory.
|
protectedinherited |
|
staticprotectedinherited |
|
static |
Convert a filetype enum to a string with the file extension (without '.
')
| type | - Enum with the filetype to be returned as a string |
|
static |
Convert a filename to a known (or unknown) file extension enum.
| fileName | - filename including extension of a mesh file |
|
inline |
Get indices from previously read mesh file.
Definition at line 185 of file MeshReader.h.
References m_indices.
|
inline |
Get normals from previously read mesh file.
Definition at line 190 of file MeshReader.h.
References m_normals.
|
inline |
Get number of triangles from previously read mesh file.
Definition at line 201 of file MeshReader.h.
References m_indices, and agx::Container::size().
|
inherited |
|
inline |
Get texture coordinates from previously read mesh file.
Definition at line 195 of file MeshReader.h.
References m_texCoordinates.
|
inline |
Get vertices from previously read mesh file.
Definition at line 180 of file MeshReader.h.
References m_vertices.
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::Buffer::getElement(), and agx::Object::getResource().
|
virtual |
Read a specified filename containing a mesh description in some mesh format.
Reimplemented in agxIO::MeshReaderAssimp, and agxIO::MeshReaderOBJ.
|
protected |
Read a specified stream containing a mesh description in SHL format.
|
virtual |
Read a specified stream containing a mesh description in some mesh format.
Reimplemented in agxIO::MeshReaderAssimp.
|
virtual |
Read a specified string containing a mesh description in some mesh format defined as a string.
Reimplemented in agxIO::MeshReaderAssimp.
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().
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
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 |
|
staticprotected |
Definition at line 177 of file MeshReader.h.
|
protected |
Definition at line 174 of file MeshReader.h.
Referenced by getIndices(), and getNumTriangles().
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
protected |
Definition at line 173 of file MeshReader.h.
Referenced by getNormals().
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
protected |
Definition at line 175 of file MeshReader.h.
Referenced by getTextureCoordinates().
|
protected |
Definition at line 172 of file MeshReader.h.
Referenced by getVertices().