Browse Source

- REFACTORING : Remove not used header from ObjFileParser.
- REFACTORING : Rename IO instance of ObjParser.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@509 67173fc5-114c-0410-ac8e-9d2fd5bffc1f

kimmi 15 years ago
parent
commit
a870710f56
2 changed files with 12 additions and 12 deletions
  1. 5 5
      code/ObjFileParser.cpp
  2. 7 7
      code/ObjFileParser.h

+ 5 - 5
code/ObjFileParser.cpp

@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "ObjTools.h"
 #include "ObjFileData.h"
 #include "fast_atof.h"
-
+#include "../include/aiTypes.h"
 #include "DefaultIOSystem.h"
 
 namespace Assimp	{
@@ -57,12 +57,12 @@ const std::string ObjFileParser::DEFAULT_MATERIAL = AI_DEFAULT_MATERIAL_NAME;
 
 // -------------------------------------------------------------------
 //	Constructor with loaded data and directories.
-ObjFileParser::ObjFileParser(std::vector<char> &Data,const std::string &strModelName, IOSystem* _io) :
+ObjFileParser::ObjFileParser(std::vector<char> &Data,const std::string &strModelName, IOSystem *io ) :
 	m_DataIt(Data.begin()),
 	m_DataItEnd(Data.end()),
 	m_pModel(NULL),
 	m_uiLine(0),
-	io(_io)
+	m_pIO( io )
 {
 	// Create the model instance to store all the data
 	m_pModel = new ObjFile::Model();
@@ -438,7 +438,7 @@ void ObjFileParser::getMaterialLib()
 
 	// Check for existence
 	const std::string strMatName(pStart, &(*m_DataIt));
-	IOStream *pFile = io->Open(strMatName);
+	IOStream *pFile = m_pIO->Open(strMatName);
 
 	if (!pFile )
 	{
@@ -450,7 +450,7 @@ void ObjFileParser::getMaterialLib()
 	// Import material library data from file
 	std::vector<char> buffer;
 	BaseImporter::TextFileToBuffer(pFile,buffer);
-	io->Close( pFile );
+	m_pIO->Close( pFile );
 
 	// Importing the material library 
 	ObjFileMtlImporter mtlImporter( buffer, strMatName, m_pModel );			

+ 7 - 7
code/ObjFileParser.h

@@ -45,7 +45,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <vector>
 #include <string>
 #include <map>
-#include "../include/aiTypes.h"
 
 namespace Assimp
 {
@@ -59,6 +58,7 @@ struct Point3;
 struct Point2;
 }
 class ObjFileImporter;
+class IOSystem;
 
 ///	\class	ObjFileParser
 ///	\brief	Parser for a obj waveform file
@@ -102,18 +102,18 @@ private:
 	void getGroupName();
 	/// Gets the group number from file.
 	void getGroupNumber();
-	///
+	/// 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);
 	///	Error report in token
 	void reportErrorTokenInFace();
 
 private:
 	///	Default material name
-	static const std::string DEFAULT_MATERIAL;/* = "defaultmaterial";*/
+	static const std::string DEFAULT_MATERIAL;
 	//!	Iterator to current position in buffer
 	DataArrayIt m_DataIt;
 	//!	Iterator to end position of buffer
@@ -124,8 +124,8 @@ private:
 	unsigned int m_uiLine;
 	//!	Helper buffer
 	char m_buffer[BUFFERSIZE];
-
-	IOSystem* io;
+	///	Pointer to IO system instance.
+	IOSystem *m_pIO;
 };
 
 }	// Namespace Assimp