Public Member Functions | Protected Member Functions | Protected Attributes
bodies::Box Class Reference

Definition of a box. More...

#include <bodies.h>

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

List of all members.

Public Member Functions

 Box ()
 Box (const shapes::Shape *shape)
virtual BodyPtr cloneAt (const Eigen::Affine3d &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.
virtual void computeBoundingCylinder (BoundingCylinder &cylinder) const
 Compute the bounding cylinder for the body, in its current pose. Scaling and padding are accounted for.
virtual void computeBoundingSphere (BoundingSphere &sphere) const
 Compute the bounding radius for the body, in its current pose. Scaling and padding are accounted for.
virtual double computeVolume () const
 Compute the volume of the body. This method includes changes induced by scaling and padding.
virtual bool containsPoint (const Eigen::Vector3d &p, bool verbose=false) const
 Check if a point is inside the body.
virtual std::vector< double > getDimensions () const
 Get the length & width & height (x, y, z) of the box.
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.
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. 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.
virtual ~Box ()

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.
virtual void useDimensions (const shapes::Shape *shape)
 Depending on the shape, this function copies the relevant data to the body.

Protected Attributes

Eigen::Vector3d center_
Eigen::Vector3d corner1_
Eigen::Vector3d corner2_
double height2_
double height_
double length2_
double length_
Eigen::Vector3d normalH_
Eigen::Vector3d normalL_
Eigen::Vector3d normalW_
double radius2_
double radiusB_
double width2_
double width_

Detailed Description

Definition of a box.

Definition at line 330 of file bodies.h.


Constructor & Destructor Documentation

bodies::Box::Box ( ) [inline]

Definition at line 333 of file bodies.h.

bodies::Box::Box ( const shapes::Shape shape) [inline]

Definition at line 338 of file bodies.h.

virtual bodies::Box::~Box ( ) [inline, virtual]

Definition at line 344 of file bodies.h.


Member Function Documentation

boost::shared_ptr< bodies::Body > bodies::Box::cloneAt ( const Eigen::Affine3d &  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 524 of file bodies.cpp.

void bodies::Box::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 548 of file bodies.cpp.

void bodies::Box::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 542 of file bodies.cpp.

double bodies::Box::computeVolume ( ) const [virtual]

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

Implements bodies::Body.

Definition at line 537 of file bodies.cpp.

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

Check if a point is inside the body.

Implements bodies::Body.

Definition at line 467 of file bodies.cpp.

std::vector< double > bodies::Box::getDimensions ( ) const [virtual]

Get the length & width & height (x, y, z) of the box.

Implements bodies::Body.

Definition at line 493 of file bodies.cpp.

bool bodies::Box::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 580 of file bodies.cpp.

bool bodies::Box::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 459 of file bodies.cpp.

void bodies::Box::updateInternalData ( ) [protected, virtual]

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 502 of file bodies.cpp.

void bodies::Box::useDimensions ( const shapes::Shape shape) [protected, virtual]

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

Implements bodies::Body.

Definition at line 485 of file bodies.cpp.


Member Data Documentation

Eigen::Vector3d bodies::Box::center_ [protected]

Definition at line 371 of file bodies.h.

Eigen::Vector3d bodies::Box::corner1_ [protected]

Definition at line 376 of file bodies.h.

Eigen::Vector3d bodies::Box::corner2_ [protected]

Definition at line 377 of file bodies.h.

double bodies::Box::height2_ [protected]

Definition at line 381 of file bodies.h.

double bodies::Box::height_ [protected]

Definition at line 368 of file bodies.h.

double bodies::Box::length2_ [protected]

Definition at line 379 of file bodies.h.

double bodies::Box::length_ [protected]

Definition at line 366 of file bodies.h.

Eigen::Vector3d bodies::Box::normalH_ [protected]

Definition at line 374 of file bodies.h.

Eigen::Vector3d bodies::Box::normalL_ [protected]

Definition at line 372 of file bodies.h.

Eigen::Vector3d bodies::Box::normalW_ [protected]

Definition at line 373 of file bodies.h.

double bodies::Box::radius2_ [protected]

Definition at line 383 of file bodies.h.

double bodies::Box::radiusB_ [protected]

Definition at line 382 of file bodies.h.

double bodies::Box::width2_ [protected]

Definition at line 380 of file bodies.h.

double bodies::Box::width_ [protected]

Definition at line 367 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 Thu Jun 6 2019 20:13:53