SimulationInterfacesEditorModule.cpp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "LevelManagerEditor.h"
  9. #include "NamedPoseManagerEditor.h"
  10. #include "ROS2SimulationInterfacesEditorSystemComponent.h"
  11. #include "SimulationEntitiesManagerEditor.h"
  12. #include "SimulationFeaturesAggregatorEditor.h"
  13. #include "SimulationManagerEditor.h"
  14. #include <Components/NamedPoseEditorComponent.h>
  15. #include <SimulationInterfaces/SimulationInterfacesTypeIds.h>
  16. #include <SimulationInterfacesModuleInterface.h>
  17. namespace SimulationInterfaces
  18. {
  19. class SimulationInterfacesEditorModule : public SimulationInterfacesModuleInterface
  20. {
  21. public:
  22. AZ_RTTI(SimulationInterfacesEditorModule, SimulationInterfacesEditorModuleTypeId, SimulationInterfacesModuleInterface);
  23. AZ_CLASS_ALLOCATOR(SimulationInterfacesEditorModule, AZ::SystemAllocator);
  24. SimulationInterfacesEditorModule()
  25. {
  26. m_descriptors.insert(
  27. m_descriptors.end(),
  28. {
  29. SimulationEntitiesManagerEditor::CreateDescriptor(),
  30. SimulationManagerEditor::CreateDescriptor(),
  31. SimulationFeaturesAggregatorEditor::CreateDescriptor(),
  32. NamedPoseManagerEditor::CreateDescriptor(),
  33. LevelManagerEditor::CreateDescriptor(),
  34. ROS2SimulationInterfaces::ROS2SimulationInterfacesEditorSystemComponent::CreateDescriptor(),
  35. NamedPoseEditorComponent::CreateDescriptor(),
  36. });
  37. }
  38. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  39. {
  40. // add system components only if application is editor. In other case editor system components break other tools like material
  41. // Canvas, material editor etc.
  42. AZ::ApplicationTypeQuery appType;
  43. AZ::ComponentApplicationBus::Broadcast(&AZ::ComponentApplicationBus::Events::QueryApplicationType, appType);
  44. if (appType.IsEditor())
  45. {
  46. return AZ::ComponentTypeList{
  47. azrtti_typeid<SimulationEntitiesManagerEditor>(),
  48. azrtti_typeid<SimulationManagerEditor>(),
  49. azrtti_typeid<SimulationFeaturesAggregatorEditor>(),
  50. azrtti_typeid<NamedPoseManagerEditor>(),
  51. azrtti_typeid<LevelManagerEditor>(),
  52. azrtti_typeid<ROS2SimulationInterfaces::ROS2SimulationInterfacesEditorSystemComponent>(),
  53. };
  54. }
  55. return AZ::ComponentTypeList{};
  56. }
  57. };
  58. } // namespace SimulationInterfaces
  59. AZ_DECLARE_MODULE_CLASS(Gem_SimulationInterfaces_Editor, SimulationInterfaces::SimulationInterfacesEditorModule)