# fix unit tests, although static linkage to Assimp is a requirement or symbols will be missing. This involves declaring some members of certain pp step classes public to give the tests access to them. Those are harmless and completely safe to use from outside, though.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1092 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/3/head
parent
6dc3bc1c88
commit
3d00f36faf
|
@ -78,7 +78,7 @@ public:
|
||||||
// Run the step
|
// Run the step
|
||||||
void Execute( aiScene* pScene);
|
void Execute( aiScene* pScene);
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Executes the postprocessing step on the given mesh
|
/** Executes the postprocessing step on the given mesh
|
||||||
|
|
|
@ -91,7 +91,7 @@ public:
|
||||||
configMaxAngle =f;
|
configMaxAngle =f;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Computes normals for a specific mesh
|
/** Computes normals for a specific mesh
|
||||||
|
|
|
@ -82,7 +82,7 @@ public:
|
||||||
*/
|
*/
|
||||||
void Execute( aiScene* pScene);
|
void Execute( aiScene* pScene);
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Unites identical vertices in the given mesh.
|
/** Unites identical vertices in the given mesh.
|
||||||
* @param pMesh The mesh to process.
|
* @param pMesh The mesh to process.
|
||||||
|
|
|
@ -93,7 +93,7 @@ public:
|
||||||
*/
|
*/
|
||||||
void SetupProperties(const Importer* pImp);
|
void SetupProperties(const Importer* pImp);
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Limits the bone weight count for all vertices in the given mesh.
|
/** Limits the bone weight count for all vertices in the given mesh.
|
||||||
|
@ -109,7 +109,7 @@ protected:
|
||||||
void Execute( aiScene* pScene);
|
void Execute( aiScene* pScene);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Describes a bone weight on a vertex */
|
/** Describes a bone weight on a vertex */
|
||||||
|
|
|
@ -117,7 +117,7 @@ public:
|
||||||
inline unsigned int GetLimit() const
|
inline unsigned int GetLimit() const
|
||||||
{return LIMIT;}
|
{return LIMIT;}
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Executes the post processing step on the given imported data.
|
/** Executes the post processing step on the given imported data.
|
||||||
|
@ -181,7 +181,7 @@ public:
|
||||||
inline unsigned int GetLimit() const
|
inline unsigned int GetLimit() const
|
||||||
{return LIMIT;}
|
{return LIMIT;}
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Executes the post processing step on the given imported data.
|
/** Executes the post processing step on the given imported data.
|
||||||
|
|
|
@ -80,7 +80,7 @@ public:
|
||||||
*/
|
*/
|
||||||
void Execute( aiScene* pScene);
|
void Execute( aiScene* pScene);
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Triangulates the given mesh.
|
/** Triangulates the given mesh.
|
||||||
* @param pMesh The mesh to triangulate.
|
* @param pMesh The mesh to triangulate.
|
||||||
|
|
|
@ -8,7 +8,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION (MaterialSystemTest);
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void MaterialSystemTest :: setUp (void)
|
void MaterialSystemTest :: setUp (void)
|
||||||
{
|
{
|
||||||
this->pcMat = new MaterialHelper();
|
this->pcMat = new aiMaterial();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -39,7 +39,7 @@ class MaterialSystemTest : public CPPUNIT_NS :: TestFixture
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
MaterialHelper* pcMat;
|
aiMaterial* pcMat;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -36,7 +36,7 @@ void PretransformVerticesTest :: setUp (void)
|
||||||
// add 5 empty materials
|
// add 5 empty materials
|
||||||
scene->mMaterials = new aiMaterial*[scene->mNumMaterials = 5];
|
scene->mMaterials = new aiMaterial*[scene->mNumMaterials = 5];
|
||||||
for (unsigned int i = 0; i < 5;++i)
|
for (unsigned int i = 0; i < 5;++i)
|
||||||
scene->mMaterials[i] = new MaterialHelper();
|
scene->mMaterials[i] = new aiMaterial();
|
||||||
|
|
||||||
// add 25 test meshes
|
// add 25 test meshes
|
||||||
scene->mMeshes = new aiMesh*[scene->mNumMeshes = 25];
|
scene->mMeshes = new aiMesh*[scene->mNumMeshes = 25];
|
||||||
|
|
|
@ -36,8 +36,8 @@ void RemoveVCProcessTest :: setUp (void)
|
||||||
pScene->mTextures[1] = new aiTexture();
|
pScene->mTextures[1] = new aiTexture();
|
||||||
|
|
||||||
pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials = 2];
|
pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials = 2];
|
||||||
pScene->mMaterials[0] = new MaterialHelper();
|
pScene->mMaterials[0] = new aiMaterial();
|
||||||
pScene->mMaterials[1] = new MaterialHelper();
|
pScene->mMaterials[1] = new aiMaterial();
|
||||||
|
|
||||||
pScene->mLights = new aiLight*[pScene->mNumLights = 2];
|
pScene->mLights = new aiLight*[pScene->mNumLights = 2];
|
||||||
pScene->mLights[0] = new aiLight();
|
pScene->mLights[0] = new aiLight();
|
||||||
|
@ -47,9 +47,9 @@ void RemoveVCProcessTest :: setUp (void)
|
||||||
pScene->mCameras[0] = new aiCamera();
|
pScene->mCameras[0] = new aiCamera();
|
||||||
pScene->mCameras[1] = new aiCamera();
|
pScene->mCameras[1] = new aiCamera();
|
||||||
|
|
||||||
// COMPILE TEST: MaterialHelper may no add any extra members,
|
// COMPILE TEST: aiMaterial may no add any extra members,
|
||||||
// so we don't need a virtual destructor
|
// so we don't need a virtual destructor
|
||||||
char check[sizeof(MaterialHelper) == sizeof(aiMaterial) ? 10 : -1];
|
char check[sizeof(aiMaterial) == sizeof(aiMaterial) ? 10 : -1];
|
||||||
check[0] = 0;
|
check[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ aiMaterial* getUniqueMaterial1()
|
||||||
aiString mTemp;
|
aiString mTemp;
|
||||||
mTemp.Set("UniqueMat1");
|
mTemp.Set("UniqueMat1");
|
||||||
|
|
||||||
MaterialHelper* pcMat = new MaterialHelper();
|
aiMaterial* pcMat = new aiMaterial();
|
||||||
pcMat->AddProperty(&mTemp,AI_MATKEY_NAME);
|
pcMat->AddProperty(&mTemp,AI_MATKEY_NAME);
|
||||||
float f = 2.0f;
|
float f = 2.0f;
|
||||||
pcMat->AddProperty<float>(&f, 1, AI_MATKEY_BUMPSCALING);
|
pcMat->AddProperty<float>(&f, 1, AI_MATKEY_BUMPSCALING);
|
||||||
|
@ -27,7 +27,7 @@ aiMaterial* getUniqueMaterial2()
|
||||||
aiString mTemp;
|
aiString mTemp;
|
||||||
mTemp.Set("Unique Mat2");
|
mTemp.Set("Unique Mat2");
|
||||||
|
|
||||||
MaterialHelper* pcMat = new MaterialHelper();
|
aiMaterial* pcMat = new aiMaterial();
|
||||||
pcMat->AddProperty(&mTemp,AI_MATKEY_NAME);
|
pcMat->AddProperty(&mTemp,AI_MATKEY_NAME);
|
||||||
float f = 4.0f;int i = 1;
|
float f = 4.0f;int i = 1;
|
||||||
pcMat->AddProperty<float>(&f, 1, AI_MATKEY_BUMPSCALING);
|
pcMat->AddProperty<float>(&f, 1, AI_MATKEY_BUMPSCALING);
|
||||||
|
@ -42,7 +42,7 @@ aiMaterial* getUniqueMaterial3()
|
||||||
aiString mTemp;
|
aiString mTemp;
|
||||||
mTemp.Set("Complex material name");
|
mTemp.Set("Complex material name");
|
||||||
|
|
||||||
MaterialHelper* pcMat = new MaterialHelper();
|
aiMaterial* pcMat = new aiMaterial();
|
||||||
pcMat->AddProperty(&mTemp,AI_MATKEY_NAME);
|
pcMat->AddProperty(&mTemp,AI_MATKEY_NAME);
|
||||||
return pcMat;
|
return pcMat;
|
||||||
}
|
}
|
||||||
|
@ -76,14 +76,14 @@ void RemoveRedundantMatsTest :: setUp (void)
|
||||||
mTemp.data[0] = 48;
|
mTemp.data[0] = 48;
|
||||||
mTemp.data[1] = 0;
|
mTemp.data[1] = 0;
|
||||||
|
|
||||||
MaterialHelper* pcMat;
|
aiMaterial* pcMat;
|
||||||
pcScene1->mMaterials[2] = pcMat = new MaterialHelper();
|
pcScene1->mMaterials[2] = pcMat = new aiMaterial();
|
||||||
MaterialHelper::CopyPropertyList(pcMat,(const MaterialHelper*)pcScene1->mMaterials[0]);
|
aiMaterial::CopyPropertyList(pcMat,(const aiMaterial*)pcScene1->mMaterials[0]);
|
||||||
pcMat->AddProperty(&mTemp,AI_MATKEY_NAME);
|
pcMat->AddProperty(&mTemp,AI_MATKEY_NAME);
|
||||||
mTemp.data[0]++;
|
mTemp.data[0]++;
|
||||||
|
|
||||||
pcScene1->mMaterials[3] = pcMat = new MaterialHelper();
|
pcScene1->mMaterials[3] = pcMat = new aiMaterial();
|
||||||
MaterialHelper::CopyPropertyList(pcMat,(const MaterialHelper*)pcScene1->mMaterials[1]);
|
aiMaterial::CopyPropertyList(pcMat,(const aiMaterial*)pcScene1->mMaterials[1]);
|
||||||
pcMat->AddProperty(&mTemp,AI_MATKEY_NAME);
|
pcMat->AddProperty(&mTemp,AI_MATKEY_NAME);
|
||||||
mTemp.data[0]++;
|
mTemp.data[0]++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue