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 virtual void scaleAndPadd(
double scale,
double padd);
118 virtual Shape* clone()
const;
119 virtual void print(std::ostream& out = std::cout)
const;
138 virtual void scaleAndPadd(
double scale,
double padd);
139 virtual Shape* clone()
const;
140 virtual void print(std::ostream& out = std::cout)
const;
156 Cone(
double r,
double l);
161 virtual void scaleAndPadd(
double scale,
double padd);
162 virtual Shape* clone()
const;
163 virtual void print(std::ostream& out = std::cout)
const;
178 Box(
double x,
double y,
double z);
183 virtual void scaleAndPadd(
double scale,
double padd);
184 virtual Shape* clone()
const;
185 virtual void print(std::ostream& out = std::cout)
const;
200 Mesh(
unsigned int v_count,
unsigned int t_count);
206 virtual void scaleAndPadd(
double scale,
double padd);
207 virtual Shape* clone()
const;
208 virtual void print(std::ostream& out = std::cout)
const;
211 void computeTriangleNormals();
216 void computeVertexNormals();
219 void mergeVertices(
double threshold);
249 Plane(
double pa,
double pb,
double pc,
double pd);
254 virtual Shape* clone()
const;
255 virtual void print(std::ostream& out = std::cout)
const;
256 virtual void scaleAndPadd(
double scale,
double padd);
257 virtual bool isFixed()
const;
268 OcTree(
const std::shared_ptr<const octomap::OcTree>& t);
273 virtual Shape* clone()
const;
274 virtual void print(std::ostream& out = std::cout)
const;
275 virtual void scaleAndPadd(
double scale,
double padd);
276 virtual bool isFixed()
const;
278 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.
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.