Make IsVerbose accessible outside the exporter
This commit is contained in:
@@ -224,3 +224,32 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh)
|
||||
}
|
||||
return (pcMesh->mNumVertices != iOldNumVertices);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool IsMeshInVerboseFormat(const aiMesh* mesh) {
|
||||
// avoid slow vector<bool> specialization
|
||||
std::vector<unsigned int> seen(mesh->mNumVertices,0);
|
||||
for(unsigned int i = 0; i < mesh->mNumFaces; ++i) {
|
||||
const aiFace& f = mesh->mFaces[i];
|
||||
for(unsigned int j = 0; j < f.mNumIndices; ++j) {
|
||||
if(++seen[f.mIndices[j]] == 2) {
|
||||
// found a duplicate index
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool MakeVerboseFormatProcess::IsVerboseFormat(const aiScene* pScene) {
|
||||
for(unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
|
||||
if(!IsMeshInVerboseFormat(pScene->mMeshes[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -94,6 +94,13 @@ public:
|
||||
* @param pScene The imported data to work at. */
|
||||
void Execute( aiScene* pScene);
|
||||
|
||||
public:
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Checks whether the scene is already in verbose format.
|
||||
* @param pScene The data to check.
|
||||
* @return true if the scene is already in verbose format. */
|
||||
static bool IsVerboseFormat(const aiScene* pScene);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user