ROS2EditorModule.cpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 <Lidar/LidarRegistrarEditorSystemComponent.h>
  9. #include <ROS2EditorSystemComponent.h>
  10. #include <ROS2ModuleInterface.h>
  11. #include <Camera/ROS2CameraSensorEditorComponent.h>
  12. #include <RobotImporter/ROS2RobotImporterEditorSystemComponent.h>
  13. #include <QtCore/qglobal.h>
  14. void InitROS2Resources()
  15. {
  16. // Registration of Qt (ROS2.qrc) resources
  17. Q_INIT_RESOURCE(ROS2);
  18. }
  19. namespace ROS2
  20. {
  21. class ROS2EditorModule : public ROS2ModuleInterface
  22. {
  23. public:
  24. AZ_RTTI(ROS2EditorModule, "{3DDFC98F-D1CC-4658-BAF8-2CC34A9D39F3}", ROS2ModuleInterface);
  25. AZ_CLASS_ALLOCATOR(ROS2EditorModule, AZ::SystemAllocator);
  26. ROS2EditorModule()
  27. {
  28. InitROS2Resources();
  29. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  30. // Add ALL components descriptors associated with this gem to m_descriptors.
  31. // This will associate the AzTypeInfo information for the components with the SerializeContext, BehaviorContext and
  32. // EditContext. This happens through the [MyComponent]::Reflect() function.
  33. m_descriptors.insert(
  34. m_descriptors.end(),
  35. {
  36. ROS2EditorSystemComponent::CreateDescriptor(),
  37. LidarRegistrarEditorSystemComponent::CreateDescriptor(),
  38. ROS2RobotImporterEditorSystemComponent::CreateDescriptor(),
  39. ROS2CameraSensorEditorComponent::CreateDescriptor(),
  40. });
  41. }
  42. /**
  43. * Add required SystemComponents to the SystemEntity.
  44. * Non-SystemComponents should not be added here
  45. */
  46. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  47. {
  48. return AZ::ComponentTypeList{
  49. azrtti_typeid<ROS2EditorSystemComponent>(),
  50. azrtti_typeid<LidarRegistrarEditorSystemComponent>(),
  51. azrtti_typeid<ROS2RobotImporterEditorSystemComponent>(),
  52. };
  53. }
  54. };
  55. } // namespace ROS2
  56. AZ_DECLARE_MODULE_CLASS(Gem_ROS2, ROS2::ROS2EditorModule)