- add mFileExtensions field to aiImporterDesc, BaseImporter::GetExtensionList is now longer virtual since this would be redundant.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1234 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/5/head
parent
93c3723da5
commit
5a81b42ebe
|
@ -53,6 +53,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Discreet 3DS Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"Limited animation support",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"3ds prj"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Begins a new parsing block
|
// Begins a new parsing block
|
||||||
// - Reads the current chunk and validates it
|
// - Reads the current chunk and validates it
|
||||||
|
@ -108,11 +122,10 @@ bool Discreet3DSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandle
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get list of all extension supported by this loader
|
// Loader registry entry
|
||||||
void Discreet3DSImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* Discreet3DSImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("3ds");
|
return &desc;
|
||||||
extensions.insert("prj");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -85,10 +85,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -54,6 +54,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"AC3D Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ac acc ac3d"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// skip to the next token
|
// skip to the next token
|
||||||
|
@ -136,12 +148,10 @@ bool AC3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get list of file extensions handled by this loader
|
// Loader meta information
|
||||||
void AC3DImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* AC3DImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ac");
|
return &desc;
|
||||||
extensions.insert("acc");
|
|
||||||
extensions.insert("ac3d");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -183,9 +183,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details */
|
* See #BaseImporter::GetInfo for the details */
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -58,6 +58,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::ASE;
|
using namespace Assimp::ASE;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"ASE Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"Similar to 3DS but text-encoded",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ase ask"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
ASEImporter::ASEImporter()
|
ASEImporter::ASEImporter()
|
||||||
|
@ -86,10 +99,10 @@ bool ASEImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void ASEImporter::GetExtensionList(std::set<std::string>& extensions)
|
// Loader meta information
|
||||||
|
const aiImporterDesc* ASEImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ase");
|
return &desc;
|
||||||
extensions.insert("ask");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -75,10 +75,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -54,6 +54,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"BlitzBasic 3D Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.blitzbasic.com/",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"b3d"
|
||||||
|
};
|
||||||
|
|
||||||
// (fixme, Aramis) quick workaround to get rid of all those signed to unsigned warnings
|
// (fixme, Aramis) quick workaround to get rid of all those signed to unsigned warnings
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
# pragma warning (disable: 4018)
|
# pragma warning (disable: 4018)
|
||||||
|
@ -74,8 +87,10 @@ bool B3DImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void B3DImporter::GetExtensionList( std::set<std::string>& extensions ){
|
// Loader meta information
|
||||||
extensions.insert("b3d");
|
const aiImporterDesc* B3DImporter::GetInfo () const
|
||||||
|
{
|
||||||
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_B3D
|
#ifdef DEBUG_B3D
|
||||||
|
|
|
@ -60,7 +60,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void GetExtensionList(std::set<std::string>& extensions);
|
virtual const aiImporterDesc* GetInfo () const;
|
||||||
virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -49,6 +49,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"BVH Importer (MoCap)",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"bvh"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
BVHLoader::BVHLoader()
|
BVHLoader::BVHLoader()
|
||||||
|
@ -76,6 +89,13 @@ bool BVHLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Loader meta information
|
||||||
|
const aiImporterDesc* BVHLoader::GetInfo () const
|
||||||
|
{
|
||||||
|
return &desc;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Imports the given file into the given scene structure.
|
// Imports the given file into the given scene structure.
|
||||||
void BVHLoader::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
|
void BVHLoader::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
|
||||||
|
|
|
@ -94,14 +94,10 @@ public:
|
||||||
* See BaseImporter::CanRead() for details. */
|
* See BaseImporter::CanRead() for details. */
|
||||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const;
|
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const;
|
||||||
|
|
||||||
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
|
||||||
* See BaseImporter::GetExtensionList() for details
|
|
||||||
*/
|
|
||||||
void GetExtensionList(std::set<std::string>& extensions)
|
|
||||||
{
|
|
||||||
extensions.insert("bvh");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
* See BaseImporter::InternReadFile() for details
|
* See BaseImporter::InternReadFile() for details
|
||||||
|
|
|
@ -105,6 +105,25 @@ void BaseImporter::SetupProperties(const Importer* /*pImp*/)
|
||||||
// the default implementation does nothing
|
// the default implementation does nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
|
||||||
|
{
|
||||||
|
const aiImporterDesc* desc = GetInfo();
|
||||||
|
ai_assert(desc != NULL);
|
||||||
|
|
||||||
|
const char* ext = desc->mFileExtensions;
|
||||||
|
ai_assert(ext != NULL);
|
||||||
|
|
||||||
|
const char* last = ext;
|
||||||
|
do {
|
||||||
|
if (!*ext || *ext == ' ') {
|
||||||
|
extensions.insert(std::string(last,ext-last));
|
||||||
|
last = ext+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while(*ext++);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
/*static*/ bool BaseImporter::SearchFileHeaderForToken(IOSystem* pIOHandler,
|
/*static*/ bool BaseImporter::SearchFileHeaderForToken(IOSystem* pIOHandler,
|
||||||
const std::string& pFile,
|
const std::string& pFile,
|
||||||
|
|
|
@ -187,26 +187,22 @@ public:
|
||||||
const Importer* pImp
|
const Importer* pImp
|
||||||
);
|
);
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by #Importer::GetImporterInfo to get a description of
|
/** Called by #Importer::GetImporterInfo to get a description of
|
||||||
* some loader features. Importer need not provide this structure,
|
* some loader features. Importers must provide this information. */
|
||||||
* but it is highly recommended. */
|
virtual const aiImporterDesc* GetInfo() const = 0;
|
||||||
virtual const aiImporterDesc* GetInfo() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by #Importer::GetExtensionList for each loaded importer.
|
/** Called by #Importer::GetExtensionList for each loaded importer.
|
||||||
* Implementations are expected to insert() all file extensions
|
* Take the extension list contained in the structure returned by
|
||||||
* handled by them into the extension set. A loader capable of
|
* #GetInfo and insert all file extensions into the given set.
|
||||||
* reading certain files with the extension BLA would place the
|
* @param extension set to collect file extensions in*/
|
||||||
* string bla (lower-case!) in the output set.
|
void GetExtensionList(std::set<std::string>& extensions);
|
||||||
* @param extensions Output set. */
|
|
||||||
virtual void GetExtensionList(
|
protected:
|
||||||
std::set<std::string>& extensions
|
|
||||||
) = 0;
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure. The
|
/** Imports the given file into the given scene structure. The
|
||||||
|
|
|
@ -75,12 +75,13 @@ static const aiImporterDesc blenderDesc = {
|
||||||
"Blender 3D Importer \nhttp://www.blender3d.org",
|
"Blender 3D Importer \nhttp://www.blender3d.org",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"No animation support yet",
|
||||||
aiImporterFlags_SupportBinaryFlavour,
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
2,
|
2,
|
||||||
50
|
50,
|
||||||
|
"blend"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,20 @@ static const float units[] = {
|
||||||
1.f/1609.344f
|
1.f/1609.344f
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"TrueSpace Object Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"little-endian files only",
|
||||||
|
aiImporterFlags_SupportTextFlavour | aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"cob scn"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
COBImporter::COBImporter()
|
COBImporter::COBImporter()
|
||||||
|
@ -99,11 +113,10 @@ bool COBImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// List all extensions handled by this loader
|
// Loader meta information
|
||||||
void COBImporter::GetExtensionList(std::set<std::string>& app)
|
const aiImporterDesc* COBImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
app.insert("cob");
|
return &desc;
|
||||||
app.insert("scn");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -82,7 +82,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void GetExtensionList(std::set<std::string>& app);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void SetupProperties(const Importer* pImp);
|
void SetupProperties(const Importer* pImp);
|
||||||
|
|
|
@ -54,6 +54,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"CharacterStudio Motion Importer (MoCap)",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"csm"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
CSMImporter::CSMImporter()
|
CSMImporter::CSMImporter()
|
||||||
|
@ -83,9 +97,9 @@ bool CSMImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Build a string of all file extensions supported
|
// Build a string of all file extensions supported
|
||||||
void CSMImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* CSMImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("csm");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -69,7 +69,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void SetupProperties(const Importer* pImp);
|
void SetupProperties(const Importer* pImp);
|
||||||
|
|
|
@ -56,6 +56,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Collada Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://collada.org",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
5,
|
||||||
|
"dae"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
ColladaLoader::ColladaLoader()
|
ColladaLoader::ColladaLoader()
|
||||||
|
@ -91,9 +105,9 @@ bool ColladaLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler, boo
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get file extension list
|
// Get file extension list
|
||||||
void ColladaLoader::GetExtensionList( std::set<std::string>& extensions )
|
const aiImporterDesc* ColladaLoader::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("dae");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -89,10 +89,10 @@ public:
|
||||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
|
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList( std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
* See BaseImporter::InternReadFile() for details
|
* See BaseImporter::InternReadFile() for details
|
||||||
|
|
|
@ -86,6 +86,20 @@ static aiColor4D g_aclrDxfIndexColors[] =
|
||||||
#define AI_DXF_NUM_INDEX_COLORS (sizeof(g_aclrDxfIndexColors)/sizeof(g_aclrDxfIndexColors[0]))
|
#define AI_DXF_NUM_INDEX_COLORS (sizeof(g_aclrDxfIndexColors)/sizeof(g_aclrDxfIndexColors[0]))
|
||||||
#define AI_DXF_ENTITIES_MAGIC_BLOCK "$ASSIMP_ENTITIES_MAGIC"
|
#define AI_DXF_ENTITIES_MAGIC_BLOCK "$ASSIMP_ENTITIES_MAGIC"
|
||||||
|
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Drawing Interchange Format (DXF) Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour | aiImporterFlags_LimitedSupport,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"dxf"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
DXFImporter::DXFImporter()
|
DXFImporter::DXFImporter()
|
||||||
|
@ -105,9 +119,9 @@ bool DXFImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all supported file extensions
|
// Get a list of all supported file extensions
|
||||||
void DXFImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* DXFImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("dxf");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -82,9 +82,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details*/
|
* See #BaseImporter::GetInfo for the details*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -50,6 +50,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"3D GameStudio Heightmap (HMP) Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"hmp"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
HMPImporter::HMPImporter()
|
HMPImporter::HMPImporter()
|
||||||
|
@ -85,9 +98,9 @@ bool HMPImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get list of all file extensions that are handled by this loader
|
// Get list of all file extensions that are handled by this loader
|
||||||
void HMPImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* HMPImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("hmp");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -80,10 +80,10 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -93,6 +93,20 @@ void ConvertUnit(const EXPRESS::DataType& dt,ConversionData& conv);
|
||||||
|
|
||||||
} // anon
|
} // anon
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Industry Foundation Classes (IFC) Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ifc"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
IFCImporter::IFCImporter()
|
IFCImporter::IFCImporter()
|
||||||
|
@ -125,9 +139,9 @@ bool IFCImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// List all extensions handled by this loader
|
// List all extensions handled by this loader
|
||||||
void IFCImporter::GetExtensionList(std::set<std::string>& app)
|
const aiImporterDesc* IFCImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
app.insert("ifc");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void GetExtensionList(std::set<std::string>& app);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void SetupProperties(const Importer* pImp);
|
void SetupProperties(const Importer* pImp);
|
||||||
|
|
|
@ -61,6 +61,18 @@ using namespace Assimp;
|
||||||
using namespace irr;
|
using namespace irr;
|
||||||
using namespace irr::io;
|
using namespace irr::io;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Irrlicht Scene Reader",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://irrlicht.sourceforge.net/",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"irr xml"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
|
@ -98,10 +110,9 @@ bool IRRImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void IRRImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* IRRImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("irr");
|
return &desc;
|
||||||
extensions.insert("xml");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -80,7 +80,7 @@ protected:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -51,6 +51,19 @@ using namespace Assimp;
|
||||||
using namespace irr;
|
using namespace irr;
|
||||||
using namespace irr::io;
|
using namespace irr::io;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Irrlicht Mesh Reader",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://irrlicht.sourceforge.net/",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"xml irrmesh"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
IRRMeshImporter::IRRMeshImporter()
|
IRRMeshImporter::IRRMeshImporter()
|
||||||
|
@ -88,10 +101,9 @@ bool IRRMeshImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, b
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all file extensions which are handled by this class
|
// Get a list of all file extensions which are handled by this class
|
||||||
void IRRMeshImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* IRRMeshImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("xml");
|
return &desc;
|
||||||
extensions.insert("irrmesh");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -76,10 +76,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -56,6 +56,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"LightWave/Modo Object Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.newtek.com/lightwave.html\nhttp://www.luxology.com/modo/",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"lwo lxo"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
LWOImporter::LWOImporter()
|
LWOImporter::LWOImporter()
|
||||||
|
@ -71,8 +84,9 @@ LWOImporter::~LWOImporter()
|
||||||
bool LWOImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
|
bool LWOImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
|
||||||
{
|
{
|
||||||
const std::string extension = GetExtension(pFile);
|
const std::string extension = GetExtension(pFile);
|
||||||
if (extension == "lwo" || extension == "lxo")
|
if (extension == "lwo" || extension == "lxo") {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// if check for extension is not enough, check for the magic tokens
|
// if check for extension is not enough, check for the magic tokens
|
||||||
if (!extension.length() || checkSig) {
|
if (!extension.length() || checkSig) {
|
||||||
|
@ -94,6 +108,13 @@ void LWOImporter::SetupProperties(const Importer* pImp)
|
||||||
configLayerName = pImp->GetPropertyString (AI_CONFIG_IMPORT_LWO_ONE_LAYER_ONLY,"");
|
configLayerName = pImp->GetPropertyString (AI_CONFIG_IMPORT_LWO_ONE_LAYER_ONLY,"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Get list of file extensions
|
||||||
|
const aiImporterDesc* LWOImporter::GetInfo () const
|
||||||
|
{
|
||||||
|
return &desc;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Imports the given file into the given scene structure.
|
// Imports the given file into the given scene structure.
|
||||||
void LWOImporter::InternReadFile( const std::string& pFile,
|
void LWOImporter::InternReadFile( const std::string& pFile,
|
||||||
|
|
|
@ -91,14 +91,8 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
// Get list of supported extensions
|
||||||
* See BaseImporter::GetExtensionList() for details
|
const aiImporterDesc* GetInfo () const;
|
||||||
*/
|
|
||||||
void GetExtensionList(std::set<std::string>& extensions)
|
|
||||||
{
|
|
||||||
extensions.insert("lxo");
|
|
||||||
extensions.insert("lwo");
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -57,6 +57,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"LightWave Scene Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.newtek.com/lightwave.html=",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"lws mot"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Recursive parsing of LWS files
|
// Recursive parsing of LWS files
|
||||||
void LWS::Element::Parse (const char*& buffer)
|
void LWS::Element::Parse (const char*& buffer)
|
||||||
|
@ -141,10 +154,9 @@ bool LWSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler,bool c
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get list of file extensions
|
// Get list of file extensions
|
||||||
void LWSImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* LWSImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("lws");
|
return &desc;
|
||||||
extensions.insert("mot");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -184,7 +184,7 @@ protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Get list of supported extensions
|
// Get list of supported extensions
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Import file into given scene data structure
|
// Import file into given scene data structure
|
||||||
|
|
|
@ -47,7 +47,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace M3 {
|
namespace M3 {
|
||||||
|
|
||||||
static const std::string M3Extension = "m3";
|
static const aiImporterDesc desc = {
|
||||||
|
"StarCraft M3 Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"m3"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor.
|
// Constructor.
|
||||||
|
@ -72,16 +83,16 @@ M3Importer::~M3Importer()
|
||||||
bool M3Importer::CanRead( const std::string &rFile, IOSystem* /*pIOHandler*/, bool checkSig ) const
|
bool M3Importer::CanRead( const std::string &rFile, IOSystem* /*pIOHandler*/, bool checkSig ) const
|
||||||
{
|
{
|
||||||
if ( !checkSig ) {
|
if ( !checkSig ) {
|
||||||
return SimpleExtensionCheck( rFile, M3Extension.c_str() );
|
return SimpleExtensionCheck( rFile, "m3" );
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void M3Importer::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* M3Importer::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert( M3Extension );
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -694,7 +694,7 @@ public:
|
||||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig ) const;
|
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void GetExtensionList( std::set<std::string>& extensions );
|
const aiImporterDesc* GetInfo () const;
|
||||||
void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler );
|
void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler );
|
||||||
void convertToAssimp( const std::string& pFile, aiScene* pScene, DIV *pViews, Region *pRegions, uint16 *pFaces,
|
void convertToAssimp( const std::string& pFile, aiScene* pScene, DIV *pViews, Region *pRegions, uint16 *pFaces,
|
||||||
const std::vector<aiVector3D> &vertices, const std::vector<aiVector3D> &uvCoords, const std::vector<aiVector3D> &normals );
|
const std::vector<aiVector3D> &vertices, const std::vector<aiVector3D> &uvCoords, const std::vector<aiVector3D> &normals );
|
||||||
|
|
|
@ -56,6 +56,19 @@ using namespace Assimp::MD2;
|
||||||
# define ARRAYSIZE(_array) (int(sizeof(_array) / sizeof(_array[0])))
|
# define ARRAYSIZE(_array) (int(sizeof(_array) / sizeof(_array[0])))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Quake II Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"md2"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Helper function to lookup a normal in Quake 2's precalculated table
|
// Helper function to lookup a normal in Quake 2's precalculated table
|
||||||
void MD2::LookupNormalIndex(uint8_t iNormalIndex,aiVector3D& vOut)
|
void MD2::LookupNormalIndex(uint8_t iNormalIndex,aiVector3D& vOut)
|
||||||
|
@ -98,9 +111,9 @@ bool MD2Importer::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all extensions supported by this loader
|
// Get a list of all extensions supported by this loader
|
||||||
void MD2Importer::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MD2Importer::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("md2");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -84,10 +84,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -61,6 +61,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Quake III Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"md3"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Convert a Q3 shader blend function to the appropriate enum value
|
// Convert a Q3 shader blend function to the appropriate enum value
|
||||||
Q3Shader::BlendFunc StringToBlendFunc(const std::string& m)
|
Q3Shader::BlendFunc StringToBlendFunc(const std::string& m)
|
||||||
|
@ -420,9 +433,9 @@ void MD3Importer::ValidateSurfaceHeaderOffsets(const MD3::Surface* pcSurf)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void MD3Importer::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MD3Importer::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("md3");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -235,10 +235,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -58,6 +58,20 @@ using namespace Assimp;
|
||||||
// Minimum weight value. Weights inside [-n ... n] are ignored
|
// Minimum weight value. Weights inside [-n ... n] are ignored
|
||||||
#define AI_MD5_WEIGHT_EPSILON 1e-5f
|
#define AI_MD5_WEIGHT_EPSILON 1e-5f
|
||||||
|
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Doom 3 / MD5 Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"md5mesh md5camera md5anim"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
MD5Importer::MD5Importer()
|
MD5Importer::MD5Importer()
|
||||||
|
@ -90,11 +104,9 @@ bool MD5Importer::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get list of all supported extensions
|
// Get list of all supported extensions
|
||||||
void MD5Importer::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MD5Importer::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("md5anim");
|
return &desc;
|
||||||
extensions.insert("md5mesh");
|
|
||||||
extensions.insert("md5camera");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -78,10 +78,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called prior to ReadFile().
|
/** Called prior to ReadFile().
|
||||||
|
|
|
@ -52,6 +52,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::MDC;
|
using namespace Assimp::MDC;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Return To Castle Wolfenstein Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"mdc"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void MDC::BuildVertex(const Frame& frame,
|
void MDC::BuildVertex(const Frame& frame,
|
||||||
|
@ -103,9 +115,9 @@ bool MDCImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void MDCImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MDCImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("mdc");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -81,10 +81,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -54,6 +54,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Quake Mesh / 3D GameStudio Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
7,
|
||||||
|
0,
|
||||||
|
"mdl"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Ugly stuff ... nevermind
|
// Ugly stuff ... nevermind
|
||||||
#define _AI_MDL7_ACCESS(_data, _index, _limit, _type) \
|
#define _AI_MDL7_ACCESS(_data, _index, _limit, _type) \
|
||||||
|
@ -116,9 +129,9 @@ void MDLImporter::SetupProperties(const Importer* pImp)
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all supported extensions
|
// Get a list of all supported extensions
|
||||||
void MDLImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MDLImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert( "mdl" );
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -107,10 +107,10 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -52,6 +52,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "StreamReader.h"
|
#include "StreamReader.h"
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Milkshape 3D Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://chumbalum.swissquake.ch/",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ms3d"
|
||||||
|
};
|
||||||
|
|
||||||
// ASSIMP_BUILD_MS3D_ONE_NODE_PER_MESH
|
// ASSIMP_BUILD_MS3D_ONE_NODE_PER_MESH
|
||||||
// (enable old code path, which generates extra nodes per mesh while
|
// (enable old code path, which generates extra nodes per mesh while
|
||||||
// the newer code uses aiMesh::mName to express the name of the
|
// the newer code uses aiMesh::mName to express the name of the
|
||||||
|
@ -89,9 +102,9 @@ bool MS3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void MS3DImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MS3DImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ms3d");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -70,9 +70,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details */
|
* See #BaseImporter::GetInfo for the details */
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -50,6 +50,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
#define for_each BOOST_FOREACH
|
#define for_each BOOST_FOREACH
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Nendo Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.izware.com/nendo/index.htm",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ndo"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
NDOImporter::NDOImporter()
|
NDOImporter::NDOImporter()
|
||||||
|
@ -79,9 +92,9 @@ bool NDOImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Build a string of all file extensions supported
|
// Build a string of all file extensions supported
|
||||||
void NDOImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* NDOImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ndo");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void SetupProperties(const Importer* pImp);
|
void SetupProperties(const Importer* pImp);
|
||||||
|
|
|
@ -53,6 +53,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Neutral File Format Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"enff nff"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
NFFImporter::NFFImporter()
|
NFFImporter::NFFImporter()
|
||||||
|
@ -72,10 +85,9 @@ bool NFFImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get the list of all supported file extensions
|
// Get the list of all supported file extensions
|
||||||
void NFFImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* NFFImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("enff");
|
return &desc;
|
||||||
extensions.insert("nff");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -77,10 +77,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -54,6 +54,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"OFF Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"off"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
OFFImporter::OFFImporter()
|
OFFImporter::OFFImporter()
|
||||||
|
@ -82,9 +95,9 @@ bool OFFImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void OFFImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* OFFImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("off");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -71,10 +71,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -47,6 +47,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "ObjFileParser.h"
|
#include "ObjFileParser.h"
|
||||||
#include "ObjFileData.h"
|
#include "ObjFileData.h"
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Wavefront Object Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"surfaces not supported",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"obj"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -89,6 +103,12 @@ bool ObjFileImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler ,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
const aiImporterDesc* ObjFileImporter::GetInfo () const
|
||||||
|
{
|
||||||
|
return &desc;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Obj-file import implementation
|
// Obj-file import implementation
|
||||||
void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
|
void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
|
||||||
|
|
|
@ -78,7 +78,7 @@ public:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
//! \brief Appends the supported extention.
|
//! \brief Appends the supported extention.
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
//! \brief File import implementation.
|
//! \brief File import implementation.
|
||||||
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
||||||
|
@ -119,13 +119,6 @@ private:
|
||||||
std::string m_strAbsPath;
|
std::string m_strAbsPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
inline void ObjFileImporter::GetExtensionList(std::set<std::string>& extensions)
|
|
||||||
{
|
|
||||||
extensions.insert("obj");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
} // Namespace Assimp
|
} // Namespace Assimp
|
||||||
|
|
|
@ -52,6 +52,19 @@ using namespace std;
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
#include "irrXMLWrapper.h"
|
#include "irrXMLWrapper.h"
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Ogre XML Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"mesh.xml"
|
||||||
|
};
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
namespace Ogre
|
namespace Ogre
|
||||||
|
@ -222,9 +235,9 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void OgreImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* OgreImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("mesh.xml");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ class OgreImporter : public BaseImporter
|
||||||
public:
|
public:
|
||||||
virtual bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
|
virtual bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
|
||||||
virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
||||||
virtual void GetExtensionList(std::set<std::string>& extensions);
|
virtual const aiImporterDesc* GetInfo () const;
|
||||||
virtual void SetupProperties(const Importer* pImp);
|
virtual void SetupProperties(const Importer* pImp);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Stanford Polygon Library (PLY) Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour | aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ply"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
PLYImporter::PLYImporter()
|
PLYImporter::PLYImporter()
|
||||||
|
@ -79,9 +92,9 @@ bool PLYImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void PLYImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* PLYImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ply");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -78,10 +78,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -57,13 +57,25 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "../include/assimp/mesh.h"
|
#include "../include/assimp/mesh.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Quake III BSP Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"pk3"
|
||||||
|
};
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
|
|
||||||
using namespace Q3BSP;
|
using namespace Q3BSP;
|
||||||
|
|
||||||
static const std::string Q3BSPExtension = "pk3";
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Local function to create a material key name.
|
// Local function to create a material key name.
|
||||||
static void createKey( int id1, int id2, std::string &rKey )
|
static void createKey( int id1, int id2, std::string &rKey )
|
||||||
|
@ -161,7 +173,7 @@ Q3BSPFileImporter::~Q3BSPFileImporter()
|
||||||
bool Q3BSPFileImporter::CanRead( const std::string& rFile, IOSystem* /*pIOHandler*/, bool checkSig ) const
|
bool Q3BSPFileImporter::CanRead( const std::string& rFile, IOSystem* /*pIOHandler*/, bool checkSig ) const
|
||||||
{
|
{
|
||||||
if(!checkSig) {
|
if(!checkSig) {
|
||||||
return SimpleExtensionCheck( rFile, Q3BSPExtension.c_str() );
|
return SimpleExtensionCheck( rFile, "pk3" );
|
||||||
}
|
}
|
||||||
// TODO perhaps add keyword based detection
|
// TODO perhaps add keyword based detection
|
||||||
return false;
|
return false;
|
||||||
|
@ -169,9 +181,9 @@ bool Q3BSPFileImporter::CanRead( const std::string& rFile, IOSystem* /*pIOHandle
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Adds extensions.
|
// Adds extensions.
|
||||||
void Q3BSPFileImporter::GetExtensionList( std::set<std::string>& extensions )
|
const aiImporterDesc* Q3BSPFileImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert( Q3BSPExtension );
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -78,7 +78,7 @@ private:
|
||||||
typedef std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>* >::iterator FaceMapIt;
|
typedef std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>* >::iterator FaceMapIt;
|
||||||
typedef std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>*>::const_iterator FaceMapConstIt;
|
typedef std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>*>::const_iterator FaceMapConstIt;
|
||||||
|
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
||||||
void separateMapName( const std::string &rImportName, std::string &rArchiveName, std::string &rMapName );
|
void separateMapName( const std::string &rImportName, std::string &rArchiveName, std::string &rMapName );
|
||||||
bool findFirstMapInArchive( Q3BSP::Q3BSPZipArchive &rArchive, std::string &rMapName );
|
bool findFirstMapInArchive( Q3BSP::Q3BSPZipArchive &rArchive, std::string &rMapName );
|
||||||
|
|
|
@ -53,6 +53,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Quick3D Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.quick3d.com/",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"q3o q3s"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
Q3DImporter::Q3DImporter()
|
Q3DImporter::Q3DImporter()
|
||||||
|
@ -81,10 +94,9 @@ bool Q3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void Q3DImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* Q3DImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("q3o");
|
return &desc;
|
||||||
extensions.insert("q3s");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -71,10 +71,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -53,6 +53,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Raw Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"raw"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
RAWImporter::RAWImporter()
|
RAWImporter::RAWImporter()
|
||||||
|
@ -71,10 +84,9 @@ bool RAWImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get the list of all supported file extensions
|
const aiImporterDesc* RAWImporter::GetInfo () const
|
||||||
void RAWImporter::GetExtensionList(std::set<std::string>& extensions)
|
|
||||||
{
|
{
|
||||||
extensions.insert("raw");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -72,10 +72,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -53,6 +53,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Valve SMD Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"smd vta"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
SMDImporter::SMDImporter()
|
SMDImporter::SMDImporter()
|
||||||
|
@ -73,10 +86,9 @@ bool SMDImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all supported file extensions
|
// Get a list of all supported file extensions
|
||||||
void SMDImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* SMDImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("smd");
|
return &desc;
|
||||||
extensions.insert("vta");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -197,10 +197,10 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -51,6 +51,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Stereolithography (STL) Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour | aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"stl"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
|
@ -80,9 +92,9 @@ bool STLImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void STLImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* STLImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("stl");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -71,10 +71,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -48,6 +48,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Terragen Heightmap Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.planetside.co.uk/",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ter"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
TerragenImporter::TerragenImporter()
|
TerragenImporter::TerragenImporter()
|
||||||
|
@ -83,9 +96,9 @@ bool TerragenImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler,
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Build a string of all file extensions supported
|
// Build a string of all file extensions supported
|
||||||
void TerragenImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* TerragenImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ter");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -83,7 +83,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
||||||
|
|
|
@ -58,6 +58,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Unreal Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"3d uc"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
UnrealImporter::UnrealImporter()
|
UnrealImporter::UnrealImporter()
|
||||||
|
@ -79,10 +93,9 @@ bool UnrealImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Build a string of all file extensions supported
|
// Build a string of all file extensions supported
|
||||||
void UnrealImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* UnrealImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("3d");
|
return &desc;
|
||||||
extensions.insert("uc");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -165,9 +165,9 @@ protected:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** @brief Called by Importer::GetExtensionList()
|
/** @brief Called by Importer::GetExtensionList()
|
||||||
*
|
*
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -51,6 +51,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Collada Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour | aiImporterFlags_SupportBinaryFlavour | aiImporterFlags_SupportCompressedFlavour,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
5,
|
||||||
|
"x"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
XFileImporter::XFileImporter()
|
XFileImporter::XFileImporter()
|
||||||
|
@ -78,9 +91,10 @@ bool XFileImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, boo
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void XFileImporter::GetExtensionList(std::set<std::string>& extensions)
|
// Get file extension list
|
||||||
|
const aiImporterDesc* XFileImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("x");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -81,10 +81,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -79,6 +79,19 @@ struct free_it
|
||||||
|
|
||||||
template<> const std::string LogFunctions<XGLImporter>::log_prefix = "XGL: ";
|
template<> const std::string LogFunctions<XGLImporter>::log_prefix = "XGL: ";
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"XGL Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"xgl zgl"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
|
@ -115,10 +128,9 @@ bool XGLImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all file extensions which are handled by this class
|
// Get a list of all file extensions which are handled by this class
|
||||||
void XGLImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* XGLImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("xgl");
|
return &desc;
|
||||||
extensions.insert("zgl");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -74,9 +74,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details */
|
* See #BaseImporter::GetInfo for the details */
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -117,6 +117,20 @@ struct aiImporterDesc
|
||||||
maximum version.*/
|
maximum version.*/
|
||||||
unsigned int mMaxMajor;
|
unsigned int mMaxMajor;
|
||||||
unsigned int mMaxMinor;
|
unsigned int mMaxMinor;
|
||||||
|
|
||||||
|
/** List of file extensions this importer can handle.
|
||||||
|
List entries are separated by space characters.
|
||||||
|
All entries are lower case without a leading dot (i.e.
|
||||||
|
"xml dae" would be a valid value. Note that multiple
|
||||||
|
importers may respond to the same file extension -
|
||||||
|
assimp calls all importers in the order in which they
|
||||||
|
are registered and each importer gets the opportunity
|
||||||
|
to load the file until one importer "claims" the file. Apart
|
||||||
|
from file extension checks, importers typically use
|
||||||
|
other methods to quickly reject files (i.e. magic
|
||||||
|
words) so this does not mean that common or generic
|
||||||
|
file extensions such as XML would be tediously slow. */
|
||||||
|
const char* mFileExtensions;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1812,7 +1812,7 @@
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\code\OgreImporter.h"
|
RelativePath="..\..\code\OgreImporter.hpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
|
Loading…
Reference in New Issue