37 #ifndef GEOMETRIC_SHAPES_SHAPES_ 38 #define GEOMETRIC_SHAPES_SHAPES_ 40 #if __cplusplus <= 199711L 41 #error This header requires at least C++11 84 virtual Shape* clone()
const = 0;
87 virtual void print(std::ostream& out = std::cout)
const;
90 void scale(
double scale);
93 void padd(
double padding);
96 virtual void scaleAndPadd(
double scale,
double padd) = 0;
99 virtual bool isFixed()
const;
117 void scaleAndPadd(
double scale,
double padd)
override;
118 Sphere* clone()
const override;
119 void print(std::ostream& out = std::cout)
const override;
146 void scale(
double scaleRadius,
double scaleLength);
153 void padd(
double paddRadius,
double paddLength);
162 void scaleAndPadd(
double scaleRadius,
double scaleLength,
double paddRadius,
double paddLength);
164 void scaleAndPadd(
double scale,
double padd)
override;
166 void print(std::ostream& out = std::cout)
const override;
185 Cone(
double r,
double l);
195 void scale(
double scaleRadius,
double scaleLength);
202 void padd(
double paddRadius,
double paddLength);
211 void scaleAndPadd(
double scaleRadius,
double scaleLength,
double paddRadius,
double paddLength);
213 void scaleAndPadd(
double scale,
double padd)
override;
214 Cone* clone()
const override;
215 void print(std::ostream& out = std::cout)
const override;
233 Box(
double x,
double y,
double z);
244 void scale(
double scaleX,
double scaleY,
double scaleZ);
252 void padd(
double paddX,
double paddY,
double paddZ);
263 void scaleAndPadd(
double scaleX,
double scaleY,
double scaleZ,
double paddX,
double paddY,
double paddZ);
265 void scaleAndPadd(
double scale,
double padd)
override;
266 Box* clone()
const override;
267 void print(std::ostream& out = std::cout)
const override;
288 Mesh(
unsigned int v_count,
unsigned int t_count);
300 void scale(
double scaleX,
double scaleY,
double scaleZ);
311 void padd(
double paddX,
double paddY,
double paddZ);
325 void scaleAndPadd(
double scaleX,
double scaleY,
double scaleZ,
double paddX,
double paddY,
double paddZ);
327 void scaleAndPadd(
double scale,
double padd)
override;
328 Mesh* clone()
const override;
329 void print(std::ostream& out = std::cout)
const override;
332 void computeTriangleNormals();
337 void computeVertexNormals();
340 void mergeVertices(
double threshold);
370 Plane(
double pa,
double pb,
double pc,
double pd);
375 Plane* clone()
const override;
376 void print(std::ostream& out = std::cout)
const override;
377 void scaleAndPadd(
double scale,
double padd)
override;
378 bool isFixed()
const override;
389 OcTree(
const std::shared_ptr<const octomap::OcTree>& t);
394 OcTree* clone()
const override;
395 void print(std::ostream& out = std::cout)
const override;
396 void scaleAndPadd(
double scale,
double padd)
override;
397 bool isFixed()
const override;
399 std::shared_ptr<const octomap::OcTree>
octree;
Definition of various shapes. No properties such as position are included. These are simply the descr...
double radius
The radius of the cylinder.
Definition of a cylinder Length is along z axis. Origin is at center of mass.
double length
The length (height) of the cone.
ShapeType type
The type of the shape.
double radius
The radius of the cone.
static const std::string STRING_NAME
The type of the shape, as a string.
double length
The length of the cylinder.
unsigned int * triangles
The vertex indices for each triangle triangle k has vertices at index (3k, 3k+1, 3k+2) = (v1...
std::shared_ptr< Shape > ShapePtr
Shared pointer to a Shape.
ROSCONSOLE_DECL void print(FilterBase *filter, void *logger, Level level, const char *file, int line, const char *function, const char *fmt,...) ROSCONSOLE_PRINTF_ATTRIBUTE(7
Definition of a plane with equation ax + by + cz + d = 0.
double * vertex_normals
The normal to each vertex; unit vector represented as (x,y,z); If missing from the mesh...
Representation of an octomap::OcTree as a Shape.
std::shared_ptr< const octomap::OcTree > octree
Definition of a cone Tip is on positive z axis. Center of base is on negative z axis. Origin is halway between tip and center of base.
unsigned int vertex_count
The number of available vertices.
A basic definition of a shape. Shapes are considered centered at origin.
std::ostream & operator<<(std::ostream &out, ColorOcTreeNode::Color const &c)
unsigned int triangle_count
The number of triangles formed with the vertices.
ShapeType
A list of known shape types.
double * vertices
The position for each vertex vertex k has values at index (3k, 3k+1, 3k+2) = (x,y,z)
double * triangle_normals
The normal to each triangle; unit vector represented as (x,y,z); If missing from the mesh...
static const std::string STRING_NAME
The type of the shape, as a string.
static const std::string STRING_NAME
The type of the shape, as a string.
Definition of a triangle mesh By convention the "center" of the shape is at the origin. For a mesh this implies that the AABB of the mesh is centered at the origin. Some methods may not work with arbitrary meshes whose AABB is not centered at the origin. Padding is not applied to vertices plainly coordinate-wise, but instead the padding value is added to the length of the direction vector between centroid and each vertex.
Definition of a box Aligned with the XYZ axes.
static const std::string STRING_NAME
The type of the shape, as a string.
double radius
The radius of the sphere.
static const std::string STRING_NAME
The type of the shape, as a string.
static const std::string STRING_NAME
The type of the shape, as a string.
static const std::string STRING_NAME
The type of the shape, as a string.
std::shared_ptr< const Shape > ShapeConstPtr
Shared pointer to a const Shape.