The PointsGridIterator class provides an interface to walk through all grid elements of a point grid. More...
#include <PointsGrid.h>
Classes | |
struct | GridElement |
Checks if a grid position is already visited by NextOnRay(). More... | |
Public Member Functions | |
Base::BoundBox3d | GetBoundBox (void) const |
Returns the bounding box of the current grid element. | |
void | GetElements (std::vector< unsigned long > &raulElements) const |
Returns indices of the elements in the current grid. | |
void | GetGridPos (unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const |
Returns the grid number of the current position. | |
PointsGridIterator (const PointsGrid &rclG) | |
Construction. | |
Iteration | |
void | Init (void) |
Sets the iterator to the first element. | |
bool | More (void) const |
Checks if the iterator has not yet reached the end position. | |
void | Next (void) |
Go to the next grid. | |
Tests with rays | |
bool | InitOnRay (const Base::Vector3d &rclPt, const Base::Vector3d &rclDir, float fMaxSearchArea, std::vector< unsigned long > &raulElements) |
Searches for facets around the ray. | |
bool | InitOnRay (const Base::Vector3d &rclPt, const Base::Vector3d &rclDir, std::vector< unsigned long > &raulElements) |
Searches for facets around the ray. | |
bool | NextOnRay (std::vector< unsigned long > &raulElements) |
Searches for facets around the ray. | |
Protected Attributes | |
bool | _bValidRay |
Search ray ok? | |
Base::Vector3d | _clDir |
Direction of search ray. | |
Base::Vector3d | _clPt |
Base point of search ray. | |
std::set< GridElement > | _cSearchPositions |
float | _fMaxSearchArea |
const PointsGrid & | _rclGrid |
The point grid. | |
unsigned long | _ulX |
Number of grids in x. | |
unsigned long | _ulY |
Number of grids in y. | |
unsigned long | _ulZ |
Number of grids in z. |
The PointsGridIterator class provides an interface to walk through all grid elements of a point grid.
Definition at line 174 of file PointsGrid.h.
PointsGridIterator::PointsGridIterator | ( | const PointsGrid & | rclG | ) |
Construction.
Definition at line 710 of file PointsGrid.cpp.
Base::BoundBox3d Points::PointsGridIterator::GetBoundBox | ( | void | ) | const [inline] |
Returns the bounding box of the current grid element.
Definition at line 180 of file PointsGrid.h.
Referenced by Points::PointsGrid::Verify().
void Points::PointsGridIterator::GetElements | ( | std::vector< unsigned long > & | raulElements | ) | const [inline] |
Returns indices of the elements in the current grid.
Definition at line 183 of file PointsGrid.h.
Referenced by Points::PointsGrid::Verify().
void Points::PointsGridIterator::GetGridPos | ( | unsigned long & | rulX, | |
unsigned long & | rulY, | |||
unsigned long & | rulZ | |||
) | const [inline] |
Returns the grid number of the current position.
Definition at line 214 of file PointsGrid.h.
void Points::PointsGridIterator::Init | ( | void | ) | [inline] |
Sets the iterator to the first element.
Definition at line 190 of file PointsGrid.h.
Referenced by Points::PointsGrid::Verify().
bool PointsGridIterator::InitOnRay | ( | const Base::Vector3d & | rclPt, | |
const Base::Vector3d & | rclDir, | |||
float | fMaxSearchArea, | |||
std::vector< unsigned long > & | raulElements | |||
) |
Searches for facets around the ray.
Definition at line 720 of file PointsGrid.cpp.
References _fMaxSearchArea, and InitOnRay().
bool PointsGridIterator::InitOnRay | ( | const Base::Vector3d & | rclPt, | |
const Base::Vector3d & | rclDir, | |||
std::vector< unsigned long > & | raulElements | |||
) |
Searches for facets around the ray.
Definition at line 728 of file PointsGrid.cpp.
References Points::PointsGrid::_aulGrid, _bValidRay, _clDir, _clPt, _cSearchPositions, _fMaxSearchArea, _rclGrid, _ulX, _ulY, _ulZ, FLOAT_MAX, Points::PointsGrid::GetBoundBox(), Base::BoundBox3< _Precision >::IntersectWithLine(), Base::BoundBox3< _Precision >::IsInBox(), Base::Length, and Points::PointsGrid::Position().
Referenced by InitOnRay().
bool Points::PointsGridIterator::More | ( | void | ) | const [inline] |
Checks if the iterator has not yet reached the end position.
Definition at line 193 of file PointsGrid.h.
Referenced by Points::PointsGrid::Verify().
void Points::PointsGridIterator::Next | ( | void | ) | [inline] |
Go to the next grid.
Definition at line 196 of file PointsGrid.h.
Referenced by Points::PointsGrid::Verify().
bool PointsGridIterator::NextOnRay | ( | std::vector< unsigned long > & | raulElements | ) |
Searches for facets around the ray.
Definition at line 767 of file PointsGrid.cpp.
References Points::PointsGrid::_aulGrid, _bValidRay, _clDir, _clPt, _cSearchPositions, _fMaxSearchArea, _rclGrid, _ulX, _ulY, _ulZ, Base::BoundBox3< _Precision >::BACK, Base::BoundBox3< _Precision >::BOTTOM, Points::PointsGrid::CheckPos(), Base::BoundBox3< _Precision >::FRONT, Points::PointsGrid::GetBoundBox(), Base::BoundBox3< _Precision >::GetSideFromRay(), Base::BoundBox3< _Precision >::INVALID, Base::BoundBox3< _Precision >::LEFT, Base::Length, RobotExample::pos, Base::BoundBox3< _Precision >::RIGHT, and Base::BoundBox3< _Precision >::TOP.
bool Points::PointsGridIterator::_bValidRay [protected] |
Search ray ok?
Definition at line 224 of file PointsGrid.h.
Referenced by InitOnRay(), and NextOnRay().
Base::Vector3d Points::PointsGridIterator::_clDir [protected] |
Direction of search ray.
Definition at line 223 of file PointsGrid.h.
Referenced by InitOnRay(), and NextOnRay().
Base::Vector3d Points::PointsGridIterator::_clPt [protected] |
Base point of search ray.
Definition at line 222 of file PointsGrid.h.
Referenced by InitOnRay(), and NextOnRay().
std::set<GridElement> Points::PointsGridIterator::_cSearchPositions [protected] |
Definition at line 241 of file PointsGrid.h.
Referenced by InitOnRay(), and NextOnRay().
float Points::PointsGridIterator::_fMaxSearchArea [protected] |
Definition at line 225 of file PointsGrid.h.
Referenced by InitOnRay(), and NextOnRay().
const PointsGrid& Points::PointsGridIterator::_rclGrid [protected] |
The point grid.
Definition at line 218 of file PointsGrid.h.
Referenced by InitOnRay(), and NextOnRay().
unsigned long Points::PointsGridIterator::_ulX [protected] |
Number of grids in x.
Definition at line 219 of file PointsGrid.h.
Referenced by InitOnRay(), and NextOnRay().
unsigned long Points::PointsGridIterator::_ulY [protected] |
Number of grids in y.
Definition at line 220 of file PointsGrid.h.
Referenced by InitOnRay(), and NextOnRay().
unsigned long Points::PointsGridIterator::_ulZ [protected] |
Number of grids in z.
Definition at line 221 of file PointsGrid.h.
Referenced by InitOnRay(), and NextOnRay().