- untabify obj parser.

- bugfix openddl: latest version

Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>
This commit is contained in:
Kim Kulling
2015-02-10 19:31:23 +01:00
parent 124f408976
commit c3e2fa0761
4 changed files with 582 additions and 580 deletions

View File

@@ -63,76 +63,76 @@ class IOSystem;
class ObjFileParser
{
public:
static const size_t BUFFERSIZE = 4096;
typedef std::vector<char> DataArray;
typedef std::vector<char>::iterator DataArrayIt;
typedef std::vector<char>::const_iterator ConstDataArrayIt;
static const size_t BUFFERSIZE = 4096;
typedef std::vector<char> DataArray;
typedef std::vector<char>::iterator DataArrayIt;
typedef std::vector<char>::const_iterator ConstDataArrayIt;
public:
/// \brief Constructor with data array.
ObjFileParser(std::vector<char> &Data,const std::string &strModelName, IOSystem* io);
/// \brief Destructor
~ObjFileParser();
/// \brief Model getter.
ObjFile::Model *GetModel() const;
/// \brief Constructor with data array.
ObjFileParser(std::vector<char> &Data,const std::string &strModelName, IOSystem* io);
/// \brief Destructor
~ObjFileParser();
/// \brief Model getter.
ObjFile::Model *GetModel() const;
private:
/// Parse the loaded file
void parseFile();
/// Method to copy the new delimited word in the current line.
void copyNextWord(char *pBuffer, size_t length);
/// Method to copy the new line.
void copyNextLine(char *pBuffer, size_t length);
/// Parse the loaded file
void parseFile();
/// Method to copy the new delimited word in the current line.
void copyNextWord(char *pBuffer, size_t length);
/// Method to copy the new line.
void copyNextLine(char *pBuffer, size_t length);
/// Stores the vector
void getVector( std::vector<aiVector3D> &point3d_array );
/// Stores the following 3d vector.
void getVector3( std::vector<aiVector3D> &point3d_array );
/// Stores the following 3d vector.
void getVector2(std::vector<aiVector2D> &point2d_array);
void getVector3( std::vector<aiVector3D> &point3d_array );
/// Stores the following 3d vector.
void getVector2(std::vector<aiVector2D> &point2d_array);
/// Stores the following face.
void getFace(aiPrimitiveType type);
/// Reads the material description.
void getFace(aiPrimitiveType type);
/// Reads the material description.
void getMaterialDesc();
/// Gets a comment.
void getComment();
/// Gets a a material library.
void getMaterialLib();
/// Creates a new material.
void getNewMaterial();
/// Gets the group name from file.
void getGroupName();
/// Gets the group number from file.
void getGroupNumber();
/// Gets the group number and resolution from file.
void getGroupNumberAndResolution();
/// Returns the index of the material. Is -1 if not material was found.
int getMaterialIndex( const std::string &strMaterialName );
/// Parse object name
void getObjectName();
/// Creates a new object.
void createObject(const std::string &strObjectName);
/// Creates a new mesh.
void createMesh();
/// Returns true, if a new mesh instance must be created.
bool needsNewMesh( const std::string &rMaterialName );
/// Error report in token
void reportErrorTokenInFace();
/// Gets a comment.
void getComment();
/// Gets a a material library.
void getMaterialLib();
/// Creates a new material.
void getNewMaterial();
/// Gets the group name from file.
void getGroupName();
/// Gets the group number from file.
void getGroupNumber();
/// Gets the group number and resolution from file.
void getGroupNumberAndResolution();
/// Returns the index of the material. Is -1 if not material was found.
int getMaterialIndex( const std::string &strMaterialName );
/// Parse object name
void getObjectName();
/// Creates a new object.
void createObject(const std::string &strObjectName);
/// Creates a new mesh.
void createMesh();
/// Returns true, if a new mesh instance must be created.
bool needsNewMesh( const std::string &rMaterialName );
/// Error report in token
void reportErrorTokenInFace();
private:
/// Default material name
static const std::string DEFAULT_MATERIAL;
//! Iterator to current position in buffer
DataArrayIt m_DataIt;
//! Iterator to end position of buffer
DataArrayIt m_DataItEnd;
//! Pointer to model instance
ObjFile::Model *m_pModel;
//! Current line (for debugging)
unsigned int m_uiLine;
//! Helper buffer
char m_buffer[BUFFERSIZE];
/// Pointer to IO system instance.
IOSystem *m_pIO;
/// Default material name
static const std::string DEFAULT_MATERIAL;
//! Iterator to current position in buffer
DataArrayIt m_DataIt;
//! Iterator to end position of buffer
DataArrayIt m_DataItEnd;
//! Pointer to model instance
ObjFile::Model *m_pModel;
//! Current line (for debugging)
unsigned int m_uiLine;
//! Helper buffer
char m_buffer[BUFFERSIZE];
/// Pointer to IO system instance.
IOSystem *m_pIO;
};
} // Namespace Assimp