![]() |
Parasol Planning Library (PPL)
|
#include <GridOverlay.h>
Public Types | |
Local Types | |
enum class | CellSet : unsigned char { Boundary = 1 , Interior = 2 , Closure = 3 } |
The types of cell sets for use with LocateCells. More... | |
typedef std::vector< std::vector< const WorkspaceRegion * > > | DecompositionMap |
A mapping from a grid cell index to a set of workspace regions. More... | |
typedef std::array< size_t, 3 > | IndexSet |
A set of X, Y, Z indexes for a grid cell. More... | |
Public Member Functions | |
Construction | |
GridOverlay (const Boundary *const _b, const double _length) | |
~GridOverlay () noexcept | |
Cell Finders | |
size_t | Size () const noexcept |
Get the number of cells in the grid. More... | |
size_t | Size (const size_t _i) const noexcept |
size_t | LocateCell (const Cfg &_cfg) const |
size_t | LocateCell (const Point3d &_p) const |
std::unordered_set< size_t > | LocateCells (const Boundary *const _b, const CellSet _type=CellSet::Closure) const |
std::unordered_set< size_t > | LocateCells (const GMSPolyhedron &_polyhedron, const mathtool::Transformation &_transformation={}, const CellSet _type=CellSet::Closure) const |
std::unordered_set< size_t > | LocateBBXCells (const Boundary *const _b) const |
std::unordered_set< size_t > | LocateBBXCells (const Point3d &_min, const Point3d &_max) const |
std::unordered_set< size_t > | LocateFacetNeighbors (const size_t _index) const |
std::unordered_set< size_t > | LocateEdgeNeighbors (const size_t _index) const |
std::unordered_set< size_t > | LocateVertexNeighbors (const size_t _index) const |
std::unordered_set< size_t > | LocateAllNeighbors (const size_t _index) const |
Cell Properties | |
double | CellLength () const noexcept |
Get the length of the grid cells. More... | |
Point3d | CellCenter (const size_t _index) const noexcept |
Decomposition Mapping | |
DecompositionMap | ComputeDecompositionMap (const WorkspaceDecomposition *const _decomposition, const bool _useCollisionDetection=false) const |
Testing | |
void | Test (const size_t _trials=0) const |
A 3d grid overlay of a given boundary.
The cells are implicitly represented as either a tuple (x,y,z) or a single 'cell index', which enumerates all cells with a single number. The grid is defined over the minimum and maximum ranges of the boundary, so there may be grid cells partially or completely outside of the boundary (depending its shape and size).
typedef std::vector<std::vector<const WorkspaceRegion*> > GridOverlay::DecompositionMap |
A mapping from a grid cell index to a set of workspace regions.
typedef std::array<size_t, 3> GridOverlay::IndexSet |
A set of X, Y, Z indexes for a grid cell.
|
strong |
GridOverlay::GridOverlay | ( | const Boundary *const | _b, |
const double | _length | ||
) |
Construct a grid overlay with cells of a given length.
_b | The boundary to overlay. |
_length | The cell length to use. |
|
defaultnoexcept |
|
noexcept |
Get the center of a cell.
_index | The cell index. |
|
noexcept |
Get the length of the grid cells.
GridOverlay::DecompositionMap GridOverlay::ComputeDecompositionMap | ( | const WorkspaceDecomposition *const | _decomposition, |
const bool | _useCollisionDetection = false |
||
) | const |
Create a map from grid cell index to the set of decomposition regions which are near to or touch the grid cell.
_decomposition | The workspace decomposition object to map. |
_useCollisionDetection | Use PQP collision detection to refine the test? |
std::unordered_set< size_t > GridOverlay::LocateAllNeighbors | ( | const size_t | _index | ) | const |
Locate all neighbors of a cell.
_index | The cell index. |
std::unordered_set< size_t > GridOverlay::LocateBBXCells | ( | const Boundary *const | _b | ) | const |
Find the cells that contain a given boundary's bounding box.
_b | The boundary of interest. |
std::unordered_set< size_t > GridOverlay::LocateBBXCells | ( | const Point3d & | _min, |
const Point3d & | _max | ||
) | const |
Find the cells that contain a bounding box around two points.
_min | The low-range values. |
_max | The high-range values. |
size_t GridOverlay::LocateCell | ( | const Cfg & | _cfg | ) | const |
Find the cell that contains the reference point of a configuration.
_cfg | The configuration to locate. |
size_t GridOverlay::LocateCell | ( | const Point3d & | _p | ) | const |
Find the cell that contains a reference point.
_p | The point to locate. |
std::unordered_set< size_t > GridOverlay::LocateCells | ( | const Boundary *const | _b, |
const CellSet | _type = CellSet::Closure |
||
) | const |
Find the cells that touch a given boundary.
_b | The boundary of interest. |
_type | The type of cell set to include. |
std::unordered_set< size_t > GridOverlay::LocateCells | ( | const GMSPolyhedron & | _polyhedron, |
const mathtool::Transformation & | _transformation = {} , |
||
const CellSet | _type = CellSet::Closure |
||
) | const |
Find the cells that touch a given polyhedron.
_polyhedron | The polyhedron of interest. |
_transformation | The transformation for _polyhedron. |
_type | The type of cell set to include. |
std::unordered_set< size_t > GridOverlay::LocateEdgeNeighbors | ( | const size_t | _index | ) | const |
Locate the neighbors of a cell which share an edge but not a facet.
_index | The cell index. |
std::unordered_set< size_t > GridOverlay::LocateFacetNeighbors | ( | const size_t | _index | ) | const |
Locate the neighbors of a cell which share a facet.
_index | The cell index. |
std::unordered_set< size_t > GridOverlay::LocateVertexNeighbors | ( | const size_t | _index | ) | const |
Locate the neighbors of a cell which share a vertex but not an edge or facet.
_index | The cell index. |
|
noexcept |
Get the number of cells in the grid.
|
noexcept |
Get the number of cells in a given dimension.
_i | The index for the dimension of interest. |
void GridOverlay::Test | ( | const size_t | _trials = 0 | ) | const |
Test this object.
_trials | Sample this number of grid cells to test. Or, use zero to test all cells. |
If | the test fails. |