Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
bodies::Cylinder Class Reference

Definition of a cylinder. More...

#include <bodies.h>

Inheritance diagram for bodies::Cylinder:
Inheritance graph
[legend]

Public Member Functions

virtual BodyPtr cloneAt (const Eigen::Isometry3d &pose, double padding, double scale) const
 Get a clone of this body, but one that is located at the pose pose and has possibly different passing and scaling: padding and scaling. This function is useful to implement thread safety, when bodies need to be moved around. More...
 
virtual void computeBoundingBox (AABB &bbox) const
 Compute the axis-aligned bounding box for the body, in its current pose. Scaling and padding are accounted for. More...
 
virtual void computeBoundingCylinder (BoundingCylinder &cylinder) const
 Compute the bounding cylinder for the body, in its current pose. Scaling and padding are accounted for. More...
 
virtual void computeBoundingSphere (BoundingSphere &sphere) const
 Compute the bounding radius for the body, in its current pose. Scaling and padding are accounted for. More...
 
virtual double computeVolume () const
 Compute the volume of the body. This method includes changes induced by scaling and padding. More...
 
virtual bool containsPoint (const Eigen::Vector3d &p, bool verbose=false) const
 Check if a point is inside the body. Surface points are included. More...
 
 Cylinder ()
 
 Cylinder (const shapes::Shape *shape)
 
virtual std::vector< double > getDimensions () const
 Get the radius & length of the cylinder. More...
 
virtual bool intersectsRay (const Eigen::Vector3d &origin, const Eigen::Vector3d &dir, EigenSTL::vector_Vector3d *intersections=NULL, unsigned int count=0) const
 Check if a ray intersects the body, and find the set of intersections, in order, along the ray. A maximum number of intersections can be specified as well. If that number is 0, all intersections are returned. More...
 
virtual bool samplePointInside (random_numbers::RandomNumberGenerator &rng, unsigned int max_attempts, Eigen::Vector3d &result)
 Sample a point that is included in the body using a given random number generator. More...
 
virtual ~Cylinder ()
 
- Public Member Functions inherited from bodies::Body
 Body ()
 
BodyPtr cloneAt (const Eigen::Isometry3d &pose) const
 Get a clone of this body, but one that is located at the pose pose. More...
 
bool containsPoint (double x, double y, double z, bool verbose=false) const
 Check if a point is inside the body. More...
 
double getPadding () const
 Retrieve the current padding. More...
 
const Eigen::Isometry3d & getPose () const
 Retrieve the pose of the body. More...
 
double getScale () const
 Retrieve the current scale. More...
 
shapes::ShapeType getType () const
 Get the type of shape this body represents. More...
 
void setDimensions (const shapes::Shape *shape)
 Set the dimensions of the body (from corresponding shape) More...
 
void setPadding (double padd)
 If constant padding should be added to the body, this method sets the padding. Default is 0.0. More...
 
void setPose (const Eigen::Isometry3d &pose)
 Set the pose of the body. Default is identity. More...
 
void setScale (double scale)
 If the dimension of the body should be scaled, this method sets the scale. Default is 1.0. More...
 
virtual ~Body ()
 

Protected Member Functions

virtual void updateInternalData ()
 This function is called every time a change to the body is made, so that intermediate values stored for efficiency reasons are kept up to date. More...
 
virtual void useDimensions (const shapes::Shape *shape)
 Depending on the shape, this function copies the relevant data to the body. More...
 

Protected Attributes

Eigen::Vector3d center_
 
double d1_
 
double d2_
 
double length2_
 
double length_
 
Eigen::Vector3d normalB1_
 
Eigen::Vector3d normalB2_
 
Eigen::Vector3d normalH_
 
double radius2_
 
double radius_
 
double radiusB_
 
double radiusBSqr_
 
double radiusU_
 
- Protected Attributes inherited from bodies::Body
double padding_
 The scale that was set for this body. More...
 
Eigen::Isometry3d pose_
 The location of the body (position and orientation) More...
 
double scale_
 The scale that was set for this body. More...
 
shapes::ShapeType type_
 The type of shape this body was constructed from. More...
 

Detailed Description

Definition of a cylinder.

Definition at line 283 of file bodies.h.

Constructor & Destructor Documentation

◆ Cylinder() [1/2]

bodies::Cylinder::Cylinder ( )
inline

Definition at line 286 of file bodies.h.

◆ Cylinder() [2/2]

bodies::Cylinder::Cylinder ( const shapes::Shape shape)
inline

Definition at line 291 of file bodies.h.

◆ ~Cylinder()

virtual bodies::Cylinder::~Cylinder ( )
inlinevirtual

Definition at line 297 of file bodies.h.

Member Function Documentation

◆ cloneAt()

std::shared_ptr< bodies::Body > bodies::Cylinder::cloneAt ( const Eigen::Isometry3d &  pose,
double  padding,
double  scaling 
) const
virtual

