PPL API Reference
Overview Core Algorithm Abstractions Utilities Parallel Methods
Modules Class Hierarchy Classes Functions
Todo List Bug List Dead Code
List of all members
Boundary Class Referenceabstract

Public Member Functions

Property Accessors
virtual Space Type () const noexcept=0
 Get the space type. More...
 
virtual std::string Name () const noexcept=0
 Get the name of the boundary type. More...
 
virtual size_t GetDimension () const noexcept=0
 Get the dimension of this boundary. More...
 
virtual double GetMaxDist (const double _r1=2., const double _r2=.5) const =0
 
virtual const Range< double > & GetRange (const size_t _i) const =0
 
virtual const std::vector< double > & GetCenter () const noexcept=0
 Get the boundary's center point. More...
 
virtual double GetVolume () const noexcept=0
 Get the boundary's volume (Lebesgue Measure). More...
 
Sampling
virtual std::vector< double > GetRandomPoint () const =0
 Get a random point inside the boundary. More...
 
virtual void PushInside (std::vector< double > &_point) const noexcept=0
 
Scaling
virtual void ScalePoint (std::vector< double > &_point) const noexcept
 
virtual void UnscalePoint (std::vector< double > &_point) const noexcept
 
Containment Testing
virtual bool InBoundary (const Vector3d &_p) const
 
virtual bool InBoundary (const std::vector< double > &_v) const =0
 
virtual bool InBoundary (const Cfg &_c) const =0
 
Clearance Testing
virtual double GetClearance (const Vector3d &_p) const =0
 
virtual Vector3d GetClearancePoint (const Vector3d &_p) const =0
 
Modifiers
virtual void SetCenter (const std::vector< double > &_c) noexcept=0
 
virtual void Translate (const Vector3d &_v)=0
 
virtual void Translate (const std::vector< double > &_t)=0
 
virtual void ResetBoundary (const std::vector< std::pair< double, double > > &_bbx, const double _margin)=0
 
I/O
virtual void Read (std::istream &_is, CountingStreamBuffer &_cbs)=0
 
virtual void Write (std::ostream &_os) const =0
 

Public Types

Local Types
enum  Space { Workspace , CSpace }
 The types of space that can be modeled with boundaries.
 

Protected Member Functions

Containment Helpers
bool InWorkspace (const Cfg &_c) const
 
bool InCSpace (const Cfg &_c) const
 

Polyhedron Representations

typedef CGAL::Exact_predicates_exact_constructions_kernel CGALKernel
 
typedef CGAL::Polyhedron_3< CGALKernel > CGALPolyhedron
 
virtual CGALPolyhedron CGAL () const
 Create a CGAL polyhedron representation of this. More...
 
virtual GMSPolyhedron MakePolyhedron () const
 

Construction

virtual ~Boundary () noexcept
 
virtual std::unique_ptr< BoundaryClone () const =0
 
static std::unique_ptr< BoundaryFactory (XMLNode &_node)
 

Detailed Description

An abstract interface for a bounding volume in workspace or c-space.

Member Function Documentation

◆ Factory()

std::unique_ptr< Boundary > Boundary::Factory ( XMLNode _node)
static

Construct a boundary as described by an XML node.

Parameters
_nodeThe XML node.
Returns
A boundary of the appropriate type.

◆ Clone()

virtual std::unique_ptr< Boundary > Boundary::Clone ( ) const
pure virtual

Duplicate this boundary and return a dynamically-allocated copy with the same type. This is provided in the base class so that we can copy a boundary object without knowing its type.

Returns
A dynamically-allocated copy of this with the same type.

Implemented in CSpaceBoundingBox, CSpaceBoundingSphere, TetrahedralBoundary, WorkspaceBoundingBox, WorkspaceBoundingSphere, and WorkspaceBoundingSphericalShell.

◆ Type()

virtual Space Boundary::Type ( ) const
pure virtualnoexcept

◆ Name()

virtual std::string Boundary::Name ( ) const
pure virtualnoexcept

◆ GetDimension()

virtual size_t Boundary::GetDimension ( ) const
pure virtualnoexcept

Get the dimension of this boundary.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ GetMaxDist()

virtual double Boundary::GetMaxDist ( const double  _r1 = 2.,
const double  _r2 = .5 
) const
pure virtual

Get the longest distance contained within the boundary. Supports any Minkowski distance.

Parameters
_r1The term-wise power in the Minkowski difference.
_r2The whole expression power in the Minkowski difference.

Implemented in AbstractBoundingBox, TetrahedralBoundary, AbstractBoundingSphere, and AbstractBoundingSphericalShell.

◆ GetRange()

virtual const Range< double > & Boundary::GetRange ( const size_t  _i) const
pure virtual

Get the boundary range for a specific dimension.

Parameters
_iThe dimension index.
Returns
The range of values spanned by this boundary in dimension _i.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ GetCenter()

virtual const std::vector< double > & Boundary::GetCenter ( ) const
pure virtualnoexcept

Get the boundary's center point.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ GetVolume()

virtual double Boundary::GetVolume ( ) const
pure virtualnoexcept

Get the boundary's volume (Lebesgue Measure).

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ GetRandomPoint()

virtual std::vector< double > Boundary::GetRandomPoint ( ) const
pure virtual

Get a random point inside the boundary.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ PushInside()

virtual void Boundary::PushInside ( std::vector< double > &  _point) const
pure virtualnoexcept

Minimally push a point so that it lies within the boundary.

