GraphMetaInfoBus.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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/EBus/EBus.h>
  10. #include <AzCore/Math/Crc.h>
  11. #include <AzCore/std/string/string.h>
  12. #include <AzCore/std/containers/set.h>
  13. #include <SceneAPI/SceneCore/Containers/SceneGraph.h>
  14. #include <SceneAPI/SceneCore/SceneCoreConfiguration.h>
  15. namespace AZ
  16. {
  17. namespace SceneAPI
  18. {
  19. namespace Containers
  20. {
  21. class Scene;
  22. }
  23. namespace DataTypes
  24. {
  25. class IGraphObject;
  26. }
  27. namespace Events
  28. {
  29. #if defined(AZ_PLATFORM_LINUX)
  30. class SCENE_CORE_API GraphMetaInfo
  31. #else
  32. class GraphMetaInfo
  33. #endif
  34. : public AZ::EBusTraits
  35. {
  36. public:
  37. static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
  38. using VirtualTypesSet = AZStd::unordered_set<Crc32>;
  39. inline static Crc32 GetIgnoreVirtualType()
  40. {
  41. static Crc32 s_ignoreVirtualType = AZ_CRC_CE("Ignore");
  42. return s_ignoreVirtualType;
  43. }
  44. SCENE_CORE_API GraphMetaInfo() = default;
  45. virtual ~GraphMetaInfo() = default;
  46. // Gets the path to the icon associated with the given object.
  47. SCENE_CORE_API virtual void GetIconPath([[maybe_unused]] AZStd::string& iconPath, [[maybe_unused]] const DataTypes::IGraphObject* target) {}
  48. // Provides a short description of the type.
  49. SCENE_CORE_API virtual void GetToolTip([[maybe_unused]] AZStd::string& toolTip, [[maybe_unused]] const DataTypes::IGraphObject* target) {}
  50. // Provides a list of string CRCs that indicate the virtual type the given node can act as.
  51. // Virtual types are none custom types that are different interpretations of existing types based on
  52. // their name or attributes.
  53. SCENE_CORE_API virtual void GetVirtualTypes([[maybe_unused]] VirtualTypesSet& types,
  54. [[maybe_unused]] const Containers::Scene& scene,
  55. [[maybe_unused]] Containers::SceneGraph::NodeIndex node) {}
  56. // Provides a list of string CRCs that indicate all available virtual types.
  57. SCENE_CORE_API virtual void GetAllVirtualTypes([[maybe_unused]] VirtualTypesSet& types) {}
  58. // Converts the virtual type hashed name into a readable name.
  59. SCENE_CORE_API virtual void GetVirtualTypeName([[maybe_unused]] AZStd::string& name, [[maybe_unused]] Crc32 type) {}
  60. // Provides the policies that will be applied to the scene from the asset builders.
  61. SCENE_CORE_API virtual void GetAppliedPolicyNames([[maybe_unused]] AZStd::set<AZStd::string>& appliedPolicies,
  62. [[maybe_unused]] const Containers::Scene& scene) const {}
  63. };
  64. using GraphMetaInfoBus = AZ::EBus<GraphMetaInfo>;
  65. } // Events
  66. } // SceneAPI
  67. } // AZ