BaseProcess.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /** @file Base class of all import post processing steps */
  2. #ifndef AI_BASEPROCESS_H_INC
  3. #define AI_BASEPROCESS_H_INC
  4. struct aiScene;
  5. namespace Assimp
  6. {
  7. // ---------------------------------------------------------------------------
  8. /** The BaseProcess defines a common interface for all post processing steps.
  9. * A post processing step is run after a successful import if the caller
  10. * specified the corresponding flag when calling ReadFile(). Enum #aiPostProcessSteps
  11. * defines which flags are available.
  12. * After a successful import the Importer iterates over its internal array of processes
  13. * and calls IsActive() on each process to evaluate if the step should be executed.
  14. * If the function returns true, the class' Execute() function is called subsequently.
  15. */
  16. class BaseProcess
  17. {
  18. friend class Importer;
  19. protected:
  20. /** Constructor to be privately used by Importer */
  21. BaseProcess();
  22. /** Destructor, private as well */
  23. virtual ~BaseProcess();
  24. public:
  25. // -------------------------------------------------------------------
  26. /** Returns whether the processing step is present in the given flag field.
  27. * @param pFlags The processing flags the importer was called with. A bitwise
  28. * combination of #aiPostProcessSteps.
  29. * @return true if the process is present in this flag fields, false if not.
  30. */
  31. virtual bool IsActive( unsigned int pFlags) const = 0;
  32. // -------------------------------------------------------------------
  33. /** Executes the post processing step on the given imported data.
  34. * At the moment a process is not supposed to fail.
  35. * @param pScene The imported data to work at.
  36. */
  37. virtual void Execute( aiScene* pScene) = 0;
  38. };
  39. /** Constructor, dummy implementation to keep the compiler from complaining */
  40. inline BaseProcess::BaseProcess()
  41. {
  42. }
  43. /** Destructor */
  44. inline BaseProcess::~BaseProcess()
  45. {
  46. }
  47. } // end of namespace Assimp
  48. #endif // AI_BASEPROCESS_H_INC