ROS2SpawnerEditorComponent.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #pragma once
  9. #include "Spawner/ROS2SpawnerComponent.h"
  10. #include "Spawner/ROS2SpawnerComponentController.h"
  11. #include <AzToolsFramework/ToolsComponents/EditorComponentAdapter.h>
  12. #include <AzToolsFramework/ToolsComponents/EditorComponentBase.h>
  13. #include <ROS2/Spawner/SpawnerBus.h>
  14. namespace ROS2
  15. {
  16. using ROS2SpawnerEditorComponentBase = AzToolsFramework::Components::
  17. EditorComponentAdapter<ROS2SpawnerComponentController, ROS2SpawnerComponent, ROS2SpawnerComponentConfig>;
  18. class ROS2SpawnerEditorComponent
  19. : public ROS2SpawnerEditorComponentBase
  20. , public SpawnerRequestsBus::Handler
  21. {
  22. public:
  23. AZ_EDITOR_COMPONENT(
  24. ROS2SpawnerEditorComponent, "{5950AC6B-75F3-4E0F-BA5C-17C877013710}", AzToolsFramework::Components::EditorComponentBase);
  25. ROS2SpawnerEditorComponent() = default;
  26. explicit ROS2SpawnerEditorComponent(const ROS2SpawnerComponentConfig& configuration);
  27. ~ROS2SpawnerEditorComponent() = default;
  28. static void Reflect(AZ::ReflectContext* context);
  29. //////////////////////////////////////////////////////////////////////////
  30. // ROS2SpawnerEditorComponentBase interface overrides.
  31. void Activate() override;
  32. void Deactivate() override;
  33. bool ShouldActivateController() const override;
  34. //////////////////////////////////////////////////////////////////////////
  35. //////////////////////////////////////////////////////////////////////////
  36. // SpawnerRequestsBus::Handler overrides.
  37. const AZ::Transform& GetDefaultSpawnPose() const override;
  38. AZStd::unordered_map<AZStd::string, SpawnPointInfo> GetAllSpawnPointInfos() const override;
  39. //////////////////////////////////////////////////////////////////////////
  40. AZStd::unordered_map<AZStd::string, SpawnPointInfo> GetSpawnPoints() const;
  41. };
  42. } // namespace ROS2