Copy constructor ExportProperties

Fix name dummy node in PreTransformVertices
pull/493/head
Madrich 2015-03-14 19:03:44 +01:00
parent 290a16eea5
commit 56da80bc6e
5 changed files with 18 additions and 24 deletions

View File

@ -492,18 +492,17 @@ void Exporter :: UnregisterExporter(const char* id)
}
}
ExportProperties :: ExportProperties()
{
ExportProperties :: ExportProperties() {}
}
ExportProperties :: ExportProperties(const ExportProperties* source)
ExportProperties::ExportProperties(const ExportProperties &other)
{
if (!source) return;
mIntProperties = IntPropertyMap(source->mIntProperties);
mFloatProperties = FloatPropertyMap(source->mFloatProperties);
mStringProperties = StringPropertyMap(source->mStringProperties);
mMatrixProperties = MatrixPropertyMap(source->mMatrixProperties);
new(this) ExportProperties();
mIntProperties = other.mIntProperties;
mFloatProperties = other.mFloatProperties;
mStringProperties = other.mStringProperties;
mMatrixProperties = other.mMatrixProperties;
}

View File

@ -625,7 +625,7 @@ void PretransformVertices::Execute( aiScene* pScene)
// flat node graph with a root node and some level 1 children
delete pScene->mRootNode;
pScene->mRootNode = new aiNode();
pScene->mRootNode->mName.Set("<dummy_root>");
pScene->mRootNode->mName.Set("dummy_root");
if (1 == pScene->mNumMeshes && !pScene->mNumLights && !pScene->mNumCameras)
{

View File

@ -79,11 +79,10 @@ void ExportSceneXFile(const char* pFile,IOSystem* pIOSystem, const aiScene* pSce
}
// create/copy Properties
ExportProperties props(pProperties);
ExportProperties props(*pProperties);
// set standard properties if not set
if (!props.HasPropertyBool(AI_CONFIG_EXPORT_XFILE_64BIT)) props.SetPropertyBool(AI_CONFIG_EXPORT_XFILE_64BIT, false);
if (!props.HasPropertyBool(AI_CONFIG_EXPORT_XFILE_BAKETRANSFORM)) props.SetPropertyBool(AI_CONFIG_EXPORT_XFILE_BAKETRANSFORM, false);
// invoke the exporter
XFileExporter iDoTheExportThing( pScene, pIOSystem, path, file, &props);

View File

@ -334,11 +334,13 @@ public:
ExportProperties();
/** Copy constructor
* @see ExportProperties(const ExportProperties* source)
*/
ExportProperties(const ExportProperties* source);
// -------------------------------------------------------------------
/** Copy constructor.
*
* This copies the configuration properties of another ExportProperties.
* @see ExportProperties(const ExportProperties& other)
*/
ExportProperties(const ExportProperties& other);
// -------------------------------------------------------------------
/** Set an integer configuration property.

View File

@ -889,11 +889,5 @@ enum aiComponent
#define AI_CONFIG_EXPORT_XFILE_64BIT "EXPORT_XFILE_64BIT"
/** @brief Specifies the xfile applies all transformations to the coordinates, normals
* so all motions are identities
* Property type: Bool. Default value: false.
*/
#define AI_CONFIG_EXPORT_XFILE_BAKETRANSFORM "EXPORT_XFILE_BAKETRANSFORM"
#endif // !! AI_CONFIG_H_INC