Parasol Planning Library (PPL)
Boundary Class Referenceabstract

#include <Boundary.h>

Inheritance diagram for Boundary:
Inheritance graph
[legend]

Public Types

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

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
 

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< CGALKernelCGALPolyhedron
 
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.

Examples
Samplers_UseCase.cpp.

Member Typedef Documentation

◆ CGALKernel

typedef CGAL::Exact_predicates_exact_constructions_kernel Boundary::CGALKernel

◆ CGALPolyhedron

typedef CGAL::Polyhedron_3<CGALKernel> Boundary::CGALPolyhedron

Member Enumeration Documentation

◆ Space

The types of space that can be modeled with boundaries.

Enumerator
Workspace 
CSpace 

Constructor & Destructor Documentation

◆ ~Boundary()

Boundary::~Boundary ( )
virtualdefaultnoexcept

Member Function Documentation

◆ CGAL()

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

Create a CGAL polyhedron representation of this.

Reimplemented in WorkspaceBoundingBox, and TetrahedralBoundary.

◆ 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 WorkspaceBoundingSphericalShell, WorkspaceBoundingSphere, WorkspaceBoundingBox, TetrahedralBoundary, CSpaceBoundingSphere, and CSpaceBoundingBox.

◆ 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.

◆ GetCenter()

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

Get the boundary's center point.

Implemented in TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ 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 TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ 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 TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ GetDimension()

virtual size_t Boundary::GetDimension ( ) const
pure virtualnoexcept

Get the dimension of this boundary.

Implemented in TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ 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 AbstractBoundingSphericalShell, AbstractBoundingSphere, TetrahedralBoundary, and AbstractBoundingBox.

◆ GetRandomPoint()

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

Get a random point inside the boundary.

Implemented in TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ 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 TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ GetVolume()

virtual double Boundary::GetVolume ( ) const
pure virtualnoexcept

Get the boundary's volume (Lebesgue Measure).

Implemented in TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ InBoundary() [1/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 WorkspaceBoundingSphericalShell, WorkspaceBoundingSphere, CSpaceBoundingSphere, WorkspaceBoundingBox, TetrahedralBoundary, and CSpaceBoundingBox.

◆ 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 TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ InBoundary() [3/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 TetrahedralBoundary.

◆ 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.

◆ 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.

◆ 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 WorkspaceBoundingSphericalShell, WorkspaceBoundingSphere, WorkspaceBoundingBox, and TetrahedralBoundary.

◆ Name()

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

◆ 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 TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ 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 TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ 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 TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ 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.

◆ 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 TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ Translate() [1/2]

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

Translate the boundary.

Parameters
_tThe offset to apply.

Implemented in TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ Translate() [2/2]

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

Translate the boundary.

Parameters
_vThe offset to apply.

Implemented in TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.

◆ Type()

virtual Space Boundary::Type ( ) const
pure virtualnoexcept

◆ 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.

◆ Write()

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

Write out a boundary.

Parameters
_osThe output stream to write to.

Implemented in TetrahedralBoundary, AbstractBoundingSphericalShell, AbstractBoundingSphere, and AbstractBoundingBox.


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