Parasol Planning Library (PPL)
WorkspaceDecomposition Class Reference

#include <WorkspaceDecomposition.h>

Inheritance diagram for WorkspaceDecomposition:
Inheritance graph
[legend]
Collaboration diagram for WorkspaceDecomposition:
Collaboration graph
[legend]

Public Types

Local Types
typedef stapl::sequential::graph< stapl::DIRECTED, stapl::NONMULTIEDGES, WorkspaceRegion, WorkspacePortalRegionGraph
 
typedef RegionGraph::vertex_iterator iterator
 
typedef RegionGraph::const_vertex_iterator const_iterator
 
typedef RegionGraph::edge_iterator edge_iterator
 
typedef RegionGraph::const_edge_iterator const_edge_iterator
 
typedef RegionGraph::adj_edge_iterator adj_edge_iterator
 
typedef RegionGraph::const_adj_edge_iterator const_adj_edge_iterator
 
typedef RegionGraph::vertex_descriptor vertex_descriptor
 
typedef RegionGraph::edge_descriptor edge_descriptor
 
typedef stapl::sequential::graph< stapl::DIRECTED, stapl::NONMULTIEDGES, Vector3d, double > DualGraph
 

Public Member Functions

Construction
 WorkspaceDecomposition ()
 
 WorkspaceDecomposition (const WorkspaceDecomposition &)
 
 WorkspaceDecomposition (WorkspaceDecomposition &&)
 
virtual ~WorkspaceDecomposition ()
 
Assignment
WorkspaceDecompositionoperator= (const WorkspaceDecomposition &)
 
WorkspaceDecompositionoperator= (WorkspaceDecomposition &&)
 
Point Accessors
const size_t GetNumPoints () const noexcept
 
const Point3d & GetPoint (const size_t _i) const noexcept
 
const std::vector< Point3d > & GetPoints () const noexcept
 
Region Accessors
const size_t GetNumRegions () const noexcept
 
const WorkspaceRegionGetRegion (const size_t _i) const noexcept
 
const vertex_descriptor GetDescriptor (const WorkspaceRegion &_region) const noexcept
 
Portal Accessors
const WorkspacePortalGetPortal (const size_t _i1, const size_t _i2) const noexcept
 
Dual Graph Accessors
DualGraphGetDualGraph () noexcept
 
const DualGraphGetDualGraph () const noexcept
 
Modifiers
void AddPoint (const Point3d &_p)
 
void AddTetrahedralRegion (const int _pts[4])
 
void AddPortal (const size_t _r1, const size_t _r2)
 
void Finalize ()
 
I/O
void Print (std::ostream &_os) const
 Write the decomposition graph to an output stream. More...
 
void WriteObj (const std::string &_filename) const
 
Path Finding
std::vector< size_t > FindPath (const size_t _source, const size_t _target) const
 
std::vector< size_t > FindPath (const WorkspaceRegion *const _source, const WorkspaceRegion *const _target) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
std::vector< size_t > FindNeighborhood (const std::vector< size_t > &_roots, const double _threshold) const
 

Detailed Description

A region-decomposition representation of the workspace.

The decomposition regions are represented by WorkspaceRegion, while connections between them are described by WorkspacePortal. Once the decomposition has been constructed, it cannot be changed.

Currently it is only possible to add tetrahedral regions.

Member Typedef Documentation

◆ adj_edge_iterator

typedef RegionGraph::adj_edge_iterator WorkspaceDecomposition::adj_edge_iterator

◆ const_adj_edge_iterator

typedef RegionGraph::const_adj_edge_iterator WorkspaceDecomposition::const_adj_edge_iterator

◆ const_edge_iterator

typedef RegionGraph::const_edge_iterator WorkspaceDecomposition::const_edge_iterator

◆ const_iterator

typedef RegionGraph::const_vertex_iterator WorkspaceDecomposition::const_iterator

◆ DualGraph

typedef stapl::sequential::graph<stapl::DIRECTED, stapl::NONMULTIEDGES, Vector3d, double> WorkspaceDecomposition::DualGraph

Terminology blunder: this isn't really a dual graph. It is a 1-reduction of the region graph instead. Each region is represented as a point, and each portal is represented as a euclidean straight-line distance between vertices.

◆ edge_descriptor

typedef RegionGraph::edge_descriptor WorkspaceDecomposition::edge_descriptor

◆ edge_iterator

typedef RegionGraph::edge_iterator WorkspaceDecomposition::edge_iterator

◆ iterator

typedef RegionGraph::vertex_iterator WorkspaceDecomposition::iterator

◆ RegionGraph

typedef stapl::sequential::graph<stapl::DIRECTED, stapl::NONMULTIEDGES, WorkspaceRegion, WorkspacePortal> WorkspaceDecomposition::RegionGraph

◆ vertex_descriptor

typedef RegionGraph::vertex_descriptor WorkspaceDecomposition::vertex_descriptor

Constructor & Destructor Documentation

◆ WorkspaceDecomposition() [1/3]

WorkspaceDecomposition::WorkspaceDecomposition ( )
default

◆ WorkspaceDecomposition() [2/3]

WorkspaceDecomposition::WorkspaceDecomposition ( const WorkspaceDecomposition _other)

◆ WorkspaceDecomposition() [3/3]

WorkspaceDecomposition::WorkspaceDecomposition ( WorkspaceDecomposition &&  _other)

◆ ~WorkspaceDecomposition()

WorkspaceDecomposition::~WorkspaceDecomposition ( )
virtualdefault

Member Function Documentation

◆ AddPoint()

void WorkspaceDecomposition::AddPoint ( const Point3d &  _p)

Add a point to the decomposition. This will be either a point on a workspace obstacle or a point in the freespace generated by the decomposition algorithm.

Parameters
_pThe point to add.

◆ AddPortal()

void WorkspaceDecomposition::AddPortal ( const size_t  _r1,
const size_t  _r2 
)

Add a portal between two regions.

Parameters
_r1The first region.
_r2The second region.

◆ AddTetrahedralRegion()

void WorkspaceDecomposition::AddTetrahedralRegion ( const int  _pts[4])

Add a tetrahedral region to the decomposition.

Parameters
_ptsA set of four point indexes, representing the vertices of the tetrahedron.
Todo:
The boundary currently double-stores the points. We would like to have a non-mutable boundary that holds only references to the points.

◆ Finalize()

void WorkspaceDecomposition::Finalize ( )

Finalize this, thereby triggering exceptions upon further attempts to modify the decomposition. This ensures that the dual graph is accurate, and that no functions added later on try to modify the points (which are indexed by the WorkspaceRegions).

◆ FindNeighborhood()

std::vector< size_t > WorkspaceDecomposition::FindNeighborhood ( const std::vector< size_t > &  _roots,
const double  _threshold 
) const

Find a neighborhood surrounding a set of regions.

Parameters
_rootsThe region descriptors to search from.
_thresholdThe max distance from source, through midpoints, for other regions in the neighborhood.
Returns
The descriptors within this neighborhood.
Todo:
Remove the const-cast after STAPL fixes its API.

◆ FindPath() [1/2]

std::vector< size_t > WorkspaceDecomposition::FindPath ( const size_t  _source,
const size_t  _target 
) const

Find a path between two regions.

Parameters
_sourceThe source region.
_targetThe target region.
Todo:
Remove the const-cast after STAPL fixes its API.

◆ FindPath() [2/2]

std::vector< size_t > WorkspaceDecomposition::FindPath ( const WorkspaceRegion *const  _source,
const WorkspaceRegion *const  _target 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetDescriptor()

const WorkspaceDecomposition::vertex_descriptor WorkspaceDecomposition::GetDescriptor ( const WorkspaceRegion _region) const
noexcept

◆ GetDualGraph() [1/2]

const WorkspaceDecomposition::DualGraph & WorkspaceDecomposition::GetDualGraph ( ) const
noexcept

◆ GetDualGraph() [2/2]

WorkspaceDecomposition::DualGraph & WorkspaceDecomposition::GetDualGraph ( )
noexcept

◆ GetNumPoints()

const size_t WorkspaceDecomposition::GetNumPoints ( ) const
noexcept

◆ GetNumRegions()

const size_t WorkspaceDecomposition::GetNumRegions ( ) const
noexcept

◆ GetPoint()

const Point3d & WorkspaceDecomposition::GetPoint ( const size_t  _i) const
noexcept

◆ GetPoints()

const std::vector< Point3d > & WorkspaceDecomposition::GetPoints ( ) const
noexcept

◆ GetPortal()

const WorkspacePortal & WorkspaceDecomposition::GetPortal ( const size_t  _i1,
const size_t  _i2 
) const
noexcept

◆ GetRegion()

const WorkspaceRegion & WorkspaceDecomposition::GetRegion ( const size_t  _i) const
noexcept

◆ operator=() [1/2]

WorkspaceDecomposition & WorkspaceDecomposition::operator= ( const WorkspaceDecomposition _other)

◆ operator=() [2/2]

WorkspaceDecomposition & WorkspaceDecomposition::operator= ( WorkspaceDecomposition &&  _other)

◆ Print()

void WorkspaceDecomposition::Print ( std::ostream &  _os) const

Write the decomposition graph to an output stream.

◆ WriteObj()

void WorkspaceDecomposition::WriteObj ( const std::string &  _filename) const

Write an OBJ file of the decomposition regions to an output stream. The OBJ will include all internal facets. This is primarily for validating that a decomposition gave the expected result.


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