/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include #include #include #include #include #include #include namespace ROS2 { void ROS2FrameConfiguration::Reflect(AZ::ReflectContext* context) { NamespaceConfiguration::Reflect(context); if (AZ::SerializeContext* serialize = azrtti_cast(context)) { serialize->Class() ->Version(1) ->Field("Namespace Configuration", &ROS2FrameConfiguration::m_namespaceConfiguration) ->Field("Frame Name", &ROS2FrameConfiguration::m_frameName) ->Field("Joint Name", &ROS2FrameConfiguration::m_jointName) ->Field("Publish Transform", &ROS2FrameConfiguration::m_publishTransform); if (AZ::EditContext* ec = serialize->GetEditContext()) { ec->Class("ROS2 Frame configuration", "[ROS2 Frame component configuration]") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->DataElement( AZ::Edit::UIHandlers::Default, &ROS2FrameConfiguration::m_namespaceConfiguration, "Namespace Configuration", "Namespace Configuration") ->DataElement(AZ::Edit::UIHandlers::Default, &ROS2FrameConfiguration::m_frameName, "Frame Name", "Frame Name") ->DataElement(AZ::Edit::UIHandlers::Default, &ROS2FrameConfiguration::m_jointName, "Joint Name", "Joint Name") ->DataElement( AZ::Edit::UIHandlers::Default, &ROS2FrameConfiguration::m_publishTransform, "Publish Transform", "Publish Transform") ->ClassElement(AZ::Edit::ClassElements::Group, "Info") ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->UIElement(AZ::Edit::UIHandlers::Label, "Effective namespace", "") ->Attribute(AZ::Edit::Attributes::ValueText, &ROS2FrameConfiguration::m_effectiveNamespace) ->UIElement(AZ::Edit::UIHandlers::Label, "Full name", "") ->Attribute(AZ::Edit::Attributes::ValueText, &ROS2FrameConfiguration::m_fullName); } } } void ROS2FrameConfiguration::SetEffectiveNamespace(const AZStd::string& effectiveNamespace) { m_effectiveNamespace = effectiveNamespace; m_fullName = effectiveNamespace + '/' + m_frameName; } } // namespace ROS2