summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/assimp/code/ObjFileParser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/assimp/code/ObjFileParser.h')
-rw-r--r--src/3rdparty/assimp/code/ObjFileParser.h35
1 files changed, 21 insertions, 14 deletions
diff --git a/src/3rdparty/assimp/code/ObjFileParser.h b/src/3rdparty/assimp/code/ObjFileParser.h
index f1be764f0..fa5b3ca31 100644
--- a/src/3rdparty/assimp/code/ObjFileParser.h
+++ b/src/3rdparty/assimp/code/ObjFileParser.h
@@ -2,7 +2,8 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2016, assimp team
+Copyright (c) 2006-2017, assimp team
+
All rights reserved.
Redistribution and use of this software in source and binary forms,
@@ -46,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/vector2.h>
#include <assimp/vector3.h>
#include <assimp/mesh.h>
+#include "IOStreamBuffer.h"
namespace Assimp {
@@ -63,7 +65,7 @@ class ProgressHandler;
/// \class ObjFileParser
/// \brief Parser for a obj waveform file
-class ObjFileParser {
+class ASSIMP_API ObjFileParser {
public:
static const size_t Buffersize = 4096;
typedef std::vector<char> DataArray;
@@ -71,24 +73,32 @@ public:
typedef std::vector<char>::const_iterator ConstDataArrayIt;
public:
- /// \brief Constructor with data array.
- ObjFileParser(std::vector<char> &Data, const std::string &strModelName, IOSystem* io, ProgressHandler* progress, const std::string &originalObjFileName);
- /// \brief Destructor
+ /// @brief The default constructor.
+ ObjFileParser();
+ /// @brief Constructor with data array.
+ ObjFileParser( IOStreamBuffer<char> &streamBuffer, const std::string &modelName, IOSystem* io, ProgressHandler* progress, const std::string &originalObjFileName);
+ /// @brief Destructor
~ObjFileParser();
- /// \brief Model getter.
+ /// @brief If you want to load in-core data.
+ void setBuffer( std::vector<char> &buffer );
+ /// @brief Model getter.
ObjFile::Model *GetModel() const;
-private:
+protected:
/// Parse the loaded file
- void parseFile();
+ void parseFile( IOStreamBuffer<char> &streamBuffer );
/// 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);
+// void copyNextLine(char *pBuffer, size_t length);
+ /// Get the number of components in a line.
+ size_t getNumComponentsInDataDefinition();
/// 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 homogeneous vector as a 3D vector
+ void getHomogeneousVector3( std::vector<aiVector3D> &point3d_array );
/// Stores the following two 3d vectors on the line.
void getTwoVectors3( std::vector<aiVector3D> &point3d_array_a, std::vector<aiVector3D> &point3d_array_b );
/// Stores the following 3d vector.
@@ -121,8 +131,6 @@ private:
bool needsNewMesh( const std::string &rMaterialName );
/// Error report in token
void reportErrorTokenInFace();
- /// Get the number of components in a line.
- size_t getNumComponentsInLine();
private:
// Copy and assignment constructor should be private
@@ -146,9 +154,8 @@ private:
IOSystem *m_pIO;
//! Pointer to progress handler
ProgressHandler* m_progress;
- /// Path to the current model
- // name of the obj file where the buffer comes from
- const std::string& m_originalObjFileName;
+ /// Path to the current model, name of the obj file where the buffer comes from
+ const std::string m_originalObjFileName;
};
} // Namespace Assimp