RobWorkProject
Public Member Functions | List of all members
Cylinder Class Reference

a cylinder primitive. By default the radius is in the x-y plane and height is along the z-axis More...

#include <Cylinder.hpp>

Inherits Primitive.

Public Member Functions

 Cylinder ()
 constructor
 
 Cylinder (float radius, float height)
 Constructs cylinder primitive with the specified setup. More...
 
 Cylinder (const rw::math::Q &initQ)
 Constructor. More...
 
 Cylinder (const rw::math::Transform3D<> &transform, float radius, float height)
 Construct cylinder primitive with specified radius and height and with the given transform. More...
 
virtual ~Cylinder ()
 destructor
 
double getRadius () const
 Get the radius of the cylinder. More...
 
double getHeight () const
 Get the height of the cylinder. More...
 
const rw::math::Transform3D< float > & getTransform () const
 Returns the transform of the cylinder. More...
 
TriMesh::Ptr createMesh (int resolution) const
 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
 get the parameters that define this primitive More...
 
virtual void setParameters (const rw::math::Q &q)
 set the parameters that define this primitive More...
 
GeometryType getType () const
 the type of this primitive More...
 
- Public Member Functions inherited from Primitive
virtual ~Primitive ()
 destructor
 
TriMesh::Ptr getTriMesh (bool forceCopy=true)
 gets a trimesh representation of this geometry data. More...
 
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.
 

Additional Inherited Members

- Public Types inherited from Primitive
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
 
- Static Public Member Functions inherited from GeometryData
static std::string toString (GeometryType type)
 format GeometryType to string More...
 
- Protected Member Functions inherited from Primitive
virtual bool doIsInside (const rw::math::Vector3D<> &point)
 Check if point lies inside geometry. More...
 
 Primitive ()
 Constructor.
 

Detailed Description

a cylinder primitive. By default the radius is in the x-y plane and height is along the z-axis

Constructor & Destructor Documentation

◆ Cylinder() [1/3]

Cylinder ( float  radius,
float  height 
)

Constructs cylinder primitive with the specified setup.

The cylinder is aligned with the height in the z-direction.

Parameters
radius[in] radius of the cylinder.
height[in] height of the cylinder.

◆ Cylinder() [2/3]

Cylinder ( const rw::math::Q initQ)

Constructor.

Parameters
initQ[in] vector with (height, radius)

◆ Cylinder() [3/3]

Cylinder ( const rw::math::Transform3D<> &  transform,
float  radius,
float  height 
)

Construct cylinder primitive with specified radius and height and with the given transform.

The cylinder will be centered in the position of transform and oriented in the direction of the third column of the rotation matrix of transform.

Parameters
transform[in] The transform specifying how the pose of the cylinder
radius[in] radius of the cylinder.
height[in] height of the cylinder.

Member Function Documentation

◆ createMesh()

TriMesh::Ptr createMesh ( int  resolution) const
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]

Implements Primitive.

◆ getHeight()

double getHeight ( ) const
inline

Get the height of the cylinder.

Returns
the height.

◆ getParameters()

virtual rw::math::Q getParameters ( ) const
virtual

get the parameters that define this primitive

Implements Primitive.

◆ getRadius()

double getRadius ( ) const
inline

Get the radius of the cylinder.

Returns
the radius.

◆ getTransform()

const rw::math::Transform3D<float>& getTransform ( ) const
inline

Returns the transform of the cylinder.

Default is the identity matrix unless a transform has been specified.

Returns
Transform of the cylinder

◆ getType()

GeometryType getType ( ) const
inlinevirtual

the type of this primitive

Implements GeometryData.

◆ setParameters()

virtual void setParameters ( const rw::math::Q q)
virtual

set the parameters that define this primitive

Implements Primitive.


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