ROS2SpawnPointEditorComponent.cpp 2.2 KB

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