Scene.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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/std/string/string.h>
  10. #include <SceneAPI/SceneCore/Containers/SceneGraph.h>
  11. #include <SceneAPI/SceneCore/Containers/SceneManifest.h>
  12. #include <SceneAPI/SceneCore/SceneCoreConfiguration.h>
  13. #include <AzCore/Math/Vector3.h>
  14. namespace AZ
  15. {
  16. namespace SceneAPI
  17. {
  18. namespace Containers
  19. {
  20. // Scenes are used to store the scene's graph the hierarchy and the manifest for meta data as well
  21. // as a history of the files used to construct both.
  22. class SCENE_CORE_API Scene
  23. {
  24. public:
  25. AZ_TYPE_INFO(Scene, "{1F2E6142-B0D8-42C6-A6E5-CD726DAA9EF0}");
  26. Scene() = default;
  27. explicit Scene(const AZStd::string& name);
  28. explicit Scene(AZStd::string&& name);
  29. void SetSource(const AZStd::string& filename, const Uuid& guid);
  30. void SetSource(AZStd::string&& filename, const Uuid& guid);
  31. const AZStd::string& GetSourceFilename() const;
  32. AZStd::string_view GetSourceExtension() const;
  33. const Uuid& GetSourceGuid() const;
  34. void SetWatchFolder(const AZStd::string& watchFolder);
  35. const AZStd::string& GetWatchFolder() const;
  36. void SetManifestFilename(const AZStd::string& name);
  37. void SetManifestFilename(AZStd::string&& name);
  38. const AZStd::string& GetManifestFilename() const;
  39. bool HasDimension() const;
  40. SceneGraph& GetGraph();
  41. const SceneGraph& GetGraph() const;
  42. SceneManifest& GetManifest();
  43. const SceneManifest& GetManifest() const;
  44. const AZStd::string& GetName() const;
  45. enum class SceneOrientation {YUp, ZUp, XUp, NegYUp, NegZUp, NegXUp};
  46. void SetOriginalSceneOrientation(SceneOrientation orientation);
  47. void SetSceneDimension(Vector3 dimension);
  48. void SetSceneVertices(uint32_t vertices);
  49. SceneOrientation GetOriginalSceneOrientation() const;
  50. Vector3& GetSceneDimension();
  51. uint32_t GetSceneVertices() const;
  52. static void Reflect(ReflectContext* context);
  53. private:
  54. // Disabling export warnings for private methods, clients wont have access to them
  55. AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option")
  56. AZStd::string m_name;
  57. AZStd::string m_manifestFilename;
  58. AZStd::string m_sourceFilename;
  59. AZStd::string m_watchFolder;
  60. Uuid m_sourceGuid;
  61. SceneGraph m_graph;
  62. SceneManifest m_manifest;
  63. SceneOrientation m_originalOrientation = SceneOrientation::YUp;
  64. Vector3 m_sceneDimension;
  65. uint32_t m_vertices;
  66. bool m_hasDimension{ false };
  67. AZ_POP_DISABLE_WARNING
  68. };
  69. } // Containers
  70. } // SceneAPI
  71. } // AZ