17 #ifndef GZ_MSGS_CONVERT_GEOMETRYTYPE_HH_
18 #define GZ_MSGS_CONVERT_GEOMETRYTYPE_HH_
21 #include "gz/msgs/geometry.pb.h"
28 inline namespace GZ_MSGS_VERSION_NAMESPACE {
33 msgs::Geometry::Type result = msgs::Geometry::BOX;
36 result = msgs::Geometry::BOX;
38 else if (_str ==
"capsule")
40 result = msgs::Geometry::CAPSULE;
42 else if (_str ==
"cone")
44 result = msgs::Geometry::CONE;
46 else if (_str ==
"cylinder")
48 result = msgs::Geometry::CYLINDER;
50 else if (_str ==
"ellipsoid")
52 result = msgs::Geometry::ELLIPSOID;
54 else if (_str ==
"sphere")
56 result = msgs::Geometry::SPHERE;
58 else if (_str ==
"plane")
60 result = msgs::Geometry::PLANE;
62 else if (_str ==
"image")
64 result = msgs::Geometry::IMAGE;
66 else if (_str ==
"heightmap")
68 result = msgs::Geometry::HEIGHTMAP;
70 else if (_str ==
"mesh")
72 result = msgs::Geometry::MESH;
74 else if (_str ==
"polyline")
76 result = msgs::Geometry::POLYLINE;
80 std::cerr <<
"Unrecognized Geometry::Type ["
82 <<
"], returning msgs::Geometry::BOX"
95 case msgs::Geometry::BOX:
100 case msgs::Geometry::CAPSULE:
105 case msgs::Geometry::CONE:
110 case msgs::Geometry::CYLINDER:
115 case msgs::Geometry::ELLIPSOID:
117 result =
"ellipsoid";
120 case msgs::Geometry::SPHERE:
125 case msgs::Geometry::PLANE:
130 case msgs::Geometry::IMAGE:
135 case msgs::Geometry::HEIGHTMAP:
137 result =
"heightmap";
140 case msgs::Geometry::MESH:
145 case msgs::Geometry::POLYLINE:
153 std::cerr <<
"Unrecognized Geometry::Type ["
155 <<
"], returning 'unknown'"