Get a clone of this body, but one that is located at the pose pose and has possibly different passing and scaling: padding and scaling. This function is useful to implement thread safety, when bodies need to be moved around.

Implements bodies::Body.

Definition at line 344 of file bodies.cpp.

◆ computeBoundingBox()

void bodies::Cylinder::computeBoundingBox ( AABB bbox) const
virtual

Compute the axis-aligned bounding box for the body, in its current pose. Scaling and padding are accounted for.

Implements bodies::Body.

Definition at line 375 of file bodies.cpp.

◆ computeBoundingCylinder()

void bodies::Cylinder::computeBoundingCylinder ( BoundingCylinder cylinder) const
virtual

Compute the bounding cylinder for the body, in its current pose. Scaling and padding are accounted for.

Implements bodies::Body.

Definition at line 368 of file bodies.cpp.

◆ computeBoundingSphere()

void bodies::Cylinder::computeBoundingSphere ( BoundingSphere sphere) const
virtual

Compute the bounding radius for the body, in its current pose. Scaling and padding are accounted for.

Implements bodies::Body.

Definition at line 362 of file bodies.cpp.

◆ computeVolume()

double bodies::Cylinder::computeVolume ( ) const
virtual

Compute the volume of the body. This method includes changes induced by scaling and padding.

Implements bodies::Body.

Definition at line 357 of file bodies.cpp.

◆ containsPoint()

bool bodies::Cylinder::containsPoint ( const Eigen::Vector3d &  p,
bool  verbose = false 
) const
virtual

Check if a point is inside the body. Surface points are included.

Implements bodies::Body.

Definition at line 275 of file bodies.cpp.

◆ getDimensions()

std::vector< double > bodies::Cylinder::getDimensions ( ) const
virtual

Get the radius & length of the cylinder.

Implements bodies::Body.

Definition at line 301 of file bodies.cpp.

◆ intersectsRay()

bool bodies::Cylinder::intersectsRay ( const Eigen::Vector3d &  origin,
const Eigen::Vector3d &  dir,
EigenSTL::vector_Vector3d intersections = NULL,
unsigned int  count = 0 
) const
virtual

Check if a ray intersects the body, and find the set of intersections, in order, along the ray. A maximum number of intersections can be specified as well. If that number is 0, all intersections are returned.

Implements bodies::Body.

Definition at line 392 of file bodies.cpp.

◆ samplePointInside()

bool bodies::Cylinder::samplePointInside ( random_numbers::RandomNumberGenerator rng,
unsigned int  max_attempts,
Eigen::Vector3d &  result 
)
virtual

Sample a point that is included in the body using a given random number generator.

Sometimes multiple attempts need to be generated. The function terminates with failure (returns false) after max_attempts attempts. If the call is successful (returns true) the point is written to result

Reimplemented from bodies::Body.

Definition at line 328 of file bodies.cpp.

◆ updateInternalData()

void bodies::Cylinder::updateInternalData ( )
protectedvirtual

This function is called every time a change to the body is made, so that intermediate values stored for efficiency reasons are kept up to date.

Implements bodies::Body.

Definition at line 309 of file bodies.cpp.

◆ useDimensions()

void bodies::Cylinder::useDimensions ( const shapes::Shape shape)
protectedvirtual

Depending on the shape, this function copies the relevant data to the body.

Implements bodies::Body.

Definition at line 295 of file bodies.cpp.

Member Data Documentation

◆ center_

Eigen::Vector3d bodies::Cylinder::center_
protected

Definition at line 325 of file bodies.h.

◆ d1_

double bodies::Cylinder::d1_
protected

Definition at line 335 of file bodies.h.

◆ d2_

double bodies::Cylinder::d2_
protected

Definition at line 336 of file bodies.h.

◆ length2_

double bodies::Cylinder::length2_
protected

Definition at line 330 of file bodies.h.

◆ length_

double bodies::Cylinder::length_
protected

Definition at line 321 of file bodies.h.

◆ normalB1_

Eigen::Vector3d bodies::Cylinder::normalB1_
protected

Definition at line 327 of file bodies.h.

◆ normalB2_

Eigen::Vector3d bodies::Cylinder::normalB2_
protected

Definition at line 328 of file bodies.h.

◆ normalH_

Eigen::Vector3d bodies::Cylinder::normalH_
protected

Definition at line 326 of file bodies.h.

◆ radius2_

double bodies::Cylinder::radius2_
protected

Definition at line 334 of file bodies.h.

◆ radius_

double bodies::Cylinder::radius_
protected

Definition at line 322 of file bodies.h.

◆ radiusB_

double bodies::Cylinder::radiusB_
protected

Definition at line 332 of file bodies.h.

◆ radiusBSqr_

double bodies::Cylinder::radiusBSqr_
protected

Definition at line 333 of file bodies.h.

◆ radiusU_

double bodies::Cylinder::radiusU_
protected

Definition at line 331 of file bodies.h.


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


geometric_shapes
Author(s): Ioan Sucan , Gil Jones
autogenerated on Wed Nov 20 2019 03:16:43