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 | Public Member Functions
WorkspaceSkeleton Class Reference

Geometric skeleton of the workspace. More...

Public Member Functions

vertex_iterator find_vertex (VD _vd)
 
Locators
vertex_iterator FindNearestVertex (const mathtool::Point3d &_target)
 
vertex_iterator FindVertex (const VD _vertexDescriptor)
 
adj_edge_iterator FindEdge (const ED &_edgeDescriptor)
 
std::vector< adj_edge_iterator > FindInboundEdges (const VD &_vertexDescriptor)
 
std::vector< adj_edge_iterator > FindInboundEdges (const vertex_iterator &_vi)
 
Modifiers
WorkspaceSkeleton Direct (const mathtool::Point3d &_start)
 
void Prune (const mathtool::Point3d &_goal)
 
void RefineEdges (double _maxLength)
 Divide existing edges into sizes of at most _maxLength.
 
void DoubleEdges ()
 
Accessors
void SetGraph (GraphType &_graph) noexcept
 
GraphTypeGetGraph () noexcept
 Get the skeleton graph.
 
const GraphTypeGetGraph () const noexcept
 
IO
void Write (const std::string &_file)
 
void Read (const std::string &_file)
 

Public Types

Local Types
typedef stapl::sequential::directed_preds_graph< stapl::MULTIEDGES, mathtool::Point3d, std::vector< mathtool::Point3d > > GraphType
 Graph type is a directed multiedge graph of points and paths.
 
typedef GraphType::vertex_descriptor VD
 
typedef GraphType::edge_descriptor ED
 
typedef GraphType::vertex_iterator vertex_iterator
 
typedef GraphType::vertex_descriptor vertex_descriptor
 
typedef GraphType::adj_edge_iterator adj_edge_iterator
 

Detailed Description

Geometric skeleton of the workspace.

Member Function Documentation

◆ FindNearestVertex()

WorkspaceSkeleton::vertex_iterator WorkspaceSkeleton::FindNearestVertex ( const mathtool::Point3d &  _target)

Helper function to find the skeleton vertex that is closest to a given workspace point.

Parameters
_targetThe workspace point.
Returns
An iterator to the nearest skeleton vertex.

◆ FindVertex()

WorkspaceSkeleton::vertex_iterator WorkspaceSkeleton::FindVertex ( const VD  _vertexDescriptor)

Find a vertex iterator in the skeleton by descriptor.

Parameters
_vertexDescriptorThe descriptor of the vertex to search for.
Returns
An iterator to the desired vertex.

◆ FindEdge()

WorkspaceSkeleton::adj_edge_iterator WorkspaceSkeleton::FindEdge ( const ED &  _edgeDescriptor)

Find an edge iterator in the skeleton by descriptor.

Parameters
_edgeDescriptorThe descriptor of the edge to search for.
Returns
An iterator to the desired edge.

◆ FindInboundEdges() [1/2]

std::vector< WorkspaceSkeleton::adj_edge_iterator > WorkspaceSkeleton::FindInboundEdges ( const VD &  _vertexDescriptor)

Find iterators to all edges inbound on a given vertex.

Parameters
_vertexDescriptorThe descriptor for the vertex of interest.
Returns
A set of iterators for each edge incident on _vertexDescriptor.

◆ FindInboundEdges() [2/2]

std::vector< WorkspaceSkeleton::adj_edge_iterator > WorkspaceSkeleton::FindInboundEdges ( const vertex_iterator &  _vi)

Find iterators to all edges inbound on a given vertex.

Parameters
_viAn iterator to the vertex of interest.
Returns
A set of iterators for each edge incident on _vi.

◆ Direct()

WorkspaceSkeleton WorkspaceSkeleton::Direct ( const mathtool::Point3d &  _start)

Direct the skeleton so that all edges point outwards from the vertex nearest to a given starting point.

Parameters
_startA workspace point from which the direction should eminate.
Returns
A directed skeleton with flow pointing outward from _start.

◆ Prune()

void WorkspaceSkeleton::Prune ( const mathtool::Point3d &  _goal)

Prune the skeleton by removing vertices and edges that are not reachable by back-tracking the edges from the vertex nearst to a goal point. Only makes sense after calling Direct.

Parameters
_goalA workspace goal point.

◆ DoubleEdges()

void WorkspaceSkeleton::DoubleEdges ( )

Double up the edges so that each one has a duplicate facing the opposite direction with reversed path and same edge ID. This does not make sense with Direct or Prune. If you want to use with RefineEdges you should call that first to ensure the edge counterparts match exactly.

Note
This function assumes that all edges currently in the skeleton are unique and not reverse duplicates.

◆ SetGraph()

void WorkspaceSkeleton::SetGraph ( GraphType _graph)
noexcept

Set the skeleton graph.

Parameters
_graphthe flow graph we want to set for this skeleton.

◆ Write()

void WorkspaceSkeleton::Write ( const std::string &  _file)

Writes the graph to a file.

Parameters
_filethe output file name.

◆ Read()

void WorkspaceSkeleton::Read ( const std::string &  _file)

Reads the graph from a file.

Parameters
_filethe output file name.

◆ find_vertex()

WorkspaceSkeleton::vertex_iterator WorkspaceSkeleton::find_vertex ( WorkspaceSkeleton::VD  _vd)

Find a vertex iterator in the skeleton by descriptor.

Parameters
_vdThe descriptor of the vertex to search for.
Returns
An iterator to the desired vertex.

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