17 #ifndef GZ_SIM_COMPONENTS_VISUAL_HH_
18 #define GZ_SIM_COMPONENTS_VISUAL_HH_
22 #include <sdf/parser.hh>
23 #include <sdf/Element.hh>
27 #include <gz/sim/config.hh>
34 inline namespace GZ_SIM_VERSION_NAMESPACE {
44 const sdf::ElementPtr &_elem)
46 _out <<
"<?xml version=\"1.0\" ?>"
47 <<
"<sdf version='" << SDF_PROTOCOL_VERSION <<
"'>"
48 << _elem->ToString(
"")
58 sdf::ElementPtr &_elem)
62 sdf::SDFPtr sdfParsed(
new sdf::SDF());
64 bool result = sdf::readString(sdfStr, sdfParsed);
71 _elem = sdfParsed->Root()->GetFirstElement();
84 using VisualPlugin =
Component<sdf::ElementPtr,
85 class VisualPluginTag,
86 serializers::SdfElementSerializer>;