Introduce export with test for point clouds.

This commit is contained in:
Kim Kulling
2018-05-01 13:28:53 +02:00
parent 9f835ea843
commit 2c47717ca6
8 changed files with 109 additions and 38 deletions

View File

@@ -60,14 +60,17 @@ using namespace Assimp;
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
PretransformVertices::PretransformVertices()
: configKeepHierarchy (false), configNormalize(false), configTransform(false), configTransformation()
{
: configKeepHierarchy (false)
, configNormalize(false)
, configTransform(false)
, configTransformation()
, mConfigPointCloud( false ) {
// empty
}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
PretransformVertices::~PretransformVertices()
{
PretransformVertices::~PretransformVertices() {
// nothing to do here
}
@@ -89,6 +92,8 @@ void PretransformVertices::SetupProperties(const Importer* pImp)
configTransform = (0 != pImp->GetPropertyInteger(AI_CONFIG_PP_PTV_ADD_ROOT_TRANSFORMATION,0));
configTransformation = pImp->GetPropertyMatrix(AI_CONFIG_PP_PTV_ROOT_TRANSFORMATION, aiMatrix4x4());
mConfigPointCloud = pImp->GetPropertyBool(AI_CONFIG_EXPORT_POINT_CLOUDS);
}
// ------------------------------------------------------------------------------------------------
@@ -502,9 +507,7 @@ void PretransformVertices::Execute( aiScene* pScene)
pScene->mMeshes[i]->mBones = NULL;
pScene->mMeshes[i]->mNumBones = 0;
}
}
else {
} else {
apcOutMeshes.reserve(pScene->mNumMaterials<<1u);
std::list<unsigned int> aiVFormats;
@@ -556,7 +559,8 @@ void PretransformVertices::Execute( aiScene* pScene)
}
// If no meshes are referenced in the node graph it is possible that we get no output meshes.
if (apcOutMeshes.empty()) {
if (apcOutMeshes.empty()) {
throw DeadlyImportError("No output meshes: all meshes are orphaned and are not referenced by any nodes");
}
else