AGX Dynamics  2.37.2.0
agxIO::MeshReaderOBJ Class Reference

Class for reading a Wavefront OBJ file. More...

#include <MeshReaderOBJ.h>

+ Inheritance diagram for agxIO::MeshReaderOBJ:

Public Member Functions

 MeshReaderOBJ ()
 Constructor. More...
 
size_t readFile (const agx::String &filename)
 OBSOLETE. More...
 
size_t readString (const agx::String &mesh)
 OBSOLETE. More...
 
- Public Member Functions inherited from agxIO::MeshReader
 MeshReader ()
 
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...
 
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...
 
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...
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor. More...
 
 Referenced (const Referenced &)
 
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
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object. 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...
 

Protected Member Functions

virtual ~MeshReaderOBJ ()
 
- Protected Member Functions inherited from agxIO::MeshReader
virtual ~MeshReader ()
 
void clear ()
 Reset all allocated memory. More...
 
size_t readShlStream (std::istream &stream)
 Read a specified stream containing a mesh description in SHL format. More...
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Additional Inherited Members

- Static Public Member Functions inherited from agxIO::MeshReader
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...
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- 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. More...
 
- Protected Attributes inherited from agxIO::MeshReader
agx::UInt32Vector m_indices
 
agx::Vec3Vector m_normals
 
agx::Vec2Vector m_texCoordinates
 
agx::Vec3Vector m_vertices
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 
- Static Protected Attributes inherited from agxIO::MeshReader
static agx::StringVector m_extensions
 

Detailed Description

Class for reading a Wavefront OBJ file.

Data is returned as vertices (getVertices()) and indices (getIndices())

Deprecated:
Use MeshReader for reading all types of mesh files

Definition at line 30 of file MeshReaderOBJ.h.

Constructor & Destructor Documentation

◆ MeshReaderOBJ()

agxIO::MeshReaderOBJ::MeshReaderOBJ ( )
inline

Constructor.

Definition at line 35 of file MeshReaderOBJ.h.

References agxIO::readFile(), and agxIO::MeshReader::readString().

◆ ~MeshReaderOBJ()

virtual agxIO::MeshReaderOBJ::~MeshReaderOBJ ( )
inlineprotectedvirtual

Definition at line 62 of file MeshReaderOBJ.h.

Member Function Documentation

◆ readFile()

size_t agxIO::MeshReaderOBJ::readFile ( const agx::String &  filename)
virtual

OBSOLETE.

USE MeshReader instead, for any type of mesh.

Read a file.

Parameters
filenameWavefront OBJ file containing triangles
Returns
number of found triangles.

Reimplemented from agxIO::MeshReader.

◆ readString()

size_t agxIO::MeshReaderOBJ::readString ( const agx::String &  mesh)

OBSOLETE.

USE MeshReader instead, for any type of mesh.

Read a file.

Parameters
mesh- Wavefront OBJ description as a string
Returns
number of found triangles.

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