Assimp  v4.1. (December 2018)
Assimp::ObjFileParser Class Reference

Parser for a obj waveform file. More...

Public Types

typedef std::vector< char >::const_iterator ConstDataArrayIt
 
typedef std::vector< char > DataArray
 
typedef std::vector< char >::iterator DataArrayIt
 

Public Member Functions

ObjFile::ModelGetModel () const
 Model getter. More...
 
 ObjFileParser ()
 The default constructor. More...
 
 ObjFileParser (IOStreamBuffer< char > &streamBuffer, const std::string &modelName, IOSystem *io, ProgressHandler *progress, const std::string &originalObjFileName)
 Constructor with data array. More...
 
void setBuffer (std::vector< char > &buffer)
 If you want to load in-core data. More...
 
 ~ObjFileParser ()
 Destructor. More...
 

Static Public Attributes

static const size_t Buffersize = 4096
 

Protected Member Functions

void copyNextWord (char *pBuffer, size_t length)
 Method to copy the new delimited word in the current line. More...
 
void createMesh (const std::string &meshName)
 Creates a new mesh. More...
 
void createObject (const std::string &strObjectName)
 Creates a new object. More...
 
void getComment ()
 Gets a comment. More...
 
void getFace (aiPrimitiveType type)
 Stores the following face. More...
 
void getGroupName ()
 Gets the group name from file. More...
 
void getGroupNumber ()
 Gets the group number from file. More...
 
void getGroupNumberAndResolution ()
 Gets the group number and resolution from file. More...
 
void getHomogeneousVector3 (std::vector< aiVector3D > &point3d_array)
 Stores the following homogeneous vector as a 3D vector. More...
 
void getMaterialDesc ()
 Reads the material description. More...
 
int getMaterialIndex (const std::string &strMaterialName)
 Returns the index of the material. Is -1 if not material was found. More...
 
void getMaterialLib ()
 Gets a a material library. More...
 
void getNewMaterial ()
 Creates a new material. More...
 
size_t getNumComponentsInDataDefinition ()
 Method to copy the new line. More...
 
void getObjectName ()
 Parse object name. More...
 
size_t getTexCoordVector (std::vector< aiVector3D > &point3d_array)
 Stores the vector. More...
 
void getTwoVectors3 (std::vector< aiVector3D > &point3d_array_a, std::vector< aiVector3D > &point3d_array_b)
 Stores the following two 3d vectors on the line. More...
 
void getVector2 (std::vector< aiVector2D > &point2d_array)
 Stores the following 3d vector. More...
 
void getVector3 (std::vector< aiVector3D > &point3d_array)
 Stores the following 3d vector. More...
 
bool needsNewMesh (const std::string &rMaterialName)
 Returns true, if a new mesh instance must be created. More...
 
void parseFile (IOStreamBuffer< char > &streamBuffer)
 Parse the loaded file. More...
 
void reportErrorTokenInFace ()
 Error report in token. More...
 

Detailed Description

Parser for a obj waveform file.

Member Typedef Documentation

◆ ConstDataArrayIt

typedef std::vector<char>::const_iterator Assimp::ObjFileParser::ConstDataArrayIt

◆ DataArray

typedef std::vector<char> Assimp::ObjFileParser::DataArray

◆ DataArrayIt

typedef std::vector<char>::iterator Assimp::ObjFileParser::DataArrayIt

Constructor & Destructor Documentation

◆ ObjFileParser() [1/2]

ObjFileParser::ObjFileParser ( )

The default constructor.

◆ ObjFileParser() [2/2]

ObjFileParser::ObjFileParser ( IOStreamBuffer< char > &  streamBuffer,
const std::string &  modelName,
IOSystem io,
ProgressHandler progress,
const std::string &  originalObjFileName 
)

Constructor with data array.

◆ ~ObjFileParser()

ObjFileParser::~ObjFileParser ( )

Destructor.

Member Function Documentation

◆ copyNextWord()

void ObjFileParser::copyNextWord ( char *  pBuffer,
size_t  length 
)
protected

Method to copy the new delimited word in the current line.

◆ createMesh()

void ObjFileParser::createMesh ( const std::string &  meshName)
protected

Creates a new mesh.

◆ createObject()

void ObjFileParser::createObject ( const std::string &  strObjectName)
protected

Creates a new object.

◆ getComment()

void ObjFileParser::getComment ( )
protected

Gets a comment.

◆ getFace()

void ObjFileParser::getFace ( aiPrimitiveType  type)
protected

Stores the following face.

◆ getGroupName()

void ObjFileParser::getGroupName ( )
protected

Gets the group name from file.

◆ getGroupNumber()

void ObjFileParser::getGroupNumber ( )
protected

Gets the group number from file.

◆ getGroupNumberAndResolution()

void ObjFileParser::getGroupNumberAndResolution ( )
protected

Gets the group number and resolution from file.

◆ getHomogeneousVector3()

void ObjFileParser::getHomogeneousVector3 ( std::vector< aiVector3D > &  point3d_array)
protected

Stores the following homogeneous vector as a 3D vector.

◆ getMaterialDesc()

void ObjFileParser::getMaterialDesc ( )
protected

Reads the material description.

◆ getMaterialIndex()

int ObjFileParser::getMaterialIndex ( const std::string &  strMaterialName)
protected

Returns the index of the material. Is -1 if not material was found.

◆ getMaterialLib()

void ObjFileParser::getMaterialLib ( )
protected

Gets a a material library.

◆ GetModel()

ObjFile::Model * ObjFileParser::GetModel ( ) const

Model getter.

◆ getNewMaterial()

void ObjFileParser::getNewMaterial ( )
protected

Creates a new material.

◆ getNumComponentsInDataDefinition()

size_t ObjFileParser::getNumComponentsInDataDefinition ( )
protected

Method to copy the new line.

Get the number of components in a line.

◆ getObjectName()

void ObjFileParser::getObjectName ( )
protected

Parse object name.

◆ getTexCoordVector()

size_t ObjFileParser::getTexCoordVector ( std::vector< aiVector3D > &  point3d_array)
protected

Stores the vector.

◆ getTwoVectors3()

void ObjFileParser::getTwoVectors3 ( std::vector< aiVector3D > &  point3d_array_a,
std::vector< aiVector3D > &  point3d_array_b 
)
protected

Stores the following two 3d vectors on the line.

◆ getVector2()

void ObjFileParser::getVector2 ( std::vector< aiVector2D > &  point2d_array)
protected

Stores the following 3d vector.

◆ getVector3()

void ObjFileParser::getVector3 ( std::vector< aiVector3D > &  point3d_array)
protected

Stores the following 3d vector.

◆ needsNewMesh()

bool ObjFileParser::needsNewMesh ( const std::string &  rMaterialName)
protected

Returns true, if a new mesh instance must be created.

◆ parseFile()

void ObjFileParser::parseFile ( IOStreamBuffer< char > &  streamBuffer)
protected

Parse the loaded file.

◆ reportErrorTokenInFace()

void ObjFileParser::reportErrorTokenInFace ( )
protected

Error report in token.

◆ setBuffer()

void ObjFileParser::setBuffer ( std::vector< char > &  buffer)

If you want to load in-core data.

Member Data Documentation

◆ Buffersize

const size_t Assimp::ObjFileParser::Buffersize = 4096
static

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