RobWorkProject
Public Types | Public Member Functions | Protected Member Functions | List of all members
Primitive Class Referenceabstract

defines an interface for a geometric shape that is defined by a set of parameters. More...

#include <Primitive.hpp>

Inherits GeometryData.

Inherited by Box, Cone, Cylinder, JawPrimitive, Line, Plane, Pyramid, Sphere, Tube, and SimpleFinger.

Public Types

typedef rw::common::Ptr< PrimitivePtr
 Smart pointer to this type of class.
 
- Public Types inherited from GeometryData
enum  GeometryType {
  PointCloud, LineMesh, PlainTriMesh, IdxTriMesh,
  SpherePrim, BoxPrim, OBBPrim, AABBPrim,
  LinePrim, PointPrim, PyramidPrim, ConePrim,
  TrianglePrim, CylinderPrim, TubePrim, PlanePrim,
  RayPrim, Quadratic, UserType
}
 geometry data types
 
typedef rw::common::Ptr< GeometryDataPtr
 smart pointer type to this class
 

Public Member Functions

virtual ~Primitive ()
 destructor
 
TriMesh::Ptr getTriMesh (bool forceCopy=true)
 gets a trimesh representation of this geometry data. More...
 
virtual TriMesh::Ptr createMesh (int resolution) const =0
 make a trimesh from this primitive. Use granularity to specify minimum number of line segments a half circle is split into More...
 
virtual rw::math::Q getParameters () const =0
 get the parameters that define this primitive
 
virtual void setParameters (const rw::math::Q &q)=0
 set the parameters that define this primitive
 
virtual bool isConvex ()
 test if this geometry data is convex More...
 
bool isInside (const rw::math::Vector3D<> &point)
 test if a point is on the border or inside this primitive
 
- Public Member Functions inherited from GeometryData
virtual ~GeometryData ()
 Destructor.
 
virtual GeometryType getType () const =0
 the type of this primitive
 

Protected Member Functions

virtual bool doIsInside (const rw::math::Vector3D<> &point)
 Check if point lies inside geometry. More...
 
 Primitive ()
 Constructor.
 

Additional Inherited Members

- Static Public Member Functions inherited from GeometryData
static std::string toString (GeometryType type)
 format GeometryType to string More...
 

Detailed Description

defines an interface for a geometric shape that is defined by a set of parameters.

Member Function Documentation

◆ createMesh()

virtual TriMesh::Ptr createMesh ( int  resolution) const
pure virtual

make a trimesh from this primitive. Use granularity to specify minimum number of line segments a half circle is split into

Parameters
resolution[in]

Implemented in Plane, Line, Cylinder, JawPrimitive, Tube, Cone, Ray, Box, Pyramid, SimpleFinger, and Sphere.

◆ doIsInside()

virtual bool doIsInside ( const rw::math::Vector3D<> &  point)
inlineprotectedvirtual

Check if point lies inside geometry.

Parameters
point[in] point to check.
Returns
true if inside geometry, false otherwise.

Reimplemented in Plane, Tube, Cone, Box, Pyramid, and Sphere.

◆ getTriMesh()

TriMesh::Ptr getTriMesh ( bool  forceCopy = true)
inlinevirtual

gets a trimesh representation of this geometry data.

The trimesh that is returned is by default a copy, which means ownership is transfered to the caller. Specifying forceCopy to false will enable copy by reference and ownership is not necesarilly transfered. This is more efficient, though pointer is only alive as long as this GeometryData is alive.

Returns
TriMesh representation of this GeometryData
Note
primitives allways return a new trimesh

Implements GeometryData.

◆ isConvex()

virtual bool isConvex ( )
inlinevirtual

test if this geometry data is convex

Returns

Reimplemented from GeometryData.


The documentation for this class was generated from the following file: