Refactoring: Code cleanup post-processing.

pull/5009/head
Kim Kulling 2023-03-14 23:32:03 +01:00
parent 1147f0c8bd
commit 31ae9cde1c
29 changed files with 93 additions and 149 deletions

View File

@ -60,10 +60,6 @@ CalcTangentsProcess::CalcTangentsProcess() :
// nothing to do here // nothing to do here
} }
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
CalcTangentsProcess::~CalcTangentsProcess() = default;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Returns whether the processing step is present in the given flag field. // Returns whether the processing step is present in the given flag field.
bool CalcTangentsProcess::IsActive(unsigned int pFlags) const { bool CalcTangentsProcess::IsActive(unsigned int pFlags) const {

View File

@ -59,14 +59,11 @@ namespace Assimp
* because the joining of vertices also considers tangents and bitangents for * because the joining of vertices also considers tangents and bitangents for
* uniqueness. * uniqueness.
*/ */
class ASSIMP_API_WINONLY CalcTangentsProcess : public BaseProcess class ASSIMP_API_WINONLY CalcTangentsProcess : public BaseProcess {
{
public: public:
CalcTangentsProcess(); CalcTangentsProcess();
~CalcTangentsProcess(); ~CalcTangentsProcess() override = default;
public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Returns whether the processing step is present in the given flag. /** Returns whether the processing step is present in the given flag.
* @param pFlags The processing flags the importer was called with. * @param pFlags The processing flags the importer was called with.
@ -74,19 +71,17 @@ public:
* @return true if the process is present in this flag fields, * @return true if the process is present in this flag fields,
* false if not. * false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Called prior to ExecuteOnScene(). /** Called prior to ExecuteOnScene().
* The function is a request to the process to update its configuration * The function is a request to the process to update its configuration
* basing on the Importer's configuration property list. * basing on the Importer's configuration property list.
*/ */
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
// setter for configMaxAngle // setter for configMaxAngle
inline void SetMaxSmoothAngle(float f) void SetMaxSmoothAngle(float f) {
{
configMaxAngle =f; configMaxAngle =f;
} }

View File

@ -57,14 +57,6 @@ namespace {
const static ai_real angle_epsilon = ai_real( 0.95 ); const static ai_real angle_epsilon = ai_real( 0.95 );
} }
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
ComputeUVMappingProcess::ComputeUVMappingProcess() = default;
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
ComputeUVMappingProcess::~ComputeUVMappingProcess() = default;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Returns whether the processing step is present in the given flag field. // Returns whether the processing step is present in the given flag field.
bool ComputeUVMappingProcess::IsActive( unsigned int pFlags) const bool ComputeUVMappingProcess::IsActive( unsigned int pFlags) const

View File

@ -59,13 +59,10 @@ namespace Assimp {
/** ComputeUVMappingProcess - converts special mappings, such as spherical, /** ComputeUVMappingProcess - converts special mappings, such as spherical,
* cylindrical or boxed to proper UV coordinates for rendering. * cylindrical or boxed to proper UV coordinates for rendering.
*/ */
class ComputeUVMappingProcess : public BaseProcess class ComputeUVMappingProcess : public BaseProcess {
{
public:
ComputeUVMappingProcess();
~ComputeUVMappingProcess();
public: public:
ComputeUVMappingProcess() = default;
~ComputeUVMappingProcess() override = default;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Returns whether the processing step is present in the given flag field. /** Returns whether the processing step is present in the given flag field.
@ -73,14 +70,14 @@ public:
* combination of #aiPostProcessSteps. * combination of #aiPostProcessSteps.
* @return true if the process is present in this flag fields, false if not. * @return true if the process is present in this flag fields, false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Executes the post processing step on the given imported data. /** Executes the post processing step on the given imported data.
* At the moment a process is not supposed to fail. * At the moment a process is not supposed to fail.
* @param pScene The imported data to work at. * @param pScene The imported data to work at.
*/ */
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
protected: protected:
@ -125,8 +122,7 @@ protected:
private: private:
// temporary structure to describe a mapping // temporary structure to describe a mapping
struct MappingInfo struct MappingInfo {
{
explicit MappingInfo(aiTextureMapping _type) explicit MappingInfo(aiTextureMapping _type)
: type (_type) : type (_type)
, axis (0.f,1.f,0.f) , axis (0.f,1.f,0.f)
@ -137,8 +133,7 @@ private:
aiVector3D axis; aiVector3D axis;
unsigned int uv; unsigned int uv;
bool operator== (const MappingInfo& other) bool operator== (const MappingInfo& other) {
{
return type == other.type && axis == other.axis; return type == other.type && axis == other.axis;
} }
}; };

View File

@ -79,14 +79,6 @@ void flipUVs(aiMeshType *pMesh) {
} // namespace } // namespace
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
MakeLeftHandedProcess::MakeLeftHandedProcess() = default;
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
MakeLeftHandedProcess::~MakeLeftHandedProcess() = default;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Returns whether the processing step is present in the given flag field. // Returns whether the processing step is present in the given flag field.
bool MakeLeftHandedProcess::IsActive(unsigned int pFlags) const { bool MakeLeftHandedProcess::IsActive(unsigned int pFlags) const {
@ -305,14 +297,6 @@ void FlipUVsProcess::ProcessMesh(aiMesh *pMesh) {
#ifndef ASSIMP_BUILD_NO_FLIPWINDING_PROCESS #ifndef ASSIMP_BUILD_NO_FLIPWINDING_PROCESS
// # FlipWindingOrderProcess // # FlipWindingOrderProcess
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
FlipWindingOrderProcess::FlipWindingOrderProcess() = default;
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
FlipWindingOrderProcess::~FlipWindingOrderProcess() = default;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Returns whether the processing step is present in the given flag field. // Returns whether the processing step is present in the given flag field.
bool FlipWindingOrderProcess::IsActive(unsigned int pFlags) const { bool FlipWindingOrderProcess::IsActive(unsigned int pFlags) const {

View File

@ -4,7 +4,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2022, assimp team Copyright (c) 2006-2022, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -72,22 +71,18 @@ namespace Assimp {
* *
* @note RH-LH and LH-RH is the same, so this class can be used for both * @note RH-LH and LH-RH is the same, so this class can be used for both
*/ */
class MakeLeftHandedProcess : public BaseProcess class MakeLeftHandedProcess : public BaseProcess {
{
public: public:
MakeLeftHandedProcess(); MakeLeftHandedProcess() = default;
~MakeLeftHandedProcess(); ~MakeLeftHandedProcess() override = default;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
protected: protected:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Recursively converts a node and all of its children /** Recursively converts a node and all of its children
*/ */
@ -120,24 +115,22 @@ protected:
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
/** Postprocessing step to flip the face order of the imported data /** Postprocessing step to flip the face order of the imported data
*/ */
class FlipWindingOrderProcess : public BaseProcess class FlipWindingOrderProcess : public BaseProcess {
{
friend class Importer; friend class Importer;
public: public:
/** Constructor to be privately used by Importer */ /** Constructor to be privately used by Importer */
FlipWindingOrderProcess(); FlipWindingOrderProcess() = default;
/** Destructor, private as well */ /** Destructor, private as well */
~FlipWindingOrderProcess(); ~FlipWindingOrderProcess() override = default;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
public:
/** Some other types of post-processing require winding order flips */ /** Some other types of post-processing require winding order flips */
static void ProcessMesh( aiMesh* pMesh); static void ProcessMesh( aiMesh* pMesh);
}; };

View File

@ -79,14 +79,14 @@ public:
* @return true if the process is present in this flag fields, * @return true if the process is present in this flag fields,
* false if not. * false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Called prior to ExecuteOnScene(). /** Called prior to ExecuteOnScene().
* The function is a request to the process to update its configuration * The function is a request to the process to update its configuration
* basing on the Importer's configuration property list. * basing on the Importer's configuration property list.
*/ */
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
protected: protected:
// ------------------------------------------------------------------- // -------------------------------------------------------------------

View File

@ -64,15 +64,14 @@ public:
* combination of #aiPostProcessSteps. * combination of #aiPostProcessSteps.
* @return true if the process is present in this flag fields, false if not. * @return true if the process is present in this flag fields, false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Executes the post processing step on the given imported data. /** Executes the post processing step on the given imported data.
* At the moment a process is not supposed to fail. * At the moment a process is not supposed to fail.
* @param pScene The imported data to work at. * @param pScene The imported data to work at.
*/ */
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
private: private:
bool DropMeshFaceNormals(aiMesh* pcMesh); bool DropMeshFaceNormals(aiMesh* pcMesh);

View File

@ -68,13 +68,13 @@ public:
~EmbedTexturesProcess() override = default; ~EmbedTexturesProcess() override = default;
/// Overwritten, @see BaseProcess /// Overwritten, @see BaseProcess
virtual bool IsActive(unsigned int pFlags) const; bool IsActive(unsigned int pFlags) const override;
/// Overwritten, @see BaseProcess /// Overwritten, @see BaseProcess
virtual void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
/// Overwritten, @see BaseProcess /// Overwritten, @see BaseProcess
virtual void Execute(aiScene* pScene); virtual void Execute(aiScene* pScene) override;
private: private:
// Resolve the path and add the file content to the scene as a texture. // Resolve the path and add the file content to the scene as a texture.

View File

@ -63,15 +63,15 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Check whether step is active // Check whether step is active
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Execute step on a given scene // Execute step on a given scene
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Setup import settings // Setup import settings
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Execute step on a given mesh // Execute step on a given mesh

View File

@ -50,7 +50,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "PostProcessing/ProcessHelper.h" #include "PostProcessing/ProcessHelper.h"
class FindInstancesProcessTest; class FindInstancesProcessTest;
namespace Assimp {
namespace Assimp {
// ------------------------------------------------------------------------------- // -------------------------------------------------------------------------------
/** @brief Get a pseudo(!)-hash representing a mesh. /** @brief Get a pseudo(!)-hash representing a mesh.
@ -60,8 +61,7 @@ namespace Assimp {
* @param in Input mesh * @param in Input mesh
* @return Hash. * @return Hash.
*/ */
inline inline uint64_t GetMeshHash(aiMesh* in) {
uint64_t GetMeshHash(aiMesh* in) {
ai_assert(nullptr != in); ai_assert(nullptr != in);
// ... get an unique value representing the vertex format of the mesh // ... get an unique value representing the vertex format of the mesh
@ -83,8 +83,7 @@ uint64_t GetMeshHash(aiMesh* in) {
* @param e Epsilon * @param e Epsilon
* @return true if the arrays are identical * @return true if the arrays are identical
*/ */
inline inline bool CompareArrays(const aiVector3D* first, const aiVector3D* second,
bool CompareArrays(const aiVector3D* first, const aiVector3D* second,
unsigned int size, float e) { unsigned int size, float e) {
for (const aiVector3D* end = first+size; first != end; ++first,++second) { for (const aiVector3D* end = first+size; first != end; ++first,++second) {
if ( (*first - *second).SquareLength() >= e) if ( (*first - *second).SquareLength() >= e)
@ -114,15 +113,15 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Check whether step is active in given flags combination // Check whether step is active in given flags combination
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Execute step on a given scene // Execute step on a given scene
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Setup properties prior to executing the process // Setup properties prior to executing the process
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
private: private:
bool configSpeedFlag; bool configSpeedFlag;

View File

@ -71,15 +71,15 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/// Returns active state. /// Returns active state.
bool IsActive(unsigned int pFlags) const; bool IsActive(unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/// Setup import settings /// Setup import settings
void SetupProperties(const Importer *pImp); void SetupProperties(const Importer *pImp) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/// Run the step /// Run the step
void Execute(aiScene *pScene); void Execute(aiScene *pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/// Executes the post-processing step on the given mesh /// Executes the post-processing step on the given mesh

View File

@ -69,14 +69,14 @@ public:
* combination of #aiPostProcessSteps. * combination of #aiPostProcessSteps.
* @return true if the process is present in this flag fields, false if not. * @return true if the process is present in this flag fields, false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Executes the post processing step on the given imported data. /** Executes the post processing step on the given imported data.
* At the moment a process is not supposed to fail. * At the moment a process is not supposed to fail.
* @param pScene The imported data to work at. * @param pScene The imported data to work at.
*/ */
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
protected: protected:

View File

@ -66,15 +66,14 @@ public:
* combination of #aiPostProcessSteps. * combination of #aiPostProcessSteps.
* @return true if the process is present in this flag fields, false if not. * @return true if the process is present in this flag fields, false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Executes the post processing step on the given imported data. /** Executes the post processing step on the given imported data.
* At the moment a process is not supposed to fail. * At the moment a process is not supposed to fail.
* @param pScene The imported data to work at. * @param pScene The imported data to work at.
*/ */
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
private: private:
bool GenMeshFaceNormals(aiMesh* pcMesh); bool GenMeshFaceNormals(aiMesh* pcMesh);

View File

@ -72,22 +72,21 @@ public:
* @return true if the process is present in this flag fields, * @return true if the process is present in this flag fields,
* false if not. * false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Called prior to ExecuteOnScene(). /** Called prior to ExecuteOnScene().
* The function is a request to the process to update its configuration * The function is a request to the process to update its configuration
* basing on the Importer's configuration property list. * basing on the Importer's configuration property list.
*/ */
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Executes the post processing step on the given imported data. /** Executes the post processing step on the given imported data.
* At the moment a process is not supposed to fail. * At the moment a process is not supposed to fail.
* @param pScene The imported data to work at. * @param pScene The imported data to work at.
*/ */
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// setter for configMaxAngle // setter for configMaxAngle
inline void SetMaxSmoothAngle(ai_real f) { inline void SetMaxSmoothAngle(ai_real f) {

View File

@ -69,15 +69,15 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Check whether the pp step is active // Check whether the pp step is active
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Executes the pp step on a given scene // Executes the pp step on a given scene
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Configures the pp step // Configures the pp step
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
protected: protected:
// ------------------------------------------------------------------- // -------------------------------------------------------------------

View File

@ -74,14 +74,14 @@ public:
* combination of #aiPostProcessSteps. * combination of #aiPostProcessSteps.
* @return true if the process is present in this flag fields, false if not. * @return true if the process is present in this flag fields, false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Executes the post processing step on the given imported data. /** Executes the post processing step on the given imported data.
* At the moment a process is not supposed to fail. * At the moment a process is not supposed to fail.
* @param pScene The imported data to work at. * @param pScene The imported data to work at.
*/ */
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Unites identical vertices in the given mesh. /** Unites identical vertices in the given mesh.

View File

@ -86,27 +86,27 @@ public:
* @return true if the process is present in this flag fields, * @return true if the process is present in this flag fields,
* false if not. * false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Called prior to ExecuteOnScene(). /** Called prior to ExecuteOnScene().
* The function is a request to the process to update its configuration * The function is a request to the process to update its configuration
* basing on the Importer's configuration property list. * basing on the Importer's configuration property list.
*/ */
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
// -------------------------------------------------------------------
/** Limits the bone weight count for all vertices in the given mesh.
* @param pMesh The mesh to process.
*/
void ProcessMesh( aiMesh* pMesh);
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Executes the post processing step on the given imported data. /** Executes the post processing step on the given imported data.
* At the moment a process is not supposed to fail. * At the moment a process is not supposed to fail.
* @param pScene The imported data to work at. * @param pScene The imported data to work at.
*/ */
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// -------------------------------------------------------------------
/** Limits the bone weight count for all vertices in the given mesh.
* @param pMesh The mesh to process.
*/
void ProcessMesh( aiMesh* pMesh);
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Describes a bone weight on a vertex */ /** Describes a bone weight on a vertex */

View File

@ -78,7 +78,7 @@ public:
* @param pFlags The processing flags the importer was called with. A bitwise * @param pFlags The processing flags the importer was called with. A bitwise
* combination of #aiPostProcessSteps. * combination of #aiPostProcessSteps.
* @return true if the process is present in this flag fields, false if not */ * @return true if the process is present in this flag fields, false if not */
bool IsActive( unsigned int /*pFlags*/ ) const bool IsActive( unsigned int /*pFlags*/ ) const override
{ {
// NOTE: There is no direct flag that corresponds to // NOTE: There is no direct flag that corresponds to
// this postprocess step. // this postprocess step.
@ -89,7 +89,7 @@ public:
/** Executes the post processing step on the given imported data. /** Executes the post processing step on the given imported data.
* At the moment a process is not supposed to fail. * At the moment a process is not supposed to fail.
* @param pScene The imported data to work at. */ * @param pScene The imported data to work at. */
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
public: public:

View File

@ -93,16 +93,14 @@ public:
unsigned int output_id; unsigned int output_id;
}; };
public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** @brief Specify whether you want meshes with different /** @brief Specify whether you want meshes with different

View File

@ -66,15 +66,15 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Check whether step is active // Check whether step is active
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Execute step on a given scene // Execute step on a given scene
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Setup import settings // Setup import settings
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** @brief Set list of fixed (inmutable) materials /** @brief Set list of fixed (inmutable) materials

View File

@ -69,37 +69,35 @@ public:
* combination of #aiPostProcessSteps. * combination of #aiPostProcessSteps.
* @return true if the process is present in this flag fields, false if not. * @return true if the process is present in this flag fields, false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Executes the post processing step on the given imported data. /** Executes the post processing step on the given imported data.
* At the moment a process is not supposed to fail. * At the moment a process is not supposed to fail.
* @param pScene The imported data to work at. * @param pScene The imported data to work at.
*/ */
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Called prior to ExecuteOnScene(). /** Called prior to ExecuteOnScene().
* The function is a request to the process to update its configuration * The function is a request to the process to update its configuration
* basing on the Importer's configuration property list. * basing on the Importer's configuration property list.
*/ */
virtual void SetupProperties(const Importer* pImp); virtual void SetupProperties(const Importer* pImp) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Manually setup the configuration flags for the step /** Manually setup the configuration flags for the step
* *
* @param Bitwise combination of the #aiComponent enumerated values. * @param Bitwise combination of the #aiComponent enumerated values.
*/ */
void SetDeleteFlags(unsigned int f) void SetDeleteFlags(unsigned int f) {
{
configDeleteFlags = f; configDeleteFlags = f;
} }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Query the current configuration. /** Query the current configuration.
*/ */
unsigned int GetDeleteFlags() const unsigned int GetDeleteFlags() const {
{
return configDeleteFlags; return configDeleteFlags;
} }

View File

@ -74,13 +74,13 @@ public:
ai_real getScale() const; ai_real getScale() const;
/// Overwritten, @see BaseProcess /// Overwritten, @see BaseProcess
virtual bool IsActive( unsigned int pFlags ) const; virtual bool IsActive( unsigned int pFlags ) const override;
/// Overwritten, @see BaseProcess /// Overwritten, @see BaseProcess
virtual void SetupProperties( const Importer* pImp ); virtual void SetupProperties( const Importer* pImp ) override;
/// Overwritten, @see BaseProcess /// Overwritten, @see BaseProcess
virtual void Execute( aiScene* pScene ); virtual void Execute( aiScene* pScene ) override;
private: private:
void traverseNodes( aiNode *currentNode, unsigned int nested_node_id = 0 ); void traverseNodes( aiNode *currentNode, unsigned int nested_node_id = 0 );

View File

@ -66,13 +66,13 @@ public:
~SortByPTypeProcess() override = default; ~SortByPTypeProcess() override = default;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
private: private:
int mConfigRemoveMeshes; int mConfigRemoveMeshes;

View File

@ -75,7 +75,7 @@ public:
/// @brief Called prior to ExecuteOnScene(). /// @brief Called prior to ExecuteOnScene().
/// The function is a request to the process to update its configuration /// The function is a request to the process to update its configuration
/// basing on the Importer's configuration property list. /// basing on the Importer's configuration property list.
virtual void SetupProperties(const Importer* pImp); virtual void SetupProperties(const Importer* pImp) override;
protected: protected:
/// Executes the post processing step on the given imported data. /// Executes the post processing step on the given imported data.

View File

@ -99,7 +99,7 @@ public:
* @return true if the process is present in this flag fields, * @return true if the process is present in this flag fields,
* false if not. * false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Called prior to ExecuteOnScene(). /** Called prior to ExecuteOnScene().
@ -121,7 +121,7 @@ public:
* At the moment a process is not supposed to fail. * At the moment a process is not supposed to fail.
* @param pScene The imported data to work at. * @param pScene The imported data to work at.
*/ */
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
//! Apply the algorithm to a given mesh //! Apply the algorithm to a given mesh

View File

@ -201,14 +201,13 @@ public:
~TextureTransformStep() override = default; ~TextureTransformStep() override = default;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
protected: protected:
// ------------------------------------------------------------------- // -------------------------------------------------------------------

View File

@ -72,14 +72,14 @@ public:
* combination of #aiPostProcessSteps. * combination of #aiPostProcessSteps.
* @return true if the process is present in this flag fields, false if not. * @return true if the process is present in this flag fields, false if not.
*/ */
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Executes the post processing step on the given imported data. /** Executes the post processing step on the given imported data.
* At the moment a process is not supposed to fail. * At the moment a process is not supposed to fail.
* @param pScene The imported data to work at. * @param pScene The imported data to work at.
*/ */
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Triangulates the given mesh. /** Triangulates the given mesh.

View File

@ -69,8 +69,7 @@ namespace Assimp {
/** Validates the whole ASSIMP scene data structure for correctness. /** Validates the whole ASSIMP scene data structure for correctness.
* ImportErrorException is thrown of the scene is corrupt.*/ * ImportErrorException is thrown of the scene is corrupt.*/
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
class ValidateDSProcess : public BaseProcess class ValidateDSProcess : public BaseProcess {
{
public: public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/// The default class constructor / destructor. /// The default class constructor / destructor.
@ -78,13 +77,12 @@ public:
~ValidateDSProcess() override = default; ~ValidateDSProcess() override = default;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
bool IsActive( unsigned int pFlags) const; bool IsActive( unsigned int pFlags) const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
void Execute( aiScene* pScene); void Execute( aiScene* pScene) override;
protected: protected:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Report a validation error. This will throw an exception, /** Report a validation error. This will throw an exception,
* control won't return. * control won't return.