ImportEventContext.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #pragma once
  2. /*
  3. * Copyright (c) Contributors to the Open 3D Engine Project.
  4. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. *
  6. * SPDX-License-Identifier: Apache-2.0 OR MIT
  7. *
  8. */
  9. #include <AzCore/RTTI/RTTI.h>
  10. #include <AzCore/std/string/string.h>
  11. #include <SceneAPI/SceneCore/Events/CallProcessorBus.h>
  12. #include <SceneAPI/SceneCore/SceneCoreConfiguration.h>
  13. namespace AZ
  14. {
  15. namespace SceneAPI
  16. {
  17. namespace Containers
  18. {
  19. class Scene;
  20. }
  21. namespace Events
  22. {
  23. // Signals an import of the scene graph is about to happen.
  24. class PreImportEventContext
  25. : public ICallContext
  26. {
  27. public:
  28. AZ_RTTI(PreImportEventContext, "{89BA9931-E6B5-4096-B5AE-80E80A8B4DB2}", ICallContext);
  29. ~PreImportEventContext() override = default;
  30. SCENE_CORE_API PreImportEventContext(const char* inputDirectory);
  31. SCENE_CORE_API PreImportEventContext(const AZStd::string& inputDirectory);
  32. SCENE_CORE_API PreImportEventContext(AZStd::string&& inputDirectory);
  33. SCENE_CORE_API const AZStd::string& GetInputDirectory() const;
  34. private:
  35. const AZStd::string m_inputDirectory;
  36. };
  37. // Signals that the scene is ready to import the scene graph from source data
  38. class ImportEventContext
  39. : public ICallContext
  40. {
  41. public:
  42. AZ_RTTI(ImportEventContext, "{4E0C75C2-564F-4BDF-BFAA-B7E4683B24B9}", ICallContext);
  43. ~ImportEventContext() override = default;
  44. SCENE_CORE_API ImportEventContext(const char* inputDirectory, Containers::Scene& scene);
  45. SCENE_CORE_API ImportEventContext(const AZStd::string& inputDirectory, Containers::Scene& scene);
  46. SCENE_CORE_API ImportEventContext(AZStd::string&& inputDirectory, Containers::Scene& scene);
  47. SCENE_CORE_API const AZStd::string& GetInputDirectory() const;
  48. SCENE_CORE_API Containers::Scene& GetScene();
  49. private:
  50. AZStd::string m_inputDirectory;
  51. Containers::Scene& m_scene;
  52. };
  53. // Signals that an import has completed and the data should be ready to use (if there were no errors)
  54. class PostImportEventContext
  55. : public ICallContext
  56. {
  57. public:
  58. AZ_RTTI(PostImportEventContext, "{683D2E3E-0040-4E78-90BF-76FAFFD50767}", ICallContext);
  59. ~PostImportEventContext() override = default;
  60. SCENE_CORE_API PostImportEventContext(const Containers::Scene& scene);
  61. SCENE_CORE_API const Containers::Scene& GetScene() const;
  62. private:
  63. const Containers::Scene& m_scene;
  64. };
  65. } // Events
  66. } // SceneAPI
  67. } // AZ