00001
00002 #ifndef GEOMETRIC_SHAPES_MSGS_MESSAGE_SHAPE_H
00003 #define GEOMETRIC_SHAPES_MSGS_MESSAGE_SHAPE_H
00004 #include <string>
00005 #include <vector>
00006 #include <ostream>
00007 #include "ros/serialization.h"
00008 #include "ros/builtin_message_traits.h"
00009 #include "ros/message_operations.h"
00010 #include "ros/message.h"
00011 #include "ros/time.h"
00012
00013 #include "geometry_msgs/Point.h"
00014
00015 namespace geometric_shapes_msgs
00016 {
00017 template <class ContainerAllocator>
00018 struct Shape_ : public ros::Message
00019 {
00020 typedef Shape_<ContainerAllocator> Type;
00021
00022 Shape_()
00023 : type(0)
00024 , dimensions()
00025 , triangles()
00026 , vertices()
00027 {
00028 }
00029
00030 Shape_(const ContainerAllocator& _alloc)
00031 : type(0)
00032 , dimensions(_alloc)
00033 , triangles(_alloc)
00034 , vertices(_alloc)
00035 {
00036 }
00037
00038 typedef int8_t _type_type;
00039 int8_t type;
00040
00041 typedef std::vector<double, typename ContainerAllocator::template rebind<double>::other > _dimensions_type;
00042 std::vector<double, typename ContainerAllocator::template rebind<double>::other > dimensions;
00043
00044 typedef std::vector<int32_t, typename ContainerAllocator::template rebind<int32_t>::other > _triangles_type;
00045 std::vector<int32_t, typename ContainerAllocator::template rebind<int32_t>::other > triangles;
00046
00047 typedef std::vector< ::geometry_msgs::Point_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::geometry_msgs::Point_<ContainerAllocator> >::other > _vertices_type;
00048 std::vector< ::geometry_msgs::Point_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::geometry_msgs::Point_<ContainerAllocator> >::other > vertices;
00049
00050 enum { SPHERE = 0 };
00051 enum { BOX = 1 };
00052 enum { CYLINDER = 2 };
00053 enum { MESH = 3 };
00054
00055 ROS_DEPRECATED uint32_t get_dimensions_size() const { return (uint32_t)dimensions.size(); }
00056 ROS_DEPRECATED void set_dimensions_size(uint32_t size) { dimensions.resize((size_t)size); }
00057 ROS_DEPRECATED void get_dimensions_vec(std::vector<double, typename ContainerAllocator::template rebind<double>::other > & vec) const { vec = this->dimensions; }
00058 ROS_DEPRECATED void set_dimensions_vec(const std::vector<double, typename ContainerAllocator::template rebind<double>::other > & vec) { this->dimensions = vec; }
00059 ROS_DEPRECATED uint32_t get_triangles_size() const { return (uint32_t)triangles.size(); }
00060 ROS_DEPRECATED void set_triangles_size(uint32_t size) { triangles.resize((size_t)size); }
00061 ROS_DEPRECATED void get_triangles_vec(std::vector<int32_t, typename ContainerAllocator::template rebind<int32_t>::other > & vec) const { vec = this->triangles; }
00062 ROS_DEPRECATED void set_triangles_vec(const std::vector<int32_t, typename ContainerAllocator::template rebind<int32_t>::other > & vec) { this->triangles = vec; }
00063 ROS_DEPRECATED uint32_t get_vertices_size() const { return (uint32_t)vertices.size(); }
00064 ROS_DEPRECATED void set_vertices_size(uint32_t size) { vertices.resize((size_t)size); }
00065 ROS_DEPRECATED void get_vertices_vec(std::vector< ::geometry_msgs::Point_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::geometry_msgs::Point_<ContainerAllocator> >::other > & vec) const { vec = this->vertices; }
00066 ROS_DEPRECATED void set_vertices_vec(const std::vector< ::geometry_msgs::Point_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::geometry_msgs::Point_<ContainerAllocator> >::other > & vec) { this->vertices = vec; }
00067 private:
00068 static const char* __s_getDataType_() { return "geometric_shapes_msgs/Shape"; }
00069 public:
00070 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00071
00072 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00073
00074 private:
00075 static const char* __s_getMD5Sum_() { return "59935940044147de75e7523b5d37c4d7"; }
00076 public:
00077 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00078
00079 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00080
00081 private:
00082 static const char* __s_getMessageDefinition_() { return "byte SPHERE=0\n\
00083 byte BOX=1\n\
00084 byte CYLINDER=2\n\
00085 byte MESH=3\n\
00086 \n\
00087 byte type\n\
00088 \n\
00089 \n\
00090 #### define sphere, box, cylinder ####\n\
00091 # the origin of each shape is considered at the shape's center\n\
00092 \n\
00093 # for sphere\n\
00094 # radius := dimensions[0]\n\
00095 \n\
00096 # for cylinder\n\
00097 # radius := dimensions[0]\n\
00098 # length := dimensions[1]\n\
00099 # the length is along the Z axis\n\
00100 \n\
00101 # for box\n\
00102 # size_x := dimensions[0]\n\
00103 # size_y := dimensions[1]\n\
00104 # size_z := dimensions[2]\n\
00105 float64[] dimensions\n\
00106 \n\
00107 \n\
00108 #### define mesh ####\n\
00109 \n\
00110 # list of triangles; triangle k is defined by tre vertices located\n\
00111 # at indices triangles[3k], triangles[3k+1], triangles[3k+2]\n\
00112 int32[] triangles\n\
00113 geometry_msgs/Point[] vertices\n\
00114 \n\
00115 ================================================================================\n\
00116 MSG: geometry_msgs/Point\n\
00117 # This contains the position of a point in free space\n\
00118 float64 x\n\
00119 float64 y\n\
00120 float64 z\n\
00121 \n\
00122 "; }
00123 public:
00124 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00125
00126 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00127
00128 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00129 {
00130 ros::serialization::OStream stream(write_ptr, 1000000000);
00131 ros::serialization::serialize(stream, type);
00132 ros::serialization::serialize(stream, dimensions);
00133 ros::serialization::serialize(stream, triangles);
00134 ros::serialization::serialize(stream, vertices);
00135 return stream.getData();
00136 }
00137
00138 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00139 {
00140 ros::serialization::IStream stream(read_ptr, 1000000000);
00141 ros::serialization::deserialize(stream, type);
00142 ros::serialization::deserialize(stream, dimensions);
00143 ros::serialization::deserialize(stream, triangles);
00144 ros::serialization::deserialize(stream, vertices);
00145 return stream.getData();
00146 }
00147
00148 ROS_DEPRECATED virtual uint32_t serializationLength() const
00149 {
00150 uint32_t size = 0;
00151 size += ros::serialization::serializationLength(type);
00152 size += ros::serialization::serializationLength(dimensions);
00153 size += ros::serialization::serializationLength(triangles);
00154 size += ros::serialization::serializationLength(vertices);
00155 return size;
00156 }
00157
00158 typedef boost::shared_ptr< ::geometric_shapes_msgs::Shape_<ContainerAllocator> > Ptr;
00159 typedef boost::shared_ptr< ::geometric_shapes_msgs::Shape_<ContainerAllocator> const> ConstPtr;
00160 };
00161 typedef ::geometric_shapes_msgs::Shape_<std::allocator<void> > Shape;
00162
00163 typedef boost::shared_ptr< ::geometric_shapes_msgs::Shape> ShapePtr;
00164 typedef boost::shared_ptr< ::geometric_shapes_msgs::Shape const> ShapeConstPtr;
00165
00166
00167 template<typename ContainerAllocator>
00168 std::ostream& operator<<(std::ostream& s, const ::geometric_shapes_msgs::Shape_<ContainerAllocator> & v)
00169 {
00170 ros::message_operations::Printer< ::geometric_shapes_msgs::Shape_<ContainerAllocator> >::stream(s, "", v);
00171 return s;}
00172
00173 }
00174
00175 namespace ros
00176 {
00177 namespace message_traits
00178 {
00179 template<class ContainerAllocator>
00180 struct MD5Sum< ::geometric_shapes_msgs::Shape_<ContainerAllocator> > {
00181 static const char* value()
00182 {
00183 return "59935940044147de75e7523b5d37c4d7";
00184 }
00185
00186 static const char* value(const ::geometric_shapes_msgs::Shape_<ContainerAllocator> &) { return value(); }
00187 static const uint64_t static_value1 = 0x59935940044147deULL;
00188 static const uint64_t static_value2 = 0x75e7523b5d37c4d7ULL;
00189 };
00190
00191 template<class ContainerAllocator>
00192 struct DataType< ::geometric_shapes_msgs::Shape_<ContainerAllocator> > {
00193 static const char* value()
00194 {
00195 return "geometric_shapes_msgs/Shape";
00196 }
00197
00198 static const char* value(const ::geometric_shapes_msgs::Shape_<ContainerAllocator> &) { return value(); }
00199 };
00200
00201 template<class ContainerAllocator>
00202 struct Definition< ::geometric_shapes_msgs::Shape_<ContainerAllocator> > {
00203 static const char* value()
00204 {
00205 return "byte SPHERE=0\n\
00206 byte BOX=1\n\
00207 byte CYLINDER=2\n\
00208 byte MESH=3\n\
00209 \n\
00210 byte type\n\
00211 \n\
00212 \n\
00213 #### define sphere, box, cylinder ####\n\
00214 # the origin of each shape is considered at the shape's center\n\
00215 \n\
00216 # for sphere\n\
00217 # radius := dimensions[0]\n\
00218 \n\
00219 # for cylinder\n\
00220 # radius := dimensions[0]\n\
00221 # length := dimensions[1]\n\
00222 # the length is along the Z axis\n\
00223 \n\
00224 # for box\n\
00225 # size_x := dimensions[0]\n\
00226 # size_y := dimensions[1]\n\
00227 # size_z := dimensions[2]\n\
00228 float64[] dimensions\n\
00229 \n\
00230 \n\
00231 #### define mesh ####\n\
00232 \n\
00233 # list of triangles; triangle k is defined by tre vertices located\n\
00234 # at indices triangles[3k], triangles[3k+1], triangles[3k+2]\n\
00235 int32[] triangles\n\
00236 geometry_msgs/Point[] vertices\n\
00237 \n\
00238 ================================================================================\n\
00239 MSG: geometry_msgs/Point\n\
00240 # This contains the position of a point in free space\n\
00241 float64 x\n\
00242 float64 y\n\
00243 float64 z\n\
00244 \n\
00245 ";
00246 }
00247
00248 static const char* value(const ::geometric_shapes_msgs::Shape_<ContainerAllocator> &) { return value(); }
00249 };
00250
00251 }
00252 }
00253
00254 namespace ros
00255 {
00256 namespace serialization
00257 {
00258
00259 template<class ContainerAllocator> struct Serializer< ::geometric_shapes_msgs::Shape_<ContainerAllocator> >
00260 {
00261 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00262 {
00263 stream.next(m.type);
00264 stream.next(m.dimensions);
00265 stream.next(m.triangles);
00266 stream.next(m.vertices);
00267 }
00268
00269 ROS_DECLARE_ALLINONE_SERIALIZER;
00270 };
00271 }
00272 }
00273
00274 namespace ros
00275 {
00276 namespace message_operations
00277 {
00278
00279 template<class ContainerAllocator>
00280 struct Printer< ::geometric_shapes_msgs::Shape_<ContainerAllocator> >
00281 {
00282 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::geometric_shapes_msgs::Shape_<ContainerAllocator> & v)
00283 {
00284 s << indent << "type: ";
00285 Printer<int8_t>::stream(s, indent + " ", v.type);
00286 s << indent << "dimensions[]" << std::endl;
00287 for (size_t i = 0; i < v.dimensions.size(); ++i)
00288 {
00289 s << indent << " dimensions[" << i << "]: ";
00290 Printer<double>::stream(s, indent + " ", v.dimensions[i]);
00291 }
00292 s << indent << "triangles[]" << std::endl;
00293 for (size_t i = 0; i < v.triangles.size(); ++i)
00294 {
00295 s << indent << " triangles[" << i << "]: ";
00296 Printer<int32_t>::stream(s, indent + " ", v.triangles[i]);
00297 }
00298 s << indent << "vertices[]" << std::endl;
00299 for (size_t i = 0; i < v.vertices.size(); ++i)
00300 {
00301 s << indent << " vertices[" << i << "]: ";
00302 s << std::endl;
00303 s << indent;
00304 Printer< ::geometry_msgs::Point_<ContainerAllocator> >::stream(s, indent + " ", v.vertices[i]);
00305 }
00306 }
00307 };
00308
00309
00310 }
00311 }
00312
00313 #endif // GEOMETRIC_SHAPES_MSGS_MESSAGE_SHAPE_H
00314