SplitLargeMeshes.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /** @file Defines a post processing step to split large meshes into submeshes*/
  2. #ifndef AI_SPLITLARGEMESHES_H_INC
  3. #define AI_SPLITLARGEMESHES_H_INC
  4. #include <vector>
  5. #include "BaseProcess.h"
  6. #include "../include/aiMesh.h"
  7. #include "../include/aiScene.h"
  8. namespace Assimp
  9. {
  10. #define AI_SLM_MAX_VERTICES 1000000
  11. // ---------------------------------------------------------------------------
  12. /** Postprocessing filter to split large meshes into submeshes
  13. */
  14. class SplitLargeMeshesProcess : public BaseProcess
  15. {
  16. friend class Importer;
  17. protected:
  18. /** Constructor to be privately used by Importer */
  19. SplitLargeMeshesProcess();
  20. /** Destructor, private as well */
  21. ~SplitLargeMeshesProcess();
  22. public:
  23. // -------------------------------------------------------------------
  24. /** Returns whether the processing step is present in the given flag field.
  25. * @param pFlags The processing flags the importer was called with. A bitwise
  26. * combination of #aiPostProcessSteps.
  27. * @return true if the process is present in this flag fields, false if not.
  28. */
  29. bool IsActive( unsigned int pFlags) const;
  30. // -------------------------------------------------------------------
  31. /** Executes the post processing step on the given imported data.
  32. * At the moment a process is not supposed to fail.
  33. * @param pScene The imported data to work at.
  34. */
  35. void Execute( aiScene* pScene);
  36. private:
  37. //! Apply the algorithm to a given mesh
  38. void SplitMesh (unsigned int a, aiMesh* pcMesh,
  39. std::vector<std::pair<aiMesh*, unsigned int> >& avList);
  40. //! Update a node in the asset after a few of its meshes
  41. //! have been split
  42. void UpdateNode(aiNode* pcNode,
  43. const std::vector<std::pair<aiMesh*, unsigned int> >& avList);
  44. };
  45. } // end of namespace Assimp
  46. #endif // !!AI_SPLITLARGEMESHES_H_INC