Parameters
_pointThe point to push.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ ScalePoint()

void Boundary::ScalePoint ( std::vector< double > &  _point) const
virtualnoexcept

Scale a point relative to the maximum range of the boundary. Up to GetDimension() elements will be scaled so that this boundary's maximum range maps to [-1, 1]. Additional elements in the point will not be scaled.

Parameters
_pointThe point to unscale.

◆ UnscalePoint()

void Boundary::UnscalePoint ( std::vector< double > &  _point) const
virtualnoexcept

Unscale a point relative to the maximum range of the boundary. Up to GetDimension() elements will be scaled so that [-1, 1] maps to this boundary's maximum range. Additional elements in the point will not be scaled.

Parameters
_pointThe point to unscale.

◆ InBoundary() [1/3]

bool Boundary::InBoundary ( const Vector3d &  _p) const
virtual

Test if a specific point lies within the boundary.

Parameters
_pThe point to test.
Returns
True if _p lies inside this boundary.

Reimplemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, CSpaceBoundingBox, CSpaceBoundingSphere, WorkspaceBoundingBox, WorkspaceBoundingSphere, WorkspaceBoundingSphericalShell, and TetrahedralBoundary.

◆ InBoundary() [2/3]

virtual bool Boundary::InBoundary ( const std::vector< double > &  _v) const
pure virtual

Test if a specific n-dimensional point lies within the boundary.

Parameters
_vThe point to test.
Returns
True if _v lies inside this boundary.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, TetrahedralBoundary, AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, CSpaceBoundingBox, CSpaceBoundingSphere, WorkspaceBoundingBox, WorkspaceBoundingSphere, and WorkspaceBoundingSphericalShell.

◆ InBoundary() [3/3]

virtual bool Boundary::InBoundary ( const Cfg _c) const
pure virtual

Test if a configuration lies within the boundary.

Parameters
_cfgThe configuration to test.
Returns
True if the configuration is considered to lie inside the boundary.

Implemented in CSpaceBoundingBox, TetrahedralBoundary, WorkspaceBoundingBox, AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, CSpaceBoundingBox, CSpaceBoundingSphere, WorkspaceBoundingBox, WorkspaceBoundingSphere, WorkspaceBoundingSphericalShell, CSpaceBoundingSphere, WorkspaceBoundingSphere, and WorkspaceBoundingSphericalShell.

◆ GetClearance()

double Boundary::GetClearance ( const Vector3d &  _p) const
pure virtual

Get the distance from a test point to the nearest point on the boundary.

Parameters
_pThe test point.
Returns
The distance from _p to the clearance point of _p.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ GetClearancePoint()

Vector3d Boundary::GetClearancePoint ( const Vector3d &  _p) const
pure virtual

Get the nearest point on the boundary to a test point.

Parameters
_pThe test point.
Returns
The point on this boundary nearest to _p.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ SetCenter()

virtual void Boundary::SetCenter ( const std::vector< double > &  _c)
pure virtualnoexcept

Move the boundary to a new center point.

Parameters
_cThe new center point for the boundary.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ Translate() [1/2]

virtual void Boundary::Translate ( const Vector3d &  _v)
pure virtual

Translate the boundary.

Parameters
_vThe offset to apply.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ Translate() [2/2]

virtual void Boundary::Translate ( const std::vector< double > &  _t)
pure virtual

Translate the boundary.

Parameters
_tThe offset to apply.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ ResetBoundary()

virtual void Boundary::ResetBoundary ( const std::vector< std::pair< double, double > > &  _bbx,
const double  _margin 
)
pure virtual

Resize the boundary to fit inside a bounding box plus some margin.

Parameters
_bbxThe new base bounding box.
_marginThe additional margin for _bbx. Negative margins cause shrinkage.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ Read()

virtual void Boundary::Read ( std::istream &  _is,
CountingStreamBuffer _cbs 
)
pure virtual

Read in a boundary.

Parameters
_isThe input stream to read from.
_cbsThe counting stream buffer for keeping track of where we are in the input stream.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ Write()

virtual void Boundary::Write ( std::ostream &  _os) const
pure virtual

Write out a boundary.

Parameters
_osThe output stream to write to.

Implemented in AbstractBoundingBox, AbstractBoundingSphere, AbstractBoundingSphericalShell, and TetrahedralBoundary.

◆ CGAL()

Boundary::CGALPolyhedron Boundary::CGAL ( ) const
virtual

Create a CGAL polyhedron representation of this.

Reimplemented in TetrahedralBoundary, and WorkspaceBoundingBox.

◆ MakePolyhedron()

GMSPolyhedron Boundary::MakePolyhedron ( ) const
virtual

Create a GMSPolyhedron representation of this. The polyhedron will be inside-out (normals facing inward) to properly represent the contact normals.

Reimplemented in TetrahedralBoundary, WorkspaceBoundingBox, WorkspaceBoundingSphere, and WorkspaceBoundingSphericalShell.

◆ InWorkspace()

bool Boundary::InWorkspace ( const Cfg _c) const
protected

Check that a configuration lies entirely within a workspace boundary.

Parameters
_cThe configuration of interest.
Returns
True if all of _c's geometry vertices lie within this boundary.

◆ InCSpace()

bool Boundary::InCSpace ( const Cfg _c) const
protected

Check that a configuration's DOF values lie entirely within a CSpace boundary.

Parameters
_cThe configuration of interest.
Returns
True if all of _c's DOF values lie within this boundary.

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