- move importer and postprocessing step construction chain to separate files to make them available to the exporter part.
+ introduce aiScene::mPrivate. This is a potentially breaking API change. The new member is added at the end of the structure though, so serious regressions are not to be expected. + add a mPreprocessing parameter to all Export API calls. Allow exporters to specify further PP steps to be executed prior to handing control to them. The entire export API now operates on a copy of the scene that the user passed in. - mass refactoring: all constructors of BaseProcess/BaseImporter inherited classes are public now and Importer will perhaps feel a bit sad after having loft all of its friends. # fix const correctness in SceneCombiner git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1060 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/2/head
parent
967e87d625
commit
665f73861e
|
@ -61,13 +61,9 @@ using namespace D3DS;
|
||||||
*/
|
*/
|
||||||
class Discreet3DSImporter : public BaseImporter
|
class Discreet3DSImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
Discreet3DSImporter();
|
Discreet3DSImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~Discreet3DSImporter();
|
~Discreet3DSImporter();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -56,16 +56,12 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class AC3DImporter : public BaseImporter
|
class AC3DImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
AC3DImporter();
|
AC3DImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~AC3DImporter();
|
~AC3DImporter();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Represents an AC3D material
|
// Represents an AC3D material
|
||||||
struct Material
|
struct Material
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,15 +58,11 @@ class MaterialHelper;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class ASEImporter : public BaseImporter {
|
class ASEImporter : public BaseImporter {
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
ASEImporter();
|
ASEImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~ASEImporter();
|
~ASEImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "GenericProperty.h"
|
#include "GenericProperty.h"
|
||||||
#include "CInterfaceIOWrapper.h"
|
#include "CInterfaceIOWrapper.h"
|
||||||
|
#include "Importer.h"
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#ifdef AI_C_THREADSAFE
|
#ifdef AI_C_THREADSAFE
|
||||||
|
|
|
@ -65,29 +65,29 @@ ASSIMP_API const aiExportFormatDesc* aiGetExportFormatDescription( size_t pIndex
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
ASSIMP_API aiReturn aiExportScene( const aiScene* pScene, const char* pFormatId, const char* pFileName )
|
ASSIMP_API aiReturn aiExportScene( const aiScene* pScene, const char* pFormatId, const char* pFileName, unsigned int pPreprocessing )
|
||||||
{
|
{
|
||||||
return ::aiExportSceneEx(pScene,pFormatId,pFileName,NULL);
|
return ::aiExportSceneEx(pScene,pFormatId,pFileName,NULL,pPreprocessing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
ASSIMP_API aiReturn aiExportSceneEx( const aiScene* pScene, const char* pFormatId, const char* pFileName, aiFileIO* pIO)
|
ASSIMP_API aiReturn aiExportSceneEx( const aiScene* pScene, const char* pFormatId, const char* pFileName, aiFileIO* pIO, unsigned int pPreprocessing )
|
||||||
{
|
{
|
||||||
Exporter exp;
|
Exporter exp;
|
||||||
|
|
||||||
if (pIO) {
|
if (pIO) {
|
||||||
exp.SetIOHandler(new CIOSystemWrapper(pIO));
|
exp.SetIOHandler(new CIOSystemWrapper(pIO));
|
||||||
}
|
}
|
||||||
return exp.Export(pScene,pFormatId,pFileName);
|
return exp.Export(pScene,pFormatId,pFileName,pPreprocessing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
ASSIMP_API const C_STRUCT aiExportDataBlob* aiExportSceneToBlob( const aiScene* pScene, const char* pFormatId )
|
ASSIMP_API const C_STRUCT aiExportDataBlob* aiExportSceneToBlob( const aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing )
|
||||||
{
|
{
|
||||||
Exporter exp;
|
Exporter exp;
|
||||||
if (!exp.ExportToBlob(pScene,pFormatId)) {
|
if (!exp.ExportToBlob(pScene,pFormatId,pPreprocessing)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
const aiExportDataBlob* blob = exp.GetOrphanedBlob();
|
const aiExportDataBlob* blob = exp.GetOrphanedBlob();
|
||||||
|
|
|
@ -68,3 +68,65 @@ ASSIMP_API unsigned int aiGetVersionRevision ()
|
||||||
return SVNRevision;
|
return SVNRevision;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
aiScene::aiScene()
|
||||||
|
: mFlags()
|
||||||
|
, mRootNode()
|
||||||
|
, mNumMeshes()
|
||||||
|
, mMeshes()
|
||||||
|
, mNumMaterials()
|
||||||
|
, mMaterials()
|
||||||
|
, mNumAnimations()
|
||||||
|
, mAnimations()
|
||||||
|
, mNumTextures()
|
||||||
|
, mTextures()
|
||||||
|
, mNumLights()
|
||||||
|
, mLights()
|
||||||
|
, mNumCameras()
|
||||||
|
, mCameras()
|
||||||
|
, mPrivate(new Assimp::ScenePrivateData())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
aiScene::~aiScene()
|
||||||
|
{
|
||||||
|
// delete all sub-objects recursively
|
||||||
|
delete mRootNode;
|
||||||
|
|
||||||
|
// To make sure we won't crash if the data is invalid it's
|
||||||
|
// much better to check whether both mNumXXX and mXXX are
|
||||||
|
// valid instead of relying on just one of them.
|
||||||
|
if (mNumMeshes && mMeshes)
|
||||||
|
for( unsigned int a = 0; a < mNumMeshes; a++)
|
||||||
|
delete mMeshes[a];
|
||||||
|
delete [] mMeshes;
|
||||||
|
|
||||||
|
if (mNumMaterials && mMaterials)
|
||||||
|
for( unsigned int a = 0; a < mNumMaterials; a++)
|
||||||
|
delete mMaterials[a];
|
||||||
|
delete [] mMaterials;
|
||||||
|
|
||||||
|
if (mNumAnimations && mAnimations)
|
||||||
|
for( unsigned int a = 0; a < mNumAnimations; a++)
|
||||||
|
delete mAnimations[a];
|
||||||
|
delete [] mAnimations;
|
||||||
|
|
||||||
|
if (mNumTextures && mTextures)
|
||||||
|
for( unsigned int a = 0; a < mNumTextures; a++)
|
||||||
|
delete mTextures[a];
|
||||||
|
delete [] mTextures;
|
||||||
|
|
||||||
|
if (mNumLights && mLights)
|
||||||
|
for( unsigned int a = 0; a < mNumLights; a++)
|
||||||
|
delete mLights[a];
|
||||||
|
delete [] mLights;
|
||||||
|
|
||||||
|
if (mNumCameras && mCameras)
|
||||||
|
for( unsigned int a = 0; a < mNumCameras; a++)
|
||||||
|
delete mCameras[a];
|
||||||
|
delete [] mCameras;
|
||||||
|
|
||||||
|
delete static_cast<Assimp::ScenePrivateData*>( mPrivate );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,6 +145,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "StringComparison.h"
|
#include "StringComparison.h"
|
||||||
#include "StreamReader.h"
|
#include "StreamReader.h"
|
||||||
#include "qnan.h"
|
#include "qnan.h"
|
||||||
|
#include "ScenePrivate.h"
|
||||||
|
|
||||||
|
|
||||||
// We need those constants, workaround for any platforms where nobody defined them yet
|
// We need those constants, workaround for any platforms where nobody defined them yet
|
||||||
|
|
|
@ -61,7 +61,6 @@ namespace Assimp
|
||||||
*/
|
*/
|
||||||
class BVHLoader : public BaseImporter
|
class BVHLoader : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
|
||||||
|
|
||||||
/** Possible animation channels for which the motion data holds the values */
|
/** Possible animation channels for which the motion data holds the values */
|
||||||
enum ChannelType
|
enum ChannelType
|
||||||
|
@ -85,11 +84,9 @@ class BVHLoader : public BaseImporter
|
||||||
Node( const aiNode* pNode) : mNode( pNode) { }
|
Node( const aiNode* pNode) : mNode( pNode) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
BVHLoader();
|
|
||||||
|
|
||||||
/** Destructor, private as well */
|
BVHLoader();
|
||||||
~BVHLoader();
|
~BVHLoader();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -47,6 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "FileSystemFilter.h"
|
#include "FileSystemFilter.h"
|
||||||
|
|
||||||
|
#include "Importer.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -94,66 +94,7 @@ private:
|
||||||
bool mdismiss;
|
bool mdismiss;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! @cond never
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
/** @brief Internal PIMPL implementation for Assimp::Importer
|
|
||||||
*
|
|
||||||
* Using this idiom here allows us to drop the dependency from
|
|
||||||
* std::vector and std::map in the public headers. Furthermore we are dropping
|
|
||||||
* any STL interface problems caused by mismatching STL settings. All
|
|
||||||
* size calculation are now done by us, not the app heap. */
|
|
||||||
class ASSIMP_API ImporterPimpl
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Data type to store the key hash
|
|
||||||
typedef unsigned int KeyType;
|
|
||||||
|
|
||||||
// typedefs for our three configuration maps.
|
|
||||||
// We don't need more, so there is no need for a generic solution
|
|
||||||
typedef std::map<KeyType, int> IntPropertyMap;
|
|
||||||
typedef std::map<KeyType, float> FloatPropertyMap;
|
|
||||||
typedef std::map<KeyType, std::string> StringPropertyMap;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/** IO handler to use for all file accesses. */
|
|
||||||
IOSystem* mIOHandler;
|
|
||||||
bool mIsDefaultHandler;
|
|
||||||
|
|
||||||
/** Progress handler for feedback. */
|
|
||||||
ProgressHandler* mProgressHandler;
|
|
||||||
bool mIsDefaultProgressHandler;
|
|
||||||
|
|
||||||
/** Format-specific importer worker objects - one for each format we can read.*/
|
|
||||||
std::vector<BaseImporter*> mImporter;
|
|
||||||
|
|
||||||
/** Post processing steps we can apply at the imported data. */
|
|
||||||
std::vector<BaseProcess*> mPostProcessingSteps;
|
|
||||||
|
|
||||||
/** The imported data, if ReadFile() was successful, NULL otherwise. */
|
|
||||||
aiScene* mScene;
|
|
||||||
|
|
||||||
/** The error description, if there was one. */
|
|
||||||
std::string mErrorString;
|
|
||||||
|
|
||||||
/** List of integer properties */
|
|
||||||
IntPropertyMap mIntProperties;
|
|
||||||
|
|
||||||
/** List of floating-point properties */
|
|
||||||
FloatPropertyMap mFloatProperties;
|
|
||||||
|
|
||||||
/** List of string properties */
|
|
||||||
StringPropertyMap mStringProperties;
|
|
||||||
|
|
||||||
/** Used for testing - extra verbose mode causes the ValidateDataStructure-Step
|
|
||||||
* to be executed before and after every single postprocess step */
|
|
||||||
bool bExtraVerbose;
|
|
||||||
|
|
||||||
/** Used by post-process steps to share data */
|
|
||||||
SharedPostProcessInfo* mPPShared;
|
|
||||||
};
|
|
||||||
//! @endcond
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface
|
/** FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface
|
||||||
|
@ -169,7 +110,7 @@ class ASSIMP_API BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
|
|
||||||
/** Constructor to be privately used by #Importer */
|
/** Constructor to be privately used by #Importer */
|
||||||
BaseImporter();
|
BaseImporter();
|
||||||
|
@ -407,92 +348,7 @@ protected:
|
||||||
ProgressHandler* progress;
|
ProgressHandler* progress;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BatchData;
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
/** FOR IMPORTER PLUGINS ONLY: A helper class for the pleasure of importers
|
|
||||||
* which need to load many extern meshes recursively.
|
|
||||||
*
|
|
||||||
* The class uses several threads to load these meshes (or at least it
|
|
||||||
* could, this has not yet been implemented at the moment).
|
|
||||||
*
|
|
||||||
* @note The class may not be used by more than one thread*/
|
|
||||||
class ASSIMP_API BatchLoader
|
|
||||||
{
|
|
||||||
// friend of Importer
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//! @cond never
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
/** Wraps a full list of configuration properties for an importer.
|
|
||||||
* Properties can be set using SetGenericProperty */
|
|
||||||
struct PropertyMap
|
|
||||||
{
|
|
||||||
ImporterPimpl::IntPropertyMap ints;
|
|
||||||
ImporterPimpl::FloatPropertyMap floats;
|
|
||||||
ImporterPimpl::StringPropertyMap strings;
|
|
||||||
|
|
||||||
bool operator == (const PropertyMap& prop) const {
|
|
||||||
// fixme: really isocpp? gcc complains
|
|
||||||
return ints == prop.ints && floats == prop.floats && strings == prop.strings;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool empty () const {
|
|
||||||
return ints.empty() && floats.empty() && strings.empty();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
//! @endcond
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
/** Construct a batch loader from a given IO system to be used
|
|
||||||
* to acess external files */
|
|
||||||
BatchLoader(IOSystem* pIO);
|
|
||||||
~BatchLoader();
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
/** Add a new file to the list of files to be loaded.
|
|
||||||
* @param file File to be loaded
|
|
||||||
* @param steps Post-processing steps to be executed on the file
|
|
||||||
* @param map Optional configuration properties
|
|
||||||
* @return 'Load request channel' - an unique ID that can later
|
|
||||||
* be used to access the imported file data.
|
|
||||||
* @see GetImport */
|
|
||||||
unsigned int AddLoadRequest (
|
|
||||||
const std::string& file,
|
|
||||||
unsigned int steps = 0,
|
|
||||||
const PropertyMap* map = NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
/** Get an imported scene.
|
|
||||||
* This polls the import from the internal request list.
|
|
||||||
* If an import is requested several times, this function
|
|
||||||
* can be called several times, too.
|
|
||||||
*
|
|
||||||
* @param which LRWC returned by AddLoadRequest().
|
|
||||||
* @return NULL if there is no scene with this file name
|
|
||||||
* in the queue of the scene hasn't been loaded yet. */
|
|
||||||
aiScene* GetImport(
|
|
||||||
unsigned int which
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
/** Waits until all scenes have been loaded. This returns
|
|
||||||
* immediately if no scenes are queued.*/
|
|
||||||
void LoadAll();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// No need to have that in the public API ...
|
|
||||||
BatchData* data;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // end of namespace Assimp
|
} // end of namespace Assimp
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
|
|
||||||
|
#include "Importer.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -120,16 +120,11 @@ struct aiLoaderDesc
|
||||||
// -------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------
|
||||||
class BlenderImporter : public BaseImporter, public LogFunctions<BlenderImporter>
|
class BlenderImporter : public BaseImporter, public LogFunctions<BlenderImporter>
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
BlenderImporter();
|
BlenderImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~BlenderImporter();
|
~BlenderImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
|
|
|
@ -95,6 +95,10 @@ SET( Common_SRCS
|
||||||
BaseImporter.h
|
BaseImporter.h
|
||||||
BaseProcess.cpp
|
BaseProcess.cpp
|
||||||
BaseProcess.h
|
BaseProcess.h
|
||||||
|
Importer.h
|
||||||
|
ScenePrivate.h
|
||||||
|
PostStepRegistry.cpp
|
||||||
|
ImporterRegistry.cpp
|
||||||
ByteSwap.h
|
ByteSwap.h
|
||||||
DefaultProgressHandler.h
|
DefaultProgressHandler.h
|
||||||
DefaultIOStream.cpp
|
DefaultIOStream.cpp
|
||||||
|
|
|
@ -68,16 +68,11 @@ namespace Assimp {
|
||||||
// -------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------
|
||||||
class COBImporter : public BaseImporter
|
class COBImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
COBImporter();
|
COBImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~COBImporter();
|
~COBImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
|
|
|
@ -56,14 +56,11 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class CSMImporter : public BaseImporter
|
class CSMImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
CSMImporter();
|
CSMImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~CSMImporter();
|
~CSMImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
|
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
|
||||||
|
|
|
@ -59,13 +59,9 @@ namespace Assimp
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API CalcTangentsProcess : public BaseProcess
|
class ASSIMP_API CalcTangentsProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
CalcTangentsProcess();
|
CalcTangentsProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~CalcTangentsProcess();
|
~CalcTangentsProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -78,15 +78,11 @@ struct ColladaMeshIndex
|
||||||
*/
|
*/
|
||||||
class ColladaLoader : public BaseImporter
|
class ColladaLoader : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
ColladaLoader();
|
ColladaLoader();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~ColladaLoader();
|
~ColladaLoader();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Returns whether the class can handle the format of the given file.
|
/** Returns whether the class can handle the format of the given file.
|
||||||
* See BaseImporter::CanRead() for details. */
|
* See BaseImporter::CanRead() for details. */
|
||||||
|
|
|
@ -56,17 +56,12 @@ namespace Assimp
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API ComputeUVMappingProcess : public BaseProcess
|
class ASSIMP_API ComputeUVMappingProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::ComputeUVMappingTest; // grant the unit test full access to us
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
ComputeUVMappingProcess();
|
ComputeUVMappingProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~ComputeUVMappingProcess();
|
~ComputeUVMappingProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Returns whether the processing step is present in the given flag field.
|
/** Returns whether the processing step is present in the given flag field.
|
||||||
* @param pFlags The processing flags the importer was called with. A bitwise
|
* @param pFlags The processing flags the importer was called with. A bitwise
|
||||||
|
|
|
@ -69,13 +69,10 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API MakeLeftHandedProcess : public BaseProcess
|
class ASSIMP_API MakeLeftHandedProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
MakeLeftHandedProcess();
|
MakeLeftHandedProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~MakeLeftHandedProcess();
|
~MakeLeftHandedProcess();
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -65,16 +65,12 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class DXFImporter : public BaseImporter
|
class DXFImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
DXFImporter();
|
DXFImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~DXFImporter();
|
~DXFImporter();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -66,14 +66,9 @@ namespace Assimp
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API DeboneProcess : public BaseProcess
|
class ASSIMP_API DeboneProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::DeboneTest;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
DeboneProcess();
|
DeboneProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~DeboneProcess();
|
~DeboneProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -56,9 +56,15 @@ Here we implement only the C++ interface (Assimp::Exporter).
|
||||||
|
|
||||||
#include "DefaultIOSystem.h"
|
#include "DefaultIOSystem.h"
|
||||||
#include "BlobIOSystem.h"
|
#include "BlobIOSystem.h"
|
||||||
|
#include "SceneCombiner.h"
|
||||||
|
#include "BaseProcess.h"
|
||||||
|
#include "Importer.h" // need this for GetPostProcessingStepInstanceList()
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
// PostStepRegistry.cpp
|
||||||
|
void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out);
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Exporter worker function prototypes. Should not be necessary to #ifndef them, it's just a prototype
|
// Exporter worker function prototypes. Should not be necessary to #ifndef them, it's just a prototype
|
||||||
void ExportSceneCollada(const char*,IOSystem*, const aiScene*);
|
void ExportSceneCollada(const char*,IOSystem*, const aiScene*);
|
||||||
|
@ -78,13 +84,17 @@ struct ExportFormatEntry
|
||||||
// Worker function to do the actual exporting
|
// Worker function to do the actual exporting
|
||||||
fpExportFunc mExportFunction;
|
fpExportFunc mExportFunction;
|
||||||
|
|
||||||
|
// Postprocessing steps to be executed PRIOR to calling mExportFunction
|
||||||
|
unsigned int mEnforcePP;
|
||||||
|
|
||||||
// Constructor to fill all entries
|
// Constructor to fill all entries
|
||||||
ExportFormatEntry( const char* pId, const char* pDesc, const char* pExtension, fpExportFunc pFunction)
|
ExportFormatEntry( const char* pId, const char* pDesc, const char* pExtension, fpExportFunc pFunction, unsigned int pEnforcePP = 0u)
|
||||||
{
|
{
|
||||||
mDescription.id = pId;
|
mDescription.id = pId;
|
||||||
mDescription.description = pDesc;
|
mDescription.description = pDesc;
|
||||||
mDescription.fileExtension = pExtension;
|
mDescription.fileExtension = pExtension;
|
||||||
mExportFunction = pFunction;
|
mExportFunction = pFunction;
|
||||||
|
mEnforcePP = pEnforcePP;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -114,12 +124,17 @@ public:
|
||||||
, mIOSystem(new Assimp::DefaultIOSystem())
|
, mIOSystem(new Assimp::DefaultIOSystem())
|
||||||
, mIsDefaultIOHandler(true)
|
, mIsDefaultIOHandler(true)
|
||||||
{
|
{
|
||||||
|
GetPostProcessingStepInstanceList(mPostProcessingSteps);
|
||||||
}
|
}
|
||||||
|
|
||||||
~ExporterPimpl()
|
~ExporterPimpl()
|
||||||
{
|
{
|
||||||
delete blob;
|
delete blob;
|
||||||
|
|
||||||
|
// Delete all post-processing plug-ins
|
||||||
|
for( unsigned int a = 0; a < mPostProcessingSteps.size(); a++) {
|
||||||
|
delete mPostProcessingSteps[a];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -127,6 +142,9 @@ public:
|
||||||
aiExportDataBlob* blob;
|
aiExportDataBlob* blob;
|
||||||
boost::shared_ptr< Assimp::IOSystem > mIOSystem;
|
boost::shared_ptr< Assimp::IOSystem > mIOSystem;
|
||||||
bool mIsDefaultIOHandler;
|
bool mIsDefaultIOHandler;
|
||||||
|
|
||||||
|
/** Post processing steps we can apply at the imported data. */
|
||||||
|
std::vector< BaseProcess* > mPostProcessingSteps;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ASSIMP_NUM_EXPORTERS (sizeof(gExporters)/sizeof(gExporters[0]))
|
#define ASSIMP_NUM_EXPORTERS (sizeof(gExporters)/sizeof(gExporters[0]))
|
||||||
|
@ -177,7 +195,7 @@ bool Exporter :: IsDefaultIOHandler() const
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
const aiExportDataBlob* Exporter :: ExportToBlob( const aiScene* pScene, const char* pFormatId )
|
const aiExportDataBlob* Exporter :: ExportToBlob( const aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing )
|
||||||
{
|
{
|
||||||
if (pimpl->blob) {
|
if (pimpl->blob) {
|
||||||
delete pimpl->blob;
|
delete pimpl->blob;
|
||||||
|
@ -203,14 +221,33 @@ const aiExportDataBlob* Exporter :: ExportToBlob( const aiScene* pScene, const
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const char* pPath )
|
aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const char* pPath, unsigned int pPreprocessing )
|
||||||
{
|
{
|
||||||
ASSIMP_BEGIN_EXCEPTION_REGION();
|
ASSIMP_BEGIN_EXCEPTION_REGION();
|
||||||
for (size_t i = 0; i < ASSIMP_NUM_EXPORTERS; ++i) {
|
for (size_t i = 0; i < ASSIMP_NUM_EXPORTERS; ++i) {
|
||||||
if (!strcmp(gExporters[i].mDescription.id,pFormatId)) {
|
if (!strcmp(gExporters[i].mDescription.id,pFormatId)) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gExporters[i].mExportFunction(pPath,pimpl->mIOSystem.get(),pScene);
|
|
||||||
|
// Always create a full copy of the scene. We might optimize this one day,
|
||||||
|
// but for now it is the most pragmatic way.
|
||||||
|
aiScene* scenecopy_tmp;
|
||||||
|
SceneCombiner::CopyScene(&scenecopy_tmp,pScene);
|
||||||
|
|
||||||
|
std::auto_ptr<aiScene> scenecopy(scenecopy_tmp);
|
||||||
|
|
||||||
|
const unsigned int pp = (gExporters[i].mEnforcePP | pPreprocessing);
|
||||||
|
if (pp) {
|
||||||
|
for( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++) {
|
||||||
|
BaseProcess* const p = pimpl->mPostProcessingSteps[a];
|
||||||
|
|
||||||
|
if (p->IsActive(pp)) {
|
||||||
|
p->Execute(scenecopy.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gExporters[i].mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get());
|
||||||
}
|
}
|
||||||
catch (DeadlyExportError& err) {
|
catch (DeadlyExportError& err) {
|
||||||
// XXX what to do with the error message? Maybe introduce extra member to hold it, similar to Assimp.Importer
|
// XXX what to do with the error message? Maybe introduce extra member to hold it, similar to Assimp.Importer
|
||||||
|
|
|
@ -55,14 +55,9 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API FindDegeneratesProcess : public BaseProcess
|
class ASSIMP_API FindDegeneratesProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::FindDegeneratesProcessTest; // grant the unit test full access to us
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
FindDegeneratesProcess();
|
FindDegeneratesProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~FindDegeneratesProcess();
|
~FindDegeneratesProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace Assimp {
|
||||||
/** @brief Get a pseudo(!)-hash representing a mesh.
|
/** @brief Get a pseudo(!)-hash representing a mesh.
|
||||||
*
|
*
|
||||||
* The hash is built from number of vertices, faces, primitive types,
|
* The hash is built from number of vertices, faces, primitive types,
|
||||||
* .... but *not* from the real mesh data. It isn't absolutely unique.
|
* .... but *not* from the real mesh data. The funcction is not a perfect hash.
|
||||||
* @param in Input mesh
|
* @param in Input mesh
|
||||||
* @return Hash.
|
* @return Hash.
|
||||||
*/
|
*/
|
||||||
|
@ -107,14 +107,9 @@ inline bool CompareArrays(const aiColor4D* first, const aiColor4D* second,
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API FindInstancesProcess : public BaseProcess
|
class ASSIMP_API FindInstancesProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::FindInstancesProcessTest;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
FindInstancesProcess();
|
FindInstancesProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~FindInstancesProcess();
|
~FindInstancesProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -59,15 +59,9 @@ namespace Assimp {
|
||||||
class ASSIMP_API FindInvalidDataProcess
|
class ASSIMP_API FindInvalidDataProcess
|
||||||
: public BaseProcess
|
: public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::FindInvalidDataProcessTest;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
FindInvalidDataProcess();
|
FindInvalidDataProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~FindInvalidDataProcess();
|
~FindInvalidDataProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -55,15 +55,11 @@ namespace Assimp
|
||||||
* vectors of an object are facing inwards. In this case they will be
|
* vectors of an object are facing inwards. In this case they will be
|
||||||
* flipped.
|
* flipped.
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API FixInfacingNormalsProcess : public BaseProcess
|
class ASSIMP_API FixInfacingNormalsProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
FixInfacingNormalsProcess();
|
FixInfacingNormalsProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~FixInfacingNormalsProcess();
|
~FixInfacingNormalsProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -53,13 +53,9 @@ namespace Assimp
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API GenFaceNormalsProcess : public BaseProcess
|
class ASSIMP_API GenFaceNormalsProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
GenFaceNormalsProcess();
|
GenFaceNormalsProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~GenFaceNormalsProcess();
|
~GenFaceNormalsProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -55,14 +55,9 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API GenVertexNormalsProcess : public BaseProcess
|
class ASSIMP_API GenVertexNormalsProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::GenNormalsTest;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
GenVertexNormalsProcess();
|
GenVertexNormalsProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~GenVertexNormalsProcess();
|
~GenVertexNormalsProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -62,15 +62,11 @@ using namespace HMP;
|
||||||
*/
|
*/
|
||||||
class HMPImporter : public MDLImporter
|
class HMPImporter : public MDLImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
HMPImporter();
|
HMPImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~HMPImporter();
|
~HMPImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -69,16 +69,11 @@ namespace Assimp {
|
||||||
// -------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------
|
||||||
class IFCImporter : public BaseImporter, public LogFunctions<IFCImporter>
|
class IFCImporter : public BaseImporter, public LogFunctions<IFCImporter>
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
IFCImporter();
|
IFCImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~IFCImporter();
|
~IFCImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
|
|
|
@ -52,7 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
#include "StandardShapes.h"
|
#include "StandardShapes.h"
|
||||||
|
#include "Importer.h"
|
||||||
|
|
||||||
// We need boost::common_factor to compute the lcm/gcd of a number
|
// We need boost::common_factor to compute the lcm/gcd of a number
|
||||||
#include <boost/math/common_factor_rt.hpp>
|
#include <boost/math/common_factor_rt.hpp>
|
||||||
|
|
|
@ -61,15 +61,11 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class IRRImporter : public BaseImporter, public IrrlichtBase
|
class IRRImporter : public BaseImporter, public IrrlichtBase
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
IRRImporter();
|
IRRImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~IRRImporter();
|
~IRRImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -59,15 +59,11 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class IRRMeshImporter : public BaseImporter, public IrrlichtBase
|
class IRRMeshImporter : public BaseImporter, public IrrlichtBase
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
IRRMeshImporter();
|
IRRMeshImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~IRRMeshImporter();
|
~IRRMeshImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -61,8 +61,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Internal headers
|
// Internal headers
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "BaseImporter.h"
|
#include "Importer.h"
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
|
|
||||||
#include "DefaultIOStream.h"
|
#include "DefaultIOStream.h"
|
||||||
#include "DefaultIOSystem.h"
|
#include "DefaultIOSystem.h"
|
||||||
#include "DefaultProgressHandler.h"
|
#include "DefaultProgressHandler.h"
|
||||||
|
@ -73,197 +74,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "Profiler.h"
|
#include "Profiler.h"
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
|
|
||||||
using namespace Assimp::Profiling;
|
|
||||||
using namespace Assimp::Formatter;
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
// Importers
|
|
||||||
// (include_new_importers_here)
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
#ifndef ASSIMP_BUILD_NO_X_IMPORTER
|
|
||||||
# include "XFileImporter.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
|
||||||
# include "3DSLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_MD3_IMPORTER
|
|
||||||
# include "MD3Loader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_MDL_IMPORTER
|
|
||||||
# include "MDLLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_MD2_IMPORTER
|
|
||||||
# include "MD2Loader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_PLY_IMPORTER
|
|
||||||
# include "PlyLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_ASE_IMPORTER
|
|
||||||
# include "ASELoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER
|
|
||||||
# include "ObjFileImporter.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_HMP_IMPORTER
|
|
||||||
# include "HMPLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_SMD_IMPORTER
|
|
||||||
# include "SMDLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_MDC_IMPORTER
|
|
||||||
# include "MDCLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_MD5_IMPORTER
|
|
||||||
# include "MD5Loader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_STL_IMPORTER
|
|
||||||
# include "STLLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_LWO_IMPORTER
|
|
||||||
# include "LWOLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_DXF_IMPORTER
|
|
||||||
# include "DXFLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_NFF_IMPORTER
|
|
||||||
# include "NFFLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_RAW_IMPORTER
|
|
||||||
# include "RawLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_OFF_IMPORTER
|
|
||||||
# include "OFFLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_AC_IMPORTER
|
|
||||||
# include "ACLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_BVH_IMPORTER
|
|
||||||
# include "BVHLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_IRRMESH_IMPORTER
|
|
||||||
# include "IRRMeshLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_IRR_IMPORTER
|
|
||||||
# include "IRRLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_Q3D_IMPORTER
|
|
||||||
# include "Q3DLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_B3D_IMPORTER
|
|
||||||
# include "B3DImporter.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER
|
|
||||||
# include "ColladaLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_TERRAGEN_IMPORTER
|
|
||||||
# include "TerragenLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_CSM_IMPORTER
|
|
||||||
# include "CSMLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_3D_IMPORTER
|
|
||||||
# include "UnrealLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_LWS_IMPORTER
|
|
||||||
# include "LWSLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER
|
|
||||||
# include "OgreImporter.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_MS3D_IMPORTER
|
|
||||||
# include "MS3DLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_COB_IMPORTER
|
|
||||||
# include "COBLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
|
||||||
# include "BlenderLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
|
|
||||||
# include "Q3BSPFileImporter.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_NDO_IMPORTER
|
|
||||||
# include "NDOLoader.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
|
|
||||||
# include "IFCLoader.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
// Post processing-Steps
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
#ifndef ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS
|
|
||||||
# include "CalcTangentsProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_JOINVERTICES_PROCESS
|
|
||||||
# include "JoinVerticesProcess.h"
|
|
||||||
#endif
|
|
||||||
#if !(defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS && defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS && defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
|
|
||||||
# include "ConvertToLHProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_TRIANGULATE_PROCESS
|
|
||||||
# include "TriangulateProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS
|
|
||||||
# include "GenFaceNormalsProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS
|
|
||||||
# include "GenVertexNormalsProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_REMOVEVC_PROCESS
|
|
||||||
# include "RemoveVCProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS
|
|
||||||
# include "SplitLargeMeshes.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS
|
|
||||||
# include "PretransformVertices.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS
|
|
||||||
# include "LimitBoneWeightsProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
|
#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
|
||||||
# include "ValidateDataStructure.h"
|
# include "ValidateDataStructure.h"
|
||||||
#endif
|
#endif
|
||||||
#ifndef ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS
|
|
||||||
# include "ImproveCacheLocality.h"
|
using namespace Assimp::Profiling;
|
||||||
#endif
|
using namespace Assimp::Formatter;
|
||||||
#ifndef ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS
|
|
||||||
# include "FixNormalsStep.h"
|
namespace Assimp {
|
||||||
#endif
|
// ImporterRegistry.cpp
|
||||||
#ifndef ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS
|
void GetImporterInstanceList(std::vector< BaseImporter* >& out);
|
||||||
# include "RemoveRedundantMaterials.h"
|
// PostStepRegistry.cpp
|
||||||
#endif
|
void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out);
|
||||||
#ifndef ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS
|
}
|
||||||
# include "FindInvalidDataProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS
|
|
||||||
# include "FindDegenerates.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS
|
|
||||||
# include "SortByPTypeProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
|
|
||||||
# include "ComputeUVMappingProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
|
|
||||||
# include "TextureTransform.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS
|
|
||||||
# include "FindInstancesProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS
|
|
||||||
# include "OptimizeMeshes.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS
|
|
||||||
# include "OptimizeGraph.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_SPLITBYBONECOUNT_PROCESS
|
|
||||||
# include "SplitByBoneCountProcess.h"
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_DEBONE_PROCESS
|
|
||||||
# include "DeboneProcess.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::Intern;
|
using namespace Assimp::Intern;
|
||||||
|
@ -326,215 +149,8 @@ Importer::Importer()
|
||||||
pimpl->mProgressHandler = new DefaultProgressHandler();
|
pimpl->mProgressHandler = new DefaultProgressHandler();
|
||||||
pimpl->mIsDefaultProgressHandler = true;
|
pimpl->mIsDefaultProgressHandler = true;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
GetImporterInstanceList(pimpl->mImporter);
|
||||||
// Add an instance of each worker class here
|
GetPostProcessingStepInstanceList(pimpl->mPostProcessingSteps);
|
||||||
// (register_new_importers_here)
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
pimpl->mImporter.reserve(64);
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_X_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new XFileImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_OBJ_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new ObjFileImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_3DS_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new Discreet3DSImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_MD3_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new MD3Importer());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_MD2_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new MD2Importer());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_PLY_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new PLYImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_MDL_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new MDLImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_ASE_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new ASEImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_HMP_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new HMPImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_SMD_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new SMDImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_MDC_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new MDCImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_MD5_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new MD5Importer());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_STL_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new STLImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_LWO_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new LWOImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_DXF_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new DXFImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_NFF_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new NFFImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_RAW_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new RAWImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_OFF_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new OFFImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_AC_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new AC3DImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_BVH_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new BVHLoader());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_IRRMESH_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new IRRMeshImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_IRR_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new IRRImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_Q3D_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new Q3DImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_B3D_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new B3DImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_COLLADA_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new ColladaLoader());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_TERRAGEN_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new TerragenImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_CSM_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new CSMImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_3D_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new UnrealImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_LWS_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new LWSImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_OGRE_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new Ogre::OgreImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_MS3D_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new MS3DImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_COB_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new COBImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_BLEND_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new BlenderImporter());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_Q3BSP_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new Q3BSPFileImporter() );
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_NDO_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new NDOImporter() );
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_IFC_IMPORTER)
|
|
||||||
pimpl->mImporter.push_back( new IFCImporter() );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// Add an instance of each post processing step here in the order
|
|
||||||
// of sequence it is executed. Steps that are added here are not
|
|
||||||
// validated - as RegisterPPStep() does - all dependencies must be given.
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
pimpl->mPostProcessingSteps.reserve(25);
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_REMOVEVC_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new RemoveVCProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new RemoveRedundantMatsProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new FindInstancesProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new OptimizeGraphProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new OptimizeMeshesProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new FindDegeneratesProcess());
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new ComputeUVMappingProcess());
|
|
||||||
#endif
|
|
||||||
#ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new TextureTransformStep());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new PretransformVertices());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_TRIANGULATE_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new TriangulateProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new SortByPTypeProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new FindInvalidDataProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new FixInfacingNormalsProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_SPLITBYBONECOUNT_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new SplitByBoneCountProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new SplitLargeMeshesProcess_Triangle());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new GenFaceNormalsProcess());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// .........................................................................
|
|
||||||
// DON'T change the order of these five!
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new ComputeSpatialSortProcess());
|
|
||||||
// .........................................................................
|
|
||||||
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new GenVertexNormalsProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new CalcTangentsProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_JOINVERTICES_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new JoinVerticesProcess());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// .........................................................................
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new DestroySpatialSortProcess());
|
|
||||||
// .........................................................................
|
|
||||||
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new SplitLargeMeshesProcess_Vertex());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new MakeLeftHandedProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new FlipUVsProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new FlipWindingOrderProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_DEBONE_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new DeboneProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new LimitBoneWeightsProcess());
|
|
||||||
#endif
|
|
||||||
#if (!defined ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS)
|
|
||||||
pimpl->mPostProcessingSteps.push_back( new ImproveCacheLocalityProcess());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Allocate a SharedPostProcessInfo object and store pointers to it in all post-process steps in the list.
|
// Allocate a SharedPostProcessInfo object and store pointers to it in all post-process steps in the list.
|
||||||
pimpl->mPPShared = new SharedPostProcessInfo();
|
pimpl->mPPShared = new SharedPostProcessInfo();
|
||||||
|
@ -1179,6 +795,9 @@ const aiScene* Importer::ApplyPostProcessing(unsigned int pFlags)
|
||||||
#endif // ! DEBUG
|
#endif // ! DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update private scene flags
|
||||||
|
ScenePriv(pimpl->mScene)->mPPStepsApplied |= pFlags;
|
||||||
|
|
||||||
// clear any data allocated by post-process steps
|
// clear any data allocated by post-process steps
|
||||||
pimpl->mPPShared->Clean();
|
pimpl->mPPShared->Clean();
|
||||||
DefaultLogger::get()->info("Leaving post processing pipeline");
|
DefaultLogger::get()->info("Leaving post processing pipeline");
|
||||||
|
|
|
@ -0,0 +1,204 @@
|
||||||
|
/*
|
||||||
|
Open Asset Import Library (ASSIMP)
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2006-2010, ASSIMP Development Team
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
with or without modification, are permitted provided that the
|
||||||
|
following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer in the documentation and/or other
|
||||||
|
materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the ASSIMP team, nor the names of its
|
||||||
|
contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior
|
||||||
|
written permission of the ASSIMP Development Team.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @file Importer.h mostly internal stuff for use by #Assimp::Importer */
|
||||||
|
#ifndef INCLUDED_AI_IMPORTER_H
|
||||||
|
#define INCLUDED_AI_IMPORTER_H
|
||||||
|
|
||||||
|
namespace Assimp {
|
||||||
|
|
||||||
|
class BaseImporter;
|
||||||
|
class BaseProcess;
|
||||||
|
|
||||||
|
|
||||||
|
//! @cond never
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
/** @brief Internal PIMPL implementation for Assimp::Importer
|
||||||
|
*
|
||||||
|
* Using this idiom here allows us to drop the dependency from
|
||||||
|
* std::vector and std::map in the public headers. Furthermore we are dropping
|
||||||
|
* any STL interface problems caused by mismatching STL settings. All
|
||||||
|
* size calculation are now done by us, not the app heap. */
|
||||||
|
class ASSIMP_API ImporterPimpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Data type to store the key hash
|
||||||
|
typedef unsigned int KeyType;
|
||||||
|
|
||||||
|
// typedefs for our three configuration maps.
|
||||||
|
// We don't need more, so there is no need for a generic solution
|
||||||
|
typedef std::map<KeyType, int> IntPropertyMap;
|
||||||
|
typedef std::map<KeyType, float> FloatPropertyMap;
|
||||||
|
typedef std::map<KeyType, std::string> StringPropertyMap;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
/** IO handler to use for all file accesses. */
|
||||||
|
IOSystem* mIOHandler;
|
||||||
|
bool mIsDefaultHandler;
|
||||||
|
|
||||||
|
/** Progress handler for feedback. */
|
||||||
|
ProgressHandler* mProgressHandler;
|
||||||
|
bool mIsDefaultProgressHandler;
|
||||||
|
|
||||||
|
/** Format-specific importer worker objects - one for each format we can read.*/
|
||||||
|
std::vector< BaseImporter* > mImporter;
|
||||||
|
|
||||||
|
/** Post processing steps we can apply at the imported data. */
|
||||||
|
std::vector< BaseProcess* > mPostProcessingSteps;
|
||||||
|
|
||||||
|
/** The imported data, if ReadFile() was successful, NULL otherwise. */
|
||||||
|
aiScene* mScene;
|
||||||
|
|
||||||
|
/** The error description, if there was one. */
|
||||||
|
std::string mErrorString;
|
||||||
|
|
||||||
|
/** List of integer properties */
|
||||||
|
IntPropertyMap mIntProperties;
|
||||||
|
|
||||||
|
/** List of floating-point properties */
|
||||||
|
FloatPropertyMap mFloatProperties;
|
||||||
|
|
||||||
|
/** List of string properties */
|
||||||
|
StringPropertyMap mStringProperties;
|
||||||
|
|
||||||
|
/** Used for testing - extra verbose mode causes the ValidateDataStructure-Step
|
||||||
|
* to be executed before and after every single postprocess step */
|
||||||
|
bool bExtraVerbose;
|
||||||
|
|
||||||
|
/** Used by post-process steps to share data */
|
||||||
|
SharedPostProcessInfo* mPPShared;
|
||||||
|
};
|
||||||
|
//! @endcond
|
||||||
|
|
||||||
|
|
||||||
|
struct BatchData;
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
/** FOR IMPORTER PLUGINS ONLY: A helper class to the pleasure of importers
|
||||||
|
* that need to load many external meshes recursively.
|
||||||
|
*
|
||||||
|
* The class uses several threads to load these meshes (or at least it
|
||||||
|
* could, this has not yet been implemented at the moment).
|
||||||
|
*
|
||||||
|
* @note The class may not be used by more than one thread*/
|
||||||
|
class ASSIMP_API BatchLoader
|
||||||
|
{
|
||||||
|
// friend of Importer
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//! @cond never
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
/** Wraps a full list of configuration properties for an importer.
|
||||||
|
* Properties can be set using SetGenericProperty */
|
||||||
|
struct PropertyMap
|
||||||
|
{
|
||||||
|
ImporterPimpl::IntPropertyMap ints;
|
||||||
|
ImporterPimpl::FloatPropertyMap floats;
|
||||||
|
ImporterPimpl::StringPropertyMap strings;
|
||||||
|
|
||||||
|
bool operator == (const PropertyMap& prop) const {
|
||||||
|
// fixme: really isocpp? gcc complains
|
||||||
|
return ints == prop.ints && floats == prop.floats && strings == prop.strings;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool empty () const {
|
||||||
|
return ints.empty() && floats.empty() && strings.empty();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//! @endcond
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
/** Construct a batch loader from a given IO system to be used
|
||||||
|
* to acess external files */
|
||||||
|
BatchLoader(IOSystem* pIO);
|
||||||
|
~BatchLoader();
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
/** Add a new file to the list of files to be loaded.
|
||||||
|
* @param file File to be loaded
|
||||||
|
* @param steps Post-processing steps to be executed on the file
|
||||||
|
* @param map Optional configuration properties
|
||||||
|
* @return 'Load request channel' - an unique ID that can later
|
||||||
|
* be used to access the imported file data.
|
||||||
|
* @see GetImport */
|
||||||
|
unsigned int AddLoadRequest (
|
||||||
|
const std::string& file,
|
||||||
|
unsigned int steps = 0,
|
||||||
|
const PropertyMap* map = NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
/** Get an imported scene.
|
||||||
|
* This polls the import from the internal request list.
|
||||||
|
* If an import is requested several times, this function
|
||||||
|
* can be called several times, too.
|
||||||
|
*
|
||||||
|
* @param which LRWC returned by AddLoadRequest().
|
||||||
|
* @return NULL if there is no scene with this file name
|
||||||
|
* in the queue of the scene hasn't been loaded yet. */
|
||||||
|
aiScene* GetImport(
|
||||||
|
unsigned int which
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
/** Waits until all scenes have been loaded. This returns
|
||||||
|
* immediately if no scenes are queued.*/
|
||||||
|
void LoadAll();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// No need to have that in the public API ...
|
||||||
|
BatchData* data;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,284 @@
|
||||||
|
/*
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
Open Asset Import Library (ASSIMP)
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2006-2010, ASSIMP Development Team
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
with or without modification, are permitted provided that the following
|
||||||
|
conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer in the documentation and/or other
|
||||||
|
materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the ASSIMP team, nor the names of its
|
||||||
|
contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior
|
||||||
|
written permission of the ASSIMP Development Team.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @file ImporterRegistry.cpp
|
||||||
|
|
||||||
|
Central registry for all importers available. Do not edit this file
|
||||||
|
directly (unless you are adding new loaders), instead use the
|
||||||
|
corresponding preprocessor flag to selectively disable formats.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "AssimpPCH.h"
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Importers
|
||||||
|
// (include_new_importers_here)
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#ifndef ASSIMP_BUILD_NO_X_IMPORTER
|
||||||
|
# include "XFileImporter.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
# include "3DSLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_MD3_IMPORTER
|
||||||
|
# include "MD3Loader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_MDL_IMPORTER
|
||||||
|
# include "MDLLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_MD2_IMPORTER
|
||||||
|
# include "MD2Loader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_PLY_IMPORTER
|
||||||
|
# include "PlyLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_ASE_IMPORTER
|
||||||
|
# include "ASELoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER
|
||||||
|
# include "ObjFileImporter.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_HMP_IMPORTER
|
||||||
|
# include "HMPLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_SMD_IMPORTER
|
||||||
|
# include "SMDLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_MDC_IMPORTER
|
||||||
|
# include "MDCLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_MD5_IMPORTER
|
||||||
|
# include "MD5Loader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_STL_IMPORTER
|
||||||
|
# include "STLLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_LWO_IMPORTER
|
||||||
|
# include "LWOLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_DXF_IMPORTER
|
||||||
|
# include "DXFLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_NFF_IMPORTER
|
||||||
|
# include "NFFLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_RAW_IMPORTER
|
||||||
|
# include "RawLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_OFF_IMPORTER
|
||||||
|
# include "OFFLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_AC_IMPORTER
|
||||||
|
# include "ACLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_BVH_IMPORTER
|
||||||
|
# include "BVHLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_IRRMESH_IMPORTER
|
||||||
|
# include "IRRMeshLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_IRR_IMPORTER
|
||||||
|
# include "IRRLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_Q3D_IMPORTER
|
||||||
|
# include "Q3DLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_B3D_IMPORTER
|
||||||
|
# include "B3DImporter.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER
|
||||||
|
# include "ColladaLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_TERRAGEN_IMPORTER
|
||||||
|
# include "TerragenLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_CSM_IMPORTER
|
||||||
|
# include "CSMLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_3D_IMPORTER
|
||||||
|
# include "UnrealLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_LWS_IMPORTER
|
||||||
|
# include "LWSLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER
|
||||||
|
# include "OgreImporter.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_MS3D_IMPORTER
|
||||||
|
# include "MS3DLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_COB_IMPORTER
|
||||||
|
# include "COBLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
|
||||||
|
# include "BlenderLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
|
||||||
|
# include "Q3BSPFileImporter.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_NDO_IMPORTER
|
||||||
|
# include "NDOLoader.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||||
|
# include "IFCLoader.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Assimp {
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
void GetImporterInstanceList(std::vector< BaseImporter* >& out)
|
||||||
|
{
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Add an instance of each worker class here
|
||||||
|
// (register_new_importers_here)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
out.reserve(64);
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_X_IMPORTER)
|
||||||
|
out.push_back( new XFileImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_OBJ_IMPORTER)
|
||||||
|
out.push_back( new ObjFileImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_3DS_IMPORTER)
|
||||||
|
out.push_back( new Discreet3DSImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_MD3_IMPORTER)
|
||||||
|
out.push_back( new MD3Importer());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_MD2_IMPORTER)
|
||||||
|
out.push_back( new MD2Importer());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_PLY_IMPORTER)
|
||||||
|
out.push_back( new PLYImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_MDL_IMPORTER)
|
||||||
|
out.push_back( new MDLImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_ASE_IMPORTER)
|
||||||
|
out.push_back( new ASEImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_HMP_IMPORTER)
|
||||||
|
out.push_back( new HMPImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_SMD_IMPORTER)
|
||||||
|
out.push_back( new SMDImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_MDC_IMPORTER)
|
||||||
|
out.push_back( new MDCImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_MD5_IMPORTER)
|
||||||
|
out.push_back( new MD5Importer());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_STL_IMPORTER)
|
||||||
|
out.push_back( new STLImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_LWO_IMPORTER)
|
||||||
|
out.push_back( new LWOImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_DXF_IMPORTER)
|
||||||
|
out.push_back( new DXFImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_NFF_IMPORTER)
|
||||||
|
out.push_back( new NFFImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_RAW_IMPORTER)
|
||||||
|
out.push_back( new RAWImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_OFF_IMPORTER)
|
||||||
|
out.push_back( new OFFImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_AC_IMPORTER)
|
||||||
|
out.push_back( new AC3DImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_BVH_IMPORTER)
|
||||||
|
out.push_back( new BVHLoader());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_IRRMESH_IMPORTER)
|
||||||
|
out.push_back( new IRRMeshImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_IRR_IMPORTER)
|
||||||
|
out.push_back( new IRRImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_Q3D_IMPORTER)
|
||||||
|
out.push_back( new Q3DImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_B3D_IMPORTER)
|
||||||
|
out.push_back( new B3DImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_COLLADA_IMPORTER)
|
||||||
|
out.push_back( new ColladaLoader());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_TERRAGEN_IMPORTER)
|
||||||
|
out.push_back( new TerragenImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_CSM_IMPORTER)
|
||||||
|
out.push_back( new CSMImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_3D_IMPORTER)
|
||||||
|
out.push_back( new UnrealImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_LWS_IMPORTER)
|
||||||
|
out.push_back( new LWSImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_OGRE_IMPORTER)
|
||||||
|
out.push_back( new Ogre::OgreImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_MS3D_IMPORTER)
|
||||||
|
out.push_back( new MS3DImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_COB_IMPORTER)
|
||||||
|
out.push_back( new COBImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_BLEND_IMPORTER)
|
||||||
|
out.push_back( new BlenderImporter());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_Q3BSP_IMPORTER)
|
||||||
|
out.push_back( new Q3BSPFileImporter() );
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_NDO_IMPORTER)
|
||||||
|
out.push_back( new NDOImporter() );
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_IFC_IMPORTER)
|
||||||
|
out.push_back( new IFCImporter() );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -60,13 +60,9 @@ namespace Assimp
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API ImproveCacheLocalityProcess : public BaseProcess
|
class ASSIMP_API ImproveCacheLocalityProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
ImproveCacheLocalityProcess();
|
ImproveCacheLocalityProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~ImproveCacheLocalityProcess();
|
~ImproveCacheLocalityProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -63,14 +63,9 @@ class JoinVerticesTest;
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API JoinVerticesProcess : public BaseProcess
|
class ASSIMP_API JoinVerticesProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class JoinVerticesTest;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
JoinVerticesProcess();
|
JoinVerticesProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~JoinVerticesProcess();
|
~JoinVerticesProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -67,16 +67,11 @@ using namespace LWO;
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
class LWOImporter : public BaseImporter
|
class LWOImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
LWOImporter();
|
LWOImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~LWOImporter();
|
~LWOImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -53,6 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "GenericProperty.h"
|
#include "GenericProperty.h"
|
||||||
#include "SkeletonMeshBuilder.h"
|
#include "SkeletonMeshBuilder.h"
|
||||||
#include "ConvertToLHProcess.h"
|
#include "ConvertToLHProcess.h"
|
||||||
|
#include "Importer.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
|
|
@ -166,15 +166,11 @@ struct NodeDesc
|
||||||
*/
|
*/
|
||||||
class LWSImporter : public BaseImporter
|
class LWSImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
LWSImporter();
|
LWSImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~LWSImporter();
|
~LWSImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -71,14 +71,9 @@ namespace Assimp
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API LimitBoneWeightsProcess : public BaseProcess
|
class ASSIMP_API LimitBoneWeightsProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::LimitBoneWeightsTest;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
LimitBoneWeightsProcess();
|
LimitBoneWeightsProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~LimitBoneWeightsProcess();
|
~LimitBoneWeightsProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -60,15 +60,11 @@ using namespace MD2;
|
||||||
*/
|
*/
|
||||||
class MD2Importer : public BaseImporter
|
class MD2Importer : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
MD2Importer();
|
MD2Importer();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~MD2Importer();
|
~MD2Importer();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -57,6 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "GenericProperty.h"
|
#include "GenericProperty.h"
|
||||||
#include "RemoveComments.h"
|
#include "RemoveComments.h"
|
||||||
#include "ParsingUtils.h"
|
#include "ParsingUtils.h"
|
||||||
|
#include "Importer.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
|
|
@ -211,15 +211,11 @@ bool LoadSkin(SkinData& fill, const std::string& file,IOSystem* io);
|
||||||
*/
|
*/
|
||||||
class MD3Importer : public BaseImporter
|
class MD3Importer : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
MD3Importer();
|
MD3Importer();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~MD3Importer();
|
~MD3Importer();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -61,15 +61,11 @@ using namespace Assimp::MD5;
|
||||||
*/
|
*/
|
||||||
class MD5Importer : public BaseImporter
|
class MD5Importer : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
MD5Importer();
|
MD5Importer();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~MD5Importer();
|
~MD5Importer();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -58,15 +58,11 @@ using namespace MDC;
|
||||||
*/
|
*/
|
||||||
class MDCImporter : public BaseImporter
|
class MDCImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
MDCImporter();
|
MDCImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~MDCImporter();
|
~MDCImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -82,15 +82,11 @@ using namespace MDL;
|
||||||
*/
|
*/
|
||||||
class MDLImporter : public BaseImporter
|
class MDLImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
MDLImporter();
|
MDLImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~MDLImporter();
|
~MDLImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -53,9 +53,8 @@ namespace Assimp {
|
||||||
class MS3DImporter
|
class MS3DImporter
|
||||||
: public BaseImporter
|
: public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
|
|
||||||
MS3DImporter();
|
MS3DImporter();
|
||||||
~MS3DImporter();
|
~MS3DImporter();
|
||||||
|
|
|
@ -53,14 +53,11 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class NDOImporter : public BaseImporter
|
class NDOImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
NDOImporter();
|
NDOImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~NDOImporter();
|
~NDOImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Represents a single edge
|
//! Represents a single edge
|
||||||
|
|
|
@ -60,15 +60,11 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class NFFImporter : public BaseImporter
|
class NFFImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
NFFImporter();
|
NFFImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~NFFImporter();
|
~NFFImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -55,15 +55,11 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class OFFImporter : public BaseImporter
|
class OFFImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
OFFImporter();
|
OFFImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~OFFImporter();
|
~OFFImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -61,12 +61,9 @@ struct Model;
|
||||||
/// \class ObjFileImporter
|
/// \class ObjFileImporter
|
||||||
/// \brief Imports a waveform obj file
|
/// \brief Imports a waveform obj file
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
class ObjFileImporter :
|
class ObjFileImporter : public BaseImporter
|
||||||
BaseImporter
|
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/// \brief Default constructor
|
/// \brief Default constructor
|
||||||
ObjFileImporter();
|
ObjFileImporter();
|
||||||
|
|
||||||
|
|
|
@ -63,14 +63,9 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API OptimizeGraphProcess : public BaseProcess
|
class ASSIMP_API OptimizeGraphProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::OptimizeGraphProcessTest;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
OptimizeGraphProcess();
|
OptimizeGraphProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~OptimizeGraphProcess();
|
~OptimizeGraphProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -61,14 +61,9 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API OptimizeMeshesProcess : public BaseProcess
|
class ASSIMP_API OptimizeMeshesProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::OptimizeMeshesProcessTest;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
OptimizeMeshesProcess();
|
OptimizeMeshesProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~OptimizeMeshesProcess();
|
~OptimizeMeshesProcess();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,15 +61,11 @@ using namespace PLY;
|
||||||
*/
|
*/
|
||||||
class PLYImporter : public BaseImporter
|
class PLYImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
PLYImporter();
|
PLYImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~PLYImporter();
|
~PLYImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
150
code/PolyTools.h
150
code/PolyTools.h
|
@ -47,7 +47,7 @@ namespace Assimp {
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
/** Test if a given point p2 is on the left side of the line formed by p0-p1.
|
/** Test if a given point p2 is on the left side of the line formed by p0-p1.
|
||||||
* The function accepts an unconstrained template parameter for use with
|
* The function accepts an unconstrained template parameter for use with
|
||||||
* both aiVector3D and aiVector2D, but generally ignores the third coordinate.*/
|
* both aiVector3D and aiVector2D, but generally ignores the third coordinate.*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline bool OnLeftSideOfLine2D(const T& p0, const T& p1,const T& p2)
|
inline bool OnLeftSideOfLine2D(const T& p0, const T& p1,const T& p2)
|
||||||
|
@ -57,7 +57,7 @@ inline bool OnLeftSideOfLine2D(const T& p0, const T& p1,const T& p2)
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
/** Test if a given point is inside a given triangle in R2.
|
/** Test if a given point is inside a given triangle in R2.
|
||||||
* The function accepts an unconstrained template parameter for use with
|
* The function accepts an unconstrained template parameter for use with
|
||||||
* both aiVector3D and aiVector2D, but generally ignores the third coordinate.*/
|
* both aiVector3D and aiVector2D, but generally ignores the third coordinate.*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline bool PointInTriangle2D(const T& p0, const T& p1,const T& p2, const T& pp)
|
inline bool PointInTriangle2D(const T& p0, const T& p1,const T& p2, const T& pp)
|
||||||
|
@ -80,15 +80,15 @@ inline bool PointInTriangle2D(const T& p0, const T& p1,const T& p2, const T& pp)
|
||||||
return (dot11 > 0) && (dot00 > 0) && (dot11 + dot00 < 1);
|
return (dot11 > 0) && (dot00 > 0) && (dot11 + dot00 < 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
/** Compute the signed area of a triangle.
|
/** Compute the signed area of a triangle.
|
||||||
* The function accepts an unconstrained template parameter for use with
|
* The function accepts an unconstrained template parameter for use with
|
||||||
* both aiVector3D and aiVector2D, but generally ignores the third coordinate.*/
|
* both aiVector3D and aiVector2D, but generally ignores the third coordinate.*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline double GetArea2D(const T& v1, const T& v2, const T& v3)
|
inline double GetArea2D(const T& v1, const T& v2, const T& v3)
|
||||||
{
|
{
|
||||||
return 0.5 * (v1.x * ((double)v3.y - v2.y) + v2.x * ((double)v1.y - v3.y) + v3.x * ((double)v2.y - v1.y));
|
return 0.5 * (v1.x * ((double)v3.y - v2.y) + v2.x * ((double)v1.y - v3.y) + v3.x * ((double)v2.y - v1.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,70 +100,70 @@ inline double GetArea2D(const T& v1, const T& v2, const T& v3)
|
||||||
* @note Code taken from http://cgm.cs.mcgill.ca/~godfried/teaching/cg-projects/97/Ian/applet1.html and translated to C++
|
* @note Code taken from http://cgm.cs.mcgill.ca/~godfried/teaching/cg-projects/97/Ian/applet1.html and translated to C++
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline bool IsCCW(T* in, size_t npoints) {
|
inline bool IsCCW(T* in, size_t npoints) {
|
||||||
double aa, bb, cc, b, c, theta;
|
double aa, bb, cc, b, c, theta;
|
||||||
double convex_turn;
|
double convex_turn;
|
||||||
double convex_sum = 0;
|
double convex_sum = 0;
|
||||||
|
|
||||||
for (int i = 0; i < npoints - 2; i++) {
|
for (int i = 0; i < npoints - 2; i++) {
|
||||||
aa = ((in[i+2].x - in[i].x) * (in[i+2].x - in[i].x)) +
|
aa = ((in[i+2].x - in[i].x) * (in[i+2].x - in[i].x)) +
|
||||||
((-in[i+2].y + in[i].y) * (-in[i+2].y + in[i].y));
|
((-in[i+2].y + in[i].y) * (-in[i+2].y + in[i].y));
|
||||||
|
|
||||||
bb = ((in[i+1].x - in[i].x) * (in[i+1].x - in[i].x)) +
|
bb = ((in[i+1].x - in[i].x) * (in[i+1].x - in[i].x)) +
|
||||||
((-in[i+1].y + in[i].y) * (-in[i+1].y + in[i].y));
|
((-in[i+1].y + in[i].y) * (-in[i+1].y + in[i].y));
|
||||||
|
|
||||||
cc = ((in[i+2].x - in[i+1].x) *
|
cc = ((in[i+2].x - in[i+1].x) *
|
||||||
(in[i+2].x - in[i+1].x)) +
|
(in[i+2].x - in[i+1].x)) +
|
||||||
((-in[i+2].y + in[i+1].y) *
|
((-in[i+2].y + in[i+1].y) *
|
||||||
(-in[i+2].y + in[i+1].y));
|
(-in[i+2].y + in[i+1].y));
|
||||||
|
|
||||||
b = sqrt(bb);
|
b = sqrt(bb);
|
||||||
c = sqrt(cc);
|
c = sqrt(cc);
|
||||||
theta = acos((bb + cc - aa) / (2 * b * c));
|
theta = acos((bb + cc - aa) / (2 * b * c));
|
||||||
|
|
||||||
if (OnLeftSideOfLine2D(in[i],in[i+2],in[i+1])) {
|
if (OnLeftSideOfLine2D(in[i],in[i+2],in[i+1])) {
|
||||||
// if (convex(in[i].x, in[i].y,
|
// if (convex(in[i].x, in[i].y,
|
||||||
// in[i+1].x, in[i+1].y,
|
// in[i+1].x, in[i+1].y,
|
||||||
// in[i+2].x, in[i+2].y)) {
|
// in[i+2].x, in[i+2].y)) {
|
||||||
convex_turn = AI_MATH_PI_F - theta;
|
convex_turn = AI_MATH_PI_F - theta;
|
||||||
convex_sum += convex_turn;
|
convex_sum += convex_turn;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
convex_sum -= AI_MATH_PI_F - theta;
|
convex_sum -= AI_MATH_PI_F - theta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aa = ((in[1].x - in[npoints-2].x) *
|
aa = ((in[1].x - in[npoints-2].x) *
|
||||||
(in[1].x - in[npoints-2].x)) +
|
(in[1].x - in[npoints-2].x)) +
|
||||||
((-in[1].y + in[npoints-2].y) *
|
((-in[1].y + in[npoints-2].y) *
|
||||||
(-in[1].y + in[npoints-2].y));
|
(-in[1].y + in[npoints-2].y));
|
||||||
|
|
||||||
bb = ((in[0].x - in[npoints-2].x) *
|
bb = ((in[0].x - in[npoints-2].x) *
|
||||||
(in[0].x - in[npoints-2].x)) +
|
(in[0].x - in[npoints-2].x)) +
|
||||||
((-in[0].y + in[npoints-2].y) *
|
((-in[0].y + in[npoints-2].y) *
|
||||||
(-in[0].y + in[npoints-2].y));
|
(-in[0].y + in[npoints-2].y));
|
||||||
|
|
||||||
cc = ((in[1].x - in[0].x) * (in[1].x - in[0].x)) +
|
cc = ((in[1].x - in[0].x) * (in[1].x - in[0].x)) +
|
||||||
((-in[1].y + in[0].y) * (-in[1].y + in[0].y));
|
((-in[1].y + in[0].y) * (-in[1].y + in[0].y));
|
||||||
|
|
||||||
b = sqrt(bb);
|
b = sqrt(bb);
|
||||||
c = sqrt(cc);
|
c = sqrt(cc);
|
||||||
theta = acos((bb + cc - aa) / (2 * b * c));
|
theta = acos((bb + cc - aa) / (2 * b * c));
|
||||||
|
|
||||||
//if (convex(in[npoints-2].x, in[npoints-2].y,
|
//if (convex(in[npoints-2].x, in[npoints-2].y,
|
||||||
// in[0].x, in[0].y,
|
// in[0].x, in[0].y,
|
||||||
// in[1].x, in[1].y)) {
|
// in[1].x, in[1].y)) {
|
||||||
if (OnLeftSideOfLine2D(in[npoints-2],in[1],in[0])) {
|
if (OnLeftSideOfLine2D(in[npoints-2],in[1],in[0])) {
|
||||||
convex_turn = AI_MATH_PI_F - theta;
|
convex_turn = AI_MATH_PI_F - theta;
|
||||||
convex_sum += convex_turn;
|
convex_sum += convex_turn;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
convex_sum -= AI_MATH_PI_F - theta;
|
convex_sum -= AI_MATH_PI_F - theta;
|
||||||
}
|
}
|
||||||
|
|
||||||
return convex_sum >= (2 * AI_MATH_PI_F);
|
return convex_sum >= (2 * AI_MATH_PI_F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
/** Compute the normal of an arbitrary polygon in R3.
|
/** Compute the normal of an arbitrary polygon in R3.
|
||||||
*
|
*
|
||||||
|
|
|
@ -0,0 +1,229 @@
|
||||||
|
/*
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
Open Asset Import Library (ASSIMP)
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2006-2010, ASSIMP Development Team
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
with or without modification, are permitted provided that the following
|
||||||
|
conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer in the documentation and/or other
|
||||||
|
materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the ASSIMP team, nor the names of its
|
||||||
|
contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior
|
||||||
|
written permission of the ASSIMP Development Team.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @file ImporterRegistry.cpp
|
||||||
|
|
||||||
|
Central registry for all postprocessing steps available. Do not edit this file
|
||||||
|
directly (unless you are adding new steps), instead use the
|
||||||
|
corresponding preprocessor flag to selectively disable steps.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "AssimpPCH.h"
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS
|
||||||
|
# include "CalcTangentsProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_JOINVERTICES_PROCESS
|
||||||
|
# include "JoinVerticesProcess.h"
|
||||||
|
#endif
|
||||||
|
#if !(defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS && defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS && defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
|
||||||
|
# include "ConvertToLHProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_TRIANGULATE_PROCESS
|
||||||
|
# include "TriangulateProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS
|
||||||
|
# include "GenFaceNormalsProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS
|
||||||
|
# include "GenVertexNormalsProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_REMOVEVC_PROCESS
|
||||||
|
# include "RemoveVCProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS
|
||||||
|
# include "SplitLargeMeshes.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS
|
||||||
|
# include "PretransformVertices.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS
|
||||||
|
# include "LimitBoneWeightsProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
|
||||||
|
# include "ValidateDataStructure.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS
|
||||||
|
# include "ImproveCacheLocality.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS
|
||||||
|
# include "FixNormalsStep.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS
|
||||||
|
# include "RemoveRedundantMaterials.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS
|
||||||
|
# include "FindInvalidDataProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS
|
||||||
|
# include "FindDegenerates.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS
|
||||||
|
# include "SortByPTypeProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
|
||||||
|
# include "ComputeUVMappingProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
|
||||||
|
# include "TextureTransform.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS
|
||||||
|
# include "FindInstancesProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS
|
||||||
|
# include "OptimizeMeshes.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS
|
||||||
|
# include "OptimizeGraph.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_SPLITBYBONECOUNT_PROCESS
|
||||||
|
# include "SplitByBoneCountProcess.h"
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_DEBONE_PROCESS
|
||||||
|
# include "DeboneProcess.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Assimp {
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out)
|
||||||
|
{
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Add an instance of each post processing step here in the order
|
||||||
|
// of sequence it is executed. Steps that are added here are not
|
||||||
|
// validated - as RegisterPPStep() does - all dependencies must be given.
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
out.reserve(25);
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_REMOVEVC_PROCESS)
|
||||||
|
out.push_back( new RemoveVCProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS)
|
||||||
|
out.push_back( new RemoveRedundantMatsProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS)
|
||||||
|
out.push_back( new FindInstancesProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS)
|
||||||
|
out.push_back( new OptimizeGraphProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS)
|
||||||
|
out.push_back( new OptimizeMeshesProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS)
|
||||||
|
out.push_back( new FindDegeneratesProcess());
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
|
||||||
|
out.push_back( new ComputeUVMappingProcess());
|
||||||
|
#endif
|
||||||
|
#ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
|
||||||
|
out.push_back( new TextureTransformStep());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS)
|
||||||
|
out.push_back( new PretransformVertices());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_TRIANGULATE_PROCESS)
|
||||||
|
out.push_back( new TriangulateProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS)
|
||||||
|
out.push_back( new SortByPTypeProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS)
|
||||||
|
out.push_back( new FindInvalidDataProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS)
|
||||||
|
out.push_back( new FixInfacingNormalsProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_SPLITBYBONECOUNT_PROCESS)
|
||||||
|
out.push_back( new SplitByBoneCountProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
|
||||||
|
out.push_back( new SplitLargeMeshesProcess_Triangle());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS)
|
||||||
|
out.push_back( new GenFaceNormalsProcess());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// .........................................................................
|
||||||
|
// DON'T change the order of these five ..
|
||||||
|
// XXX this is actually a design weakness that dates back to the time
|
||||||
|
// when Importer would maintain the postprocessing step list exclusively.
|
||||||
|
// Now that others access it too, we need a better solution.
|
||||||
|
out.push_back( new ComputeSpatialSortProcess());
|
||||||
|
// .........................................................................
|
||||||
|
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS)
|
||||||
|
out.push_back( new GenVertexNormalsProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS)
|
||||||
|
out.push_back( new CalcTangentsProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_JOINVERTICES_PROCESS)
|
||||||
|
out.push_back( new JoinVerticesProcess());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// .........................................................................
|
||||||
|
out.push_back( new DestroySpatialSortProcess());
|
||||||
|
// .........................................................................
|
||||||
|
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
|
||||||
|
out.push_back( new SplitLargeMeshesProcess_Vertex());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS)
|
||||||
|
out.push_back( new MakeLeftHandedProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS)
|
||||||
|
out.push_back( new FlipUVsProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
|
||||||
|
out.push_back( new FlipWindingOrderProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_DEBONE_PROCESS)
|
||||||
|
out.push_back( new DeboneProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS)
|
||||||
|
out.push_back( new LimitBoneWeightsProcess());
|
||||||
|
#endif
|
||||||
|
#if (!defined ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS)
|
||||||
|
out.push_back( new ImproveCacheLocalityProcess());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -58,14 +58,9 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API PretransformVertices : public BaseProcess
|
class ASSIMP_API PretransformVertices : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::PretransformVerticesTest;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
PretransformVertices ();
|
PretransformVertices ();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~PretransformVertices ();
|
~PretransformVertices ();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -58,11 +58,10 @@ struct sQ3BSPFace;
|
||||||
/** Loader to import BSP-levels from a PK3 archive or from a unpacked BSP-level.
|
/** Loader to import BSP-levels from a PK3 archive or from a unpacked BSP-level.
|
||||||
*/
|
*/
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
class Q3BSPFileImporter : BaseImporter
|
class Q3BSPFileImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/// @brief Default constructor.
|
/// @brief Default constructor.
|
||||||
Q3BSPFileImporter();
|
Q3BSPFileImporter();
|
||||||
|
|
||||||
|
|
|
@ -55,15 +55,11 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class Q3DImporter : public BaseImporter
|
class Q3DImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
Q3DImporter();
|
Q3DImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~Q3DImporter();
|
~Q3DImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -55,15 +55,11 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class RAWImporter : public BaseImporter
|
class RAWImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
RAWImporter();
|
RAWImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~RAWImporter();
|
~RAWImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -56,14 +56,9 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API RemoveRedundantMatsProcess : public BaseProcess
|
class ASSIMP_API RemoveRedundantMatsProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::RemoveRedundantMatsTest; // grant the unit test full access to us
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
RemoveRedundantMatsProcess();
|
RemoveRedundantMatsProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~RemoveRedundantMatsProcess();
|
~RemoveRedundantMatsProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -54,14 +54,9 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API RemoveVCProcess : public BaseProcess
|
class ASSIMP_API RemoveVCProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::RemoveVCProcessTest;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
RemoveVCProcess();
|
RemoveVCProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~RemoveVCProcess();
|
~RemoveVCProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -172,15 +172,11 @@ struct Bone
|
||||||
*/
|
*/
|
||||||
class SMDImporter : public BaseImporter
|
class SMDImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
SMDImporter();
|
SMDImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~SMDImporter();
|
~SMDImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -54,15 +54,11 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class STLImporter : public BaseImporter
|
class STLImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
STLImporter();
|
STLImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~STLImporter();
|
~STLImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -882,7 +882,7 @@ void SceneCombiner::MergeMeshes(aiMesh** _out,unsigned int /*flags*/,
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
inline void CopyPtrArray (Type**& dest, Type** src, unsigned int num)
|
inline void CopyPtrArray (Type**& dest, const Type* const * src, unsigned int num)
|
||||||
{
|
{
|
||||||
if (!num)
|
if (!num)
|
||||||
{
|
{
|
||||||
|
@ -890,8 +890,9 @@ inline void CopyPtrArray (Type**& dest, Type** src, unsigned int num)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dest = new Type*[num];
|
dest = new Type*[num];
|
||||||
for (unsigned int i = 0; i < num;++i)
|
for (unsigned int i = 0; i < num;++i) {
|
||||||
SceneCombiner::Copy(&dest[i],src[i]);
|
SceneCombiner::Copy(&dest[i],src[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -906,7 +907,7 @@ inline void GetArrayCopy (Type*& dest, unsigned int num )
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void SceneCombiner::CopySceneFlat(aiScene** _dest,aiScene* src)
|
void SceneCombiner::CopySceneFlat(aiScene** _dest,const aiScene* src)
|
||||||
{
|
{
|
||||||
// reuse the old scene or allocate a new?
|
// reuse the old scene or allocate a new?
|
||||||
if (*_dest)(*_dest)->~aiScene();
|
if (*_dest)(*_dest)->~aiScene();
|
||||||
|
@ -916,7 +917,7 @@ void SceneCombiner::CopySceneFlat(aiScene** _dest,aiScene* src)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void SceneCombiner::CopyScene(aiScene** _dest,aiScene* src)
|
void SceneCombiner::CopyScene(aiScene** _dest,const aiScene* src)
|
||||||
{
|
{
|
||||||
ai_assert(NULL != _dest && NULL != src);
|
ai_assert(NULL != _dest && NULL != src);
|
||||||
|
|
||||||
|
|
|
@ -303,7 +303,7 @@ public:
|
||||||
* @param dest Receives a pointer to the destination scene
|
* @param dest Receives a pointer to the destination scene
|
||||||
* @param src Source scene - remains unmodified.
|
* @param src Source scene - remains unmodified.
|
||||||
*/
|
*/
|
||||||
static void CopyScene(aiScene** dest,aiScene* source);
|
static void CopyScene(aiScene** dest,const aiScene* source);
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
@ -316,7 +316,7 @@ public:
|
||||||
* @param dest Receives a pointer to the destination scene
|
* @param dest Receives a pointer to the destination scene
|
||||||
* @param src Source scene - remains unmodified.
|
* @param src Source scene - remains unmodified.
|
||||||
*/
|
*/
|
||||||
static void CopySceneFlat(aiScene** dest,aiScene* source);
|
static void CopySceneFlat(aiScene** dest,const aiScene* source);
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
/*
|
||||||
|
Open Asset Import Library (ASSIMP)
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2006-2010, ASSIMP Development Team
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
with or without modification, are permitted provided that the
|
||||||
|
following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer in the documentation and/or other
|
||||||
|
materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the ASSIMP team, nor the names of its
|
||||||
|
contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior
|
||||||
|
written permission of the ASSIMP Development Team.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @file Stuff to deal with aiScene::mPrivate
|
||||||
|
*/
|
||||||
|
#ifndef AI_SCENEPRIVATE_H_INCLUDED
|
||||||
|
#define AI_SCENEPRIVATE_H_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
|
namespace Assimp {
|
||||||
|
|
||||||
|
struct ScenePrivateData {
|
||||||
|
|
||||||
|
ScenePrivateData()
|
||||||
|
: mPPStepsApplied()
|
||||||
|
{}
|
||||||
|
|
||||||
|
// List of postprocessing steps already applied to the scene.
|
||||||
|
unsigned int mPPStepsApplied;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Access private data stored in the scene
|
||||||
|
inline ScenePrivateData* ScenePriv(aiScene* in) {
|
||||||
|
return static_cast<ScenePrivateData*>(in->mPrivate);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const ScenePrivateData* ScenePriv(const aiScene* in) {
|
||||||
|
return static_cast<const ScenePrivateData*>(in->mPrivate);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -57,14 +57,9 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API SortByPTypeProcess : public BaseProcess
|
class ASSIMP_API SortByPTypeProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::SortByPTypeProcessTest; // grant the unit test full access to us
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
SortByPTypeProcess();
|
SortByPTypeProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~SortByPTypeProcess();
|
~SortByPTypeProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -61,13 +61,9 @@ namespace Assimp
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API SplitByBoneCountProcess : public BaseProcess
|
class ASSIMP_API SplitByBoneCountProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
SplitByBoneCountProcess();
|
SplitByBoneCountProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~SplitByBoneCountProcess();
|
~SplitByBoneCountProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -83,15 +83,11 @@ class SplitLargeMeshesProcess_Vertex;
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API SplitLargeMeshesProcess_Triangle : public BaseProcess
|
class ASSIMP_API SplitLargeMeshesProcess_Triangle : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
|
||||||
friend class SplitLargeMeshesProcess_Vertex;
|
friend class SplitLargeMeshesProcess_Vertex;
|
||||||
friend class ::SplitLargeMeshesTest;
|
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
SplitLargeMeshesProcess_Triangle();
|
SplitLargeMeshesProcess_Triangle();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~SplitLargeMeshesProcess_Triangle();
|
~SplitLargeMeshesProcess_Triangle();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -155,14 +151,9 @@ public:
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API SplitLargeMeshesProcess_Vertex : public BaseProcess
|
class ASSIMP_API SplitLargeMeshesProcess_Vertex : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::SplitLargeMeshesTest;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
SplitLargeMeshesProcess_Vertex();
|
SplitLargeMeshesProcess_Vertex();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~SplitLargeMeshesProcess_Vertex();
|
~SplitLargeMeshesProcess_Vertex();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -69,15 +69,11 @@ namespace Assimp {
|
||||||
*/
|
*/
|
||||||
class TerragenImporter : public BaseImporter
|
class TerragenImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
TerragenImporter();
|
TerragenImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~TerragenImporter();
|
~TerragenImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -195,6 +195,8 @@ public:
|
||||||
TextureTransformStep();
|
TextureTransformStep();
|
||||||
~TextureTransformStep();
|
~TextureTransformStep();
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
bool IsActive( unsigned int pFlags) const;
|
bool IsActive( unsigned int pFlags) const;
|
||||||
|
|
||||||
|
|
|
@ -59,14 +59,9 @@ namespace Assimp
|
||||||
*/
|
*/
|
||||||
class ASSIMP_API TriangulateProcess : public BaseProcess
|
class ASSIMP_API TriangulateProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
friend class ::TriangulateProcessTest; // grant the unit test full access to us
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
TriangulateProcess();
|
TriangulateProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~TriangulateProcess();
|
~TriangulateProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -145,15 +145,11 @@ inline void DecompressVertex(aiVector3D& v, int32_t in)
|
||||||
*/
|
*/
|
||||||
class UnrealImporter : public BaseImporter
|
class UnrealImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
UnrealImporter();
|
UnrealImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~UnrealImporter();
|
~UnrealImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -64,13 +64,9 @@ namespace Assimp {
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
class ASSIMP_API ValidateDSProcess : public BaseProcess
|
class ASSIMP_API ValidateDSProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
ValidateDSProcess();
|
ValidateDSProcess();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~ValidateDSProcess();
|
~ValidateDSProcess();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -66,15 +66,11 @@ struct Node;
|
||||||
*/
|
*/
|
||||||
class XFileImporter : public BaseImporter
|
class XFileImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
friend class Importer;
|
public:
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Constructor to be privately used by Importer */
|
|
||||||
XFileImporter();
|
XFileImporter();
|
||||||
|
|
||||||
/** Destructor, private as well */
|
|
||||||
~XFileImporter();
|
~XFileImporter();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Returns whether the class can handle the format of the given file.
|
/** Returns whether the class can handle the format of the given file.
|
||||||
|
|
3479
code/makefile
3479
code/makefile
File diff suppressed because it is too large
Load Diff
|
@ -327,59 +327,11 @@ struct aiScene
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
//! Default constructor
|
//! Default constructor - set everything to 0/NULL
|
||||||
aiScene()
|
aiScene();
|
||||||
{
|
|
||||||
// set all members to zero by default
|
|
||||||
mRootNode = NULL;
|
|
||||||
mNumMeshes = 0; mMeshes = NULL;
|
|
||||||
mNumMaterials = 0; mMaterials = NULL;
|
|
||||||
mNumAnimations = 0; mAnimations = NULL;
|
|
||||||
mNumTextures = 0; mTextures = NULL;
|
|
||||||
mNumCameras = 0; mCameras = NULL;
|
|
||||||
mNumLights = 0; mLights = NULL;
|
|
||||||
mFlags = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
~aiScene()
|
~aiScene();
|
||||||
{
|
|
||||||
// delete all sub-objects recursively
|
|
||||||
delete mRootNode;
|
|
||||||
|
|
||||||
// To make sure we won't crash if the data is invalid it's
|
|
||||||
// much better to check whether both mNumXXX and mXXX are
|
|
||||||
// valid instead of relying on just one of them.
|
|
||||||
if (mNumMeshes && mMeshes)
|
|
||||||
for( unsigned int a = 0; a < mNumMeshes; a++)
|
|
||||||
delete mMeshes[a];
|
|
||||||
delete [] mMeshes;
|
|
||||||
|
|
||||||
if (mNumMaterials && mMaterials)
|
|
||||||
for( unsigned int a = 0; a < mNumMaterials; a++)
|
|
||||||
delete mMaterials[a];
|
|
||||||
delete [] mMaterials;
|
|
||||||
|
|
||||||
if (mNumAnimations && mAnimations)
|
|
||||||
for( unsigned int a = 0; a < mNumAnimations; a++)
|
|
||||||
delete mAnimations[a];
|
|
||||||
delete [] mAnimations;
|
|
||||||
|
|
||||||
if (mNumTextures && mTextures)
|
|
||||||
for( unsigned int a = 0; a < mNumTextures; a++)
|
|
||||||
delete mTextures[a];
|
|
||||||
delete [] mTextures;
|
|
||||||
|
|
||||||
if (mNumLights && mLights)
|
|
||||||
for( unsigned int a = 0; a < mNumLights; a++)
|
|
||||||
delete mLights[a];
|
|
||||||
delete [] mLights;
|
|
||||||
|
|
||||||
if (mNumCameras && mCameras)
|
|
||||||
for( unsigned int a = 0; a < mNumCameras; a++)
|
|
||||||
delete mCameras[a];
|
|
||||||
delete [] mCameras;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Check whether the scene contains meshes
|
//! Check whether the scene contains meshes
|
||||||
//! Unless no special scene flags are set this will always be true.
|
//! Unless no special scene flags are set this will always be true.
|
||||||
|
@ -408,6 +360,15 @@ struct aiScene
|
||||||
{ return mAnimations != NULL && mNumAnimations > 0; }
|
{ return mAnimations != NULL && mNumAnimations > 0; }
|
||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
|
||||||
|
// internal scene data, do not touch
|
||||||
|
#ifdef __cplusplus
|
||||||
|
void* mPrivate;
|
||||||
|
#else
|
||||||
|
char* mPrivate;
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -136,15 +136,38 @@ struct aiExportDataBlob
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
/** Exports the given scene to a chosen file format and writes the result file(s) to disk.
|
/** Exports the given scene to a chosen file format and writes the result file(s) to disk.
|
||||||
* @param pScene The scene to export. Stays in possession of the caller, is not changed by the function.
|
* @param pScene The scene to export. Stays in possession of the caller, is not changed by the function.
|
||||||
|
* The scene is expected to conform to Assimp's Importer output format as specified
|
||||||
|
* in the @link data Data Structures Page @endlink. In short, this means the model data
|
||||||
|
* should use a right-handed coordinate systems, face winding should be counter-clockwise
|
||||||
|
* and the UV coordinate origin is assumed to be in the upper left. If your input data
|
||||||
|
* uses different conventions, have a look at the last parameter.
|
||||||
* @param pFormatId ID string to specify to which format you want to export to. Use
|
* @param pFormatId ID string to specify to which format you want to export to. Use
|
||||||
* aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available.
|
* aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available.
|
||||||
* @param pFileName Output file to write
|
* @param pFileName Output file to write
|
||||||
* @param pIO custom IO implementation to be used. Use this if you use your own storage methods.
|
* @param pIO custom IO implementation to be used. Use this if you use your own storage methods.
|
||||||
* If none is supplied, a default implementation using standard file IO is used. Note that
|
* If none is supplied, a default implementation using standard file IO is used. Note that
|
||||||
* #aiExportSceneToBlob is provided as convienience function to export to memory buffers.
|
* #aiExportSceneToBlob is provided as convenience function to export to memory buffers.
|
||||||
|
* @param pPreprocessing Accepts any choice of the #aiPostProcessing enumerated
|
||||||
|
* flags, but in reality only a subset of them makes sense here. Specifying
|
||||||
|
* 'preprocessing' flags is useful if the input scene does not conform to
|
||||||
|
* Assimp's default conventions as specified in the @link data Data Structures Page @endlink.
|
||||||
|
* In short, this means the geometry data should use a right-handed coordinate systems, face
|
||||||
|
* winding should be counter-clockwise and the UV coordinate origin is assumed to be in
|
||||||
|
* the upper left. The #aiProcess_MakeLeftHanded, #aiProcess_FlipUVs and
|
||||||
|
* #aiProcess_FlipWindingOrder flags are used in the import side to allow users
|
||||||
|
* to have those defaults automatically adapted to their conventions. Specifying those flags
|
||||||
|
* for exporting has the opposite effect, respectively. Some other of the
|
||||||
|
* #aiPostProcessSteps enumerated values may be useful as well, but you'll need
|
||||||
|
* to try out what their effect on the exported file is. Many formats impose
|
||||||
|
* their own restrictions on the structure of the geometry stored therein,
|
||||||
|
* so some preprocessing may have little or no effect at all, or may be
|
||||||
|
* redundant as exporters would apply them anyhow. A good example
|
||||||
|
* is triangulation - whilst you can enforce it by specifying
|
||||||
|
* the #aiProcess_Triangulate flag, most export formats support only
|
||||||
|
* triangulate data so they would run the step even if it wasn't requested.
|
||||||
* @return a status code indicating the result of the export
|
* @return a status code indicating the result of the export
|
||||||
*/
|
*/
|
||||||
ASSIMP_API aiReturn aiExportScene( const C_STRUCT aiScene* pScene, const char* pFormatId, const char* pFileName);
|
ASSIMP_API aiReturn aiExportScene( const C_STRUCT aiScene* pScene, const char* pFormatId, const char* pFileName, unsigned int pPreprocessing);
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
|
@ -156,9 +179,10 @@ ASSIMP_API aiReturn aiExportScene( const C_STRUCT aiScene* pScene, const char* p
|
||||||
* @param pIO custom IO implementation to be used. Use this if you use your own storage methods.
|
* @param pIO custom IO implementation to be used. Use this if you use your own storage methods.
|
||||||
* If none is supplied, a default implementation using standard file IO is used. Note that
|
* If none is supplied, a default implementation using standard file IO is used. Note that
|
||||||
* #aiExportSceneToBlob is provided as convienience function to export to memory buffers.
|
* #aiExportSceneToBlob is provided as convienience function to export to memory buffers.
|
||||||
|
* @param pPreprocessing Please see the documentation for #aiExportScene
|
||||||
* @return a status code indicating the result of the export
|
* @return a status code indicating the result of the export
|
||||||
*/
|
*/
|
||||||
ASSIMP_API aiReturn aiExportSceneEx( const C_STRUCT aiScene* pScene, const char* pFormatId, const char* pFileName, C_STRUCT aiFileIO* pIO );
|
ASSIMP_API aiReturn aiExportSceneEx( const C_STRUCT aiScene* pScene, const char* pFormatId, const char* pFileName, C_STRUCT aiFileIO* pIO, unsigned int pPreprocessing );
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
/** Exports the given scene to a chosen file format. Returns the exported data as a binary blob which
|
/** Exports the given scene to a chosen file format. Returns the exported data as a binary blob which
|
||||||
|
@ -167,9 +191,10 @@ ASSIMP_API aiReturn aiExportSceneEx( const C_STRUCT aiScene* pScene, const char*
|
||||||
* @param pScene The scene to export. Stays in possession of the caller, is not changed by the function.
|
* @param pScene The scene to export. Stays in possession of the caller, is not changed by the function.
|
||||||
* @param pFormatId ID string to specify to which format you want to export to. Use
|
* @param pFormatId ID string to specify to which format you want to export to. Use
|
||||||
* aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available.
|
* aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available.
|
||||||
|
* @param pPreprocessing Please see the documentation for #aiExportScene
|
||||||
* @return the exported data or NULL in case of error
|
* @return the exported data or NULL in case of error
|
||||||
*/
|
*/
|
||||||
ASSIMP_API const C_STRUCT aiExportDataBlob* aiExportSceneToBlob( const C_STRUCT aiScene* pScene, const char* pFormatId );
|
ASSIMP_API const C_STRUCT aiExportDataBlob* aiExportSceneToBlob( const C_STRUCT aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -134,12 +134,13 @@ public:
|
||||||
* export to. Use
|
* export to. Use
|
||||||
* #GetExportFormatCount / #GetExportFormatDescription to learn which
|
* #GetExportFormatCount / #GetExportFormatDescription to learn which
|
||||||
* export formats are available.
|
* export formats are available.
|
||||||
|
* @param pPreprocessing See the documentation for #Export
|
||||||
* @return the exported data or NULL in case of error.
|
* @return the exported data or NULL in case of error.
|
||||||
* @note If the Exporter instance did already hold a blob from
|
* @note If the Exporter instance did already hold a blob from
|
||||||
* a previous call to #ExportToBlob, it will be disposed.
|
* a previous call to #ExportToBlob, it will be disposed.
|
||||||
* Any IO handlers set via #SetIOHandler are ignored here.*/
|
* Any IO handlers set via #SetIOHandler are ignored here.*/
|
||||||
const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const char* pFormatId );
|
const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing = 0u );
|
||||||
inline const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const std::string& pFormatId );
|
inline const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const std::string& pFormatId, unsigned int pPreprocessing = 0u );
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
@ -148,9 +149,27 @@ public:
|
||||||
* about the output data flow of the export process.
|
* about the output data flow of the export process.
|
||||||
* @param pBlob A data blob obtained from a previous call to #aiExportScene. Must not be NULL.
|
* @param pBlob A data blob obtained from a previous call to #aiExportScene. Must not be NULL.
|
||||||
* @param pPath Full target file name. Target must be accessible.
|
* @param pPath Full target file name. Target must be accessible.
|
||||||
|
* @param pPreprocessing Accepts any choice of the #aiPostProcessing enumerated
|
||||||
|
* flags, but in reality only a subset of them makes sense here. Specifying
|
||||||
|
* 'preprocessing' flags is useful if the input scene does not conform to
|
||||||
|
* Assimp's default conventions as specified in the @link data Data Structures Page @endlink.
|
||||||
|
* In short, this means the geometry data should use a right-handed coordinate systems, face
|
||||||
|
* winding should be counter-clockwise and the UV coordinate origin is assumed to be in
|
||||||
|
* the upper left. The #aiProcess_MakeLeftHanded, #aiProcess_FlipUVs and
|
||||||
|
* #aiProcess_FlipWindingOrder flags are used in the import side to allow users
|
||||||
|
* to have those defaults automatically adapted to their conventions. Specifying those flags
|
||||||
|
* for exporting has the opposite effect, respectively. Some other of the
|
||||||
|
* #aiPostProcessSteps enumerated values may be useful as well, but you'll need
|
||||||
|
* to try out what their effect on the exported file is. Many formats impose
|
||||||
|
* their own restrictions on the structure of the geometry stored therein,
|
||||||
|
* so some preprocessing may have little or no effect at all, or may be
|
||||||
|
* redundant as exporters would apply them anyhow. A good example
|
||||||
|
* is triangulation - whilst you can enforce it by specifying
|
||||||
|
* the #aiProcess_Triangulate flag, most export formats support only
|
||||||
|
* triangulate data so they would run the step even if it wasn't requested.
|
||||||
* @return AI_SUCCESS if everything was fine. */
|
* @return AI_SUCCESS if everything was fine. */
|
||||||
aiReturn Export( const aiScene* pScene, const char* pFormatId, const char* pPath );
|
aiReturn Export( const aiScene* pScene, const char* pFormatId, const char* pPath, unsigned int pPreprocessing = 0u);
|
||||||
inline aiReturn Export( const aiScene* pScene, const std::string& pFormatId, const std::string& pPath );
|
inline aiReturn Export( const aiScene* pScene, const std::string& pFormatId, const std::string& pPath, unsigned int pPreprocessing = 0u);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -192,15 +211,15 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
inline const aiExportDataBlob* Exporter :: ExportToBlob( const aiScene* pScene, const std::string& pFormatId )
|
inline const aiExportDataBlob* Exporter :: ExportToBlob( const aiScene* pScene, const std::string& pFormatId,unsigned int pPreprocessing )
|
||||||
{
|
{
|
||||||
return ExportToBlob(pScene,pFormatId.c_str());
|
return ExportToBlob(pScene,pFormatId.c_str(),pPreprocessing);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
inline aiReturn Exporter :: Export( const aiScene* pScene, const std::string& pFormatId, const std::string& pPath )
|
inline aiReturn Exporter :: Export( const aiScene* pScene, const std::string& pFormatId, const std::string& pPath, unsigned int pPreprocessing )
|
||||||
{
|
{
|
||||||
return Export(pScene,pFormatId.c_str(),pPath.c_str());
|
return Export(pScene,pFormatId.c_str(),pPath.c_str(),pPreprocessing);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Assimp
|
} // namespace Assimp
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue