Namespaces | Classes | Typedefs | Enumerations | Functions
shapes Namespace Reference

Definition of various shapes. No properties such as position are included. These are simply the descriptions and dimensions of shapes. More...

Namespaces

 detail
 

Classes

class  Box
 Definition of a box Aligned with the XYZ axes. More...
 
class  Cone
 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. More...
 
class  Cylinder
 Definition of a cylinder Length is along z axis. Origin is at center of mass. More...
 
class  Mesh
 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. More...
 
class  OcTree
 Representation of an octomap::OcTree as a Shape. More...
 
class  Plane
 Definition of a plane with equation ax + by + cz + d = 0. More...
 
class  Shape
 A basic definition of a shape. Shapes are considered centered at origin. More...
 
class  Sphere
 Definition of a sphere. More...
 

Typedefs

typedef std::shared_ptr< const ShapeShapeConstPtr
 Shared pointer to a const Shape. More...
 
typedef boost::variant< shape_msgs::SolidPrimitive, shape_msgs::Mesh, shape_msgs::Plane > ShapeMsg
 Type that can hold any of the desired shape message types. More...
 
typedef std::shared_ptr< ShapeShapePtr
 Shared pointer to a Shape. More...
 

Enumerations

enum  ShapeType {
  UNKNOWN_SHAPE, SPHERE, CYLINDER, CONE,
  BOX, PLANE, MESH, OCTREE
}
 A list of known shape types. More...
 

Functions

void computeShapeBoundingSphere (const Shape *shape, Eigen::Vector3d &center, double &radius)
 Compute a sphere bounding a shape. More...
 
Eigen::Vector3d computeShapeExtents (const Shape *shape)
 Compute the extents of a shape. More...
 
Eigen::Vector3d computeShapeExtents (const ShapeMsg &shape_msg)
 Compute the extents of a shape. More...
 
bool constructMarkerFromShape (const Shape *shape, visualization_msgs::Marker &mk, bool use_mesh_triangle_list=false)
 Construct the marker that corresponds to the shape. Return false on failure. More...
 
bool constructMsgFromShape (const Shape *shape, ShapeMsg &shape_msg)
 Construct the message that corresponds to the shape. Return false on failure. More...
 
ShapeconstructShapeFromMsg (const shape_msgs::Mesh &shape_msg)
 Construct the shape that corresponds to the message. Return NULL on failure. More...
 
ShapeconstructShapeFromMsg (const shape_msgs::Plane &shape_msg)
 Construct the shape that corresponds to the message. Return NULL on failure. More...
 
ShapeconstructShapeFromMsg (const shape_msgs::SolidPrimitive &shape_msg)
 Construct the shape that corresponds to the message. Return NULL on failure. More...
 
ShapeconstructShapeFromMsg (const ShapeMsg &shape_msg)
 Construct the shape that corresponds to the message. Return NULL on failure. More...
 
ShapeconstructShapeFromText (std::istream &in)
 Construct a shape from plain text description. More...
 
MeshcreateMeshFromAsset (const aiScene *scene, const Eigen::Vector3d &scale, const std::string &assimp_hint=std::string())
 Load a mesh from an assimp datastructure. More...
 
MeshcreateMeshFromAsset (const aiScene *scene, const std::string &assimp_hint=std::string())
 Load a mesh from an assimp datastructure. More...
 
MeshcreateMeshFromBinary (const char *buffer, std::size_t size, const Eigen::Vector3d &scale, const std::string &assimp_hint=std::string())
 Load a mesh from a resource that contains a mesh that can be loaded by assimp. More...
 
MeshcreateMeshFromBinary (const char *buffer, std::size_t size, const std::string &assimp_hint=std::string())
 Load a mesh from a binary stream that contains a mesh that can be loaded by assimp. More...
 
MeshcreateMeshFromResource (const std::string &resource)
 Load a mesh from a resource that contains a mesh that can be loaded by assimp. More...
 
MeshcreateMeshFromResource (const std::string &resource, const Eigen::Vector3d &scale)
 Load a mesh from a resource that contains a mesh that can be loaded by assimp. More...
 
MeshcreateMeshFromShape (const Box &box)
 Construct a mesh from a box. More...
 
MeshcreateMeshFromShape (const Cone &cone)
 Construct a mesh from a cone. More...
 
MeshcreateMeshFromShape (const Cylinder &cylinder)
 Construct a mesh from a cylinder. More...
 
MeshcreateMeshFromShape (const Shape *shape)
 Construct a mesh from a primitive shape that is NOT already a mesh. This call allocates a new object. More...
 
MeshcreateMeshFromShape (const Sphere &sphere)
 Construct a mesh from a sphere. More...
 
MeshcreateMeshFromVertices (const EigenSTL::vector_Vector3d &source)
 Load a mesh from a set of vertices. More...
 
MeshcreateMeshFromVertices (const EigenSTL::vector_Vector3d &vertices, const std::vector< unsigned int > &triangles)
 Load a mesh from a set of vertices. More...
 
std::ostream & operator<< (std::ostream &ss, ShapeType type)
 
void saveAsText (const Shape *shape, std::ostream &out)
 Save all the information about this shape as plain text. More...
 
const std::string & shapeStringName (const Shape *shape)
 Get the string name of the shape. More...
 
void writeSTLBinary (const Mesh *mesh, std::vector< char > &buffer)
 Write the mesh to a buffer in STL format. More...
 

Detailed Description

Definition of various shapes. No properties such as position are included. These are simply the descriptions and dimensions of shapes.

Typedef Documentation

◆ ShapeConstPtr

typedef std::shared_ptr<const Shape> shapes::ShapeConstPtr

Shared pointer to a const Shape.

Definition at line 407 of file shapes.h.

◆ ShapeMsg

typedef boost::variant<shape_msgs::SolidPrimitive, shape_msgs::Mesh, shape_msgs::Plane> shapes::ShapeMsg

Type that can hold any of the desired shape message types.

Definition at line 84 of file shape_messages.h.

◆ ShapePtr

typedef std::shared_ptr<Shape> shapes::ShapePtr

Shared pointer to a Shape.

Definition at line 404 of file shapes.h.

Enumeration Type Documentation

◆ ShapeType

A list of known shape types.

Enumerator
UNKNOWN_SHAPE 
SPHERE 
CYLINDER 
CONE 
BOX 
PLANE 
MESH 
OCTREE 

Definition at line 61 of file shapes.h.

Function Documentation

◆ computeShapeBoundingSphere()

void shapes::computeShapeBoundingSphere ( const Shape shape,
Eigen::Vector3d center,
double &  radius 
)

Compute a sphere bounding a shape.

Definition at line 312 of file shape_operations.cpp.

◆ computeShapeExtents() [1/2]

Eigen::Vector3d shapes::computeShapeExtents ( const Shape shape)

Compute the extents of a shape.

Definition at line 262 of file shape_operations.cpp.

◆ computeShapeExtents() [2/2]

Eigen::Vector3d shapes::computeShapeExtents ( const ShapeMsg shape_msg)

Compute the extents of a shape.

Definition at line 257 of file shape_operations.cpp.

◆ constructMarkerFromShape()

bool shapes::constructMarkerFromShape ( const Shape shape,
visualization_msgs::Marker &  mk,
bool  use_mesh_triangle_list = false 
)

Construct the marker that corresponds to the shape. Return false on failure.

Definition at line 207 of file shape_operations.cpp.

◆ constructMsgFromShape()

bool shapes::constructMsgFromShape ( const Shape shape,
ShapeMsg shape_msg 
)

Construct the message that corresponds to the shape. Return false on failure.

Definition at line 378 of file shape_operations.cpp.

◆ constructShapeFromMsg() [1/4]

Shape * shapes::constructShapeFromMsg ( const shape_msgs::Mesh &  shape_msg)

Construct the shape that corresponds to the message. Return NULL on failure.

Definition at line 92 of file shape_operations.cpp.

◆ constructShapeFromMsg() [2/4]

Shape * shapes::constructShapeFromMsg ( const shape_msgs::Plane &  shape_msg)

Construct the shape that corresponds to the message. Return NULL on failure.

Definition at line 87 of file shape_operations.cpp.

◆ constructShapeFromMsg() [3/4]

Shape * shapes::constructShapeFromMsg ( const shape_msgs::SolidPrimitive &  shape_msg)

Construct the shape that corresponds to the message. Return NULL on failure.

Definition at line 116 of file shape_operations.cpp.

◆ constructShapeFromMsg() [4/4]

Shape * shapes::constructShapeFromMsg ( const ShapeMsg shape_msg)

Construct the shape that corresponds to the message. Return NULL on failure.

Definition at line 171 of file shape_operations.cpp.

◆ constructShapeFromText()

Shape * shapes::constructShapeFromText ( std::istream &  in)

Construct a shape from plain text description.

Definition at line 514 of file shape_operations.cpp.

◆ createMeshFromAsset() [1/2]

Mesh * shapes::createMeshFromAsset ( const aiScene *  scene,
const Eigen::Vector3d scale,
const std::string &  assimp_hint = std::string() 
)

Load a mesh from an assimp datastructure.

Definition at line 366 of file mesh_operations.cpp.

◆ createMeshFromAsset() [2/2]

Mesh * shapes::createMeshFromAsset ( const aiScene *  scene,
const std::string &  assimp_hint = std::string() 
)

Load a mesh from an assimp datastructure.

Definition at line 360 of file mesh_operations.cpp.

◆ createMeshFromBinary() [1/2]

Mesh * shapes::createMeshFromBinary ( const char *  buffer,
std::size_t  size,
const Eigen::Vector3d scale,
const std::string &  assimp_hint = std::string() 
)

Load a mesh from a resource that contains a mesh that can be loaded by assimp.

Definition at line 246 of file mesh_operations.cpp.

◆ createMeshFromBinary() [2/2]

Mesh * shapes::createMeshFromBinary ( const char *  buffer,
std::size_t  size,
const std::string &  assimp_hint = std::string() 
)

Load a mesh from a binary stream that contains a mesh that can be loaded by assimp.

Definition at line 240 of file mesh_operations.cpp.

◆ createMeshFromResource() [1/2]

Mesh * shapes::createMeshFromResource ( const std::string &  resource)

Load a mesh from a resource that contains a mesh that can be loaded by assimp.

Definition at line 234 of file mesh_operations.cpp.

◆ createMeshFromResource() [2/2]

Mesh * shapes::createMeshFromResource ( const std::string &  resource,
const Eigen::Vector3d scale 
)

Load a mesh from a resource that contains a mesh that can be loaded by assimp.

Definition at line 299 of file mesh_operations.cpp.

◆ createMeshFromShape() [1/5]

Mesh * shapes::createMeshFromShape ( const Box box)

Construct a mesh from a box.

Definition at line 405 of file mesh_operations.cpp.

◆ createMeshFromShape() [2/5]

Mesh * shapes::createMeshFromShape ( const Cone cone)

Construct a mesh from a cone.

Definition at line 593 of file mesh_operations.cpp.

◆ createMeshFromShape() [3/5]

Mesh * shapes::createMeshFromShape ( const Cylinder cylinder)

Construct a mesh from a cylinder.

Definition at line 522 of file mesh_operations.cpp.

◆ createMeshFromShape() [4/5]

Mesh * shapes::createMeshFromShape ( const Shape shape)

Construct a mesh from a primitive shape that is NOT already a mesh. This call allocates a new object.

Definition at line 390 of file mesh_operations.cpp.

◆ createMeshFromShape() [5/5]

Mesh * shapes::createMeshFromShape ( const Sphere sphere)

Construct a mesh from a sphere.

Definition at line 453 of file mesh_operations.cpp.

◆ createMeshFromVertices() [1/2]

Mesh * shapes::createMeshFromVertices ( const EigenSTL::vector_Vector3d source)

Load a mesh from a set of vertices.

Every 3 vertices are considered a triangle. Repeating vertices are identified and the set of triangle indices is constructed. The normal at each triangle is also computed

Definition at line 158 of file mesh_operations.cpp.

◆ createMeshFromVertices() [2/2]

Mesh * shapes::createMeshFromVertices ( const EigenSTL::vector_Vector3d vertices,
const std::vector< unsigned int > &  triangles 
)

Load a mesh from a set of vertices.

Triangles are constructed using index values from the triangles vector. Triangle k has vertices at index values triangles[3k], triangles[3k+1], triangles[3k+2]

Definition at line 140 of file mesh_operations.cpp.

◆ operator<<()

std::ostream & shapes::operator<< ( std::ostream &  ss,
ShapeType  type 
)

Definition at line 84 of file shapes.cpp.

◆ saveAsText()

void shapes::saveAsText ( const Shape shape,
std::ostream &  out 
)

Save all the information about this shape as plain text.

Definition at line 460 of file shape_operations.cpp.

◆ shapeStringName()

const std::string & shapes::shapeStringName ( const Shape shape)

Get the string name of the shape.

Definition at line 579 of file shape_operations.cpp.

◆ writeSTLBinary()

void shapes::writeSTLBinary ( const Mesh mesh,
std::vector< char > &  buffer 
)

Write the mesh to a buffer in STL format.

Definition at line 672 of file mesh_operations.cpp.



geometric_shapes
Author(s): Ioan Sucan , Gil Jones
autogenerated on Tue Aug 13 2024 02:40:57