ROS2EditorModule.cpp 2.4 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 <Camera/ROS2CameraSensorEditorComponent.h>
  9. #include <Lidar/LidarRegistrarEditorSystemComponent.h>
  10. #include <Manipulation/JointsManipulationEditorComponent.h>
  11. #include <ROS2EditorSystemComponent.h>
  12. #include <ROS2ModuleInterface.h>
  13. #include <RobotImporter/ROS2RobotImporterEditorSystemComponent.h>
  14. #include <QtCore/qglobal.h>
  15. void InitROS2Resources()
  16. {
  17. // Registration of Qt (ROS2.qrc) resources
  18. Q_INIT_RESOURCE(ROS2);
  19. }
  20. namespace ROS2
  21. {
  22. class ROS2EditorModule : public ROS2ModuleInterface
  23. {
  24. public:
  25. AZ_RTTI(ROS2EditorModule, "{3DDFC98F-D1CC-4658-BAF8-2CC34A9D39F3}", ROS2ModuleInterface);
  26. AZ_CLASS_ALLOCATOR(ROS2EditorModule, AZ::SystemAllocator);
  27. ROS2EditorModule()
  28. {
  29. InitROS2Resources();
  30. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  31. // Add ALL components descriptors associated with this gem to m_descriptors.
  32. // This will associate the AzTypeInfo information for the components with the SerializeContext, BehaviorContext and
  33. // EditContext. This happens through the [MyComponent]::Reflect() function.
  34. m_descriptors.insert(
  35. m_descriptors.end(),
  36. { ROS2EditorSystemComponent::CreateDescriptor(),
  37. LidarRegistrarEditorSystemComponent::CreateDescriptor(),
  38. ROS2RobotImporterEditorSystemComponent::CreateDescriptor(),
  39. ROS2CameraSensorEditorComponent::CreateDescriptor(),
  40. JointsManipulationEditorComponent::CreateDescriptor() });
  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)