Initiual commit: AssetImporter source moved from ZFXCE repository to its own repository. PLease do not use the ZFXCE repo any more.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
45
code/BaseImporter.cpp
Normal file
45
code/BaseImporter.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
/** @file Implementation of the few default functions of the base importer class */
|
||||
#include "BaseImporter.h"
|
||||
#include "../include/aiScene.h"
|
||||
#include "aiAssert.h"
|
||||
using namespace Assimp;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Constructor to be privately used by Importer
|
||||
BaseImporter::BaseImporter()
|
||||
{
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Destructor, private as well
|
||||
BaseImporter::~BaseImporter()
|
||||
{
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Imports the given file and returns the imported data.
|
||||
aiScene* BaseImporter::ReadFile( const std::string& pFile, IOSystem* pIOHandler)
|
||||
{
|
||||
// create a scene object to hold the data
|
||||
aiScene* scene = new aiScene;
|
||||
|
||||
// dispatch importing
|
||||
try
|
||||
{
|
||||
InternReadFile( pFile, scene, pIOHandler);
|
||||
} catch( ImportErrorException* exception)
|
||||
{
|
||||
// extract error description
|
||||
mErrorText = exception->GetErrorText();
|
||||
delete exception;
|
||||
|
||||
// and kill the partially imported data
|
||||
delete scene;
|
||||
scene = NULL;
|
||||
}
|
||||
|
||||
// return what we gathered from the import.
|
||||
return scene;
|
||||
}
|
||||
Reference in New Issue
Block a user