ROS2SpawnPointEditorComponent.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 "ROS2SpawnPointEditorComponent.h"
  9. #include "Spawner/ROS2SpawnPointComponentController.h"
  10. #include "Spawner/ROS2SpawnerEditorComponent.h"
  11. namespace ROS2
  12. {
  13. ROS2SpawnPointEditorComponent::ROS2SpawnPointEditorComponent(const ROS2SpawnPointComponentConfig& configuration)
  14. : ROS2SpawnPointEditorComponentBase(configuration)
  15. {
  16. }
  17. void ROS2SpawnPointEditorComponent::Reflect(AZ::ReflectContext* context)
  18. {
  19. ROS2SpawnPointEditorComponentBase::Reflect(context);
  20. AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
  21. if (serializeContext)
  22. {
  23. serializeContext->Class<ROS2SpawnPointEditorComponent, ROS2SpawnPointEditorComponentBase>()->Version(1);
  24. AZ::EditContext* editContext = serializeContext->GetEditContext();
  25. if (editContext)
  26. {
  27. editContext->Class<ROS2SpawnPointEditorComponent>("ROS2 Spawn Point", "Spawn point for robots")
  28. ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
  29. ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game"))
  30. ->Attribute(AZ::Edit::Attributes::Icon, "Editor/Icons/Components/ROS2SpawnPoint.svg")
  31. ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Editor/Icons/Components/Viewport/ROS2SpawnPoint.svg")
  32. ->Attribute(AZ::Edit::Attributes::Category, "ROS2");
  33. }
  34. }
  35. }
  36. void ROS2SpawnPointEditorComponent::Activate()
  37. {
  38. ROS2SpawnPointEditorComponentBase::Activate();
  39. }
  40. void ROS2SpawnPointEditorComponent::Deactivate()
  41. {
  42. ROS2SpawnPointEditorComponentBase::Deactivate();
  43. }
  44. AZStd::pair<AZStd::string, SpawnPointInfo> ROS2SpawnPointEditorComponent::GetInfo() const
  45. {
  46. return m_controller.GetInfo();
  47. }
  48. } // namespace ROS2