The MeshGridIterator class provides an interface to walk through all grid elements of a mesh grid. More...
#include <Grid.h>
Classes | |
struct | GridElement |
Checks if a grid position is already visited by NextOnRay(). More... | |
Public Member Functions | |
Base::BoundBox3f | GetBoundBox (void) const |
Returns the bounding box of the current grid element. | |
unsigned long | GetCtElements () const |
Returns the number of elements in the current grid. | |
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. | |
MeshGridIterator (const MeshGrid &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::Vector3f &rclPt, const Base::Vector3f &rclDir, float fMaxSearchArea, std::vector< unsigned long > &raulElements) |
Searches for facets around the ray. | |
bool | InitOnRay (const Base::Vector3f &rclPt, const Base::Vector3f &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::Vector3f | _clDir |
Direction of search ray. | |
Base::Vector3f | _clPt |
Base point of search ray. | |
std::set< GridElement > | _cSearchPositions |
float | _fMaxSearchArea |
const MeshGrid & | _rclGrid |
The mesh kernel. | |
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 MeshGridIterator class provides an interface to walk through all grid elements of a mesh grid.
Definition at line 287 of file Grid.h.
MeshGridIterator::MeshGridIterator | ( | const MeshGrid & | rclG | ) |
Base::BoundBox3f MeshCore::MeshGridIterator::GetBoundBox | ( | void | ) | const [inline] |
Returns the bounding box of the current grid element.
Definition at line 293 of file Grid.h.
Referenced by MeshCore::MeshAlgorithm::CheckFacets(), MeshCore::MeshAlgorithm::CutWithPlane(), MeshCore::MeshAlgorithm::GetFacetsFromPlane(), MeshCore::MeshAlgorithm::GetFacetsFromToolMesh(), Mesh::MeshPy::nearestFacetOnRay(), MeshCore::MeshPointGrid::Verify(), and MeshCore::MeshFacetGrid::Verify().
unsigned long MeshCore::MeshGridIterator::GetCtElements | ( | ) | const [inline] |
void MeshCore::MeshGridIterator::GetElements | ( | std::vector< unsigned long > & | raulElements | ) | const [inline] |
Returns indices of the elements in the current grid.
Definition at line 296 of file Grid.h.
Referenced by MeshCore::MeshAlgorithm::CheckFacets(), MeshCore::MeshAlgorithm::CutWithPlane(), MeshCore::MeshEvalSelfIntersection::Evaluate(), MeshCore::MeshAlgorithm::GetFacetsFromPlane(), MeshCore::MeshAlgorithm::GetFacetsFromToolMesh(), MeshCore::MeshEvalSelfIntersection::GetIntersections(), MeshCore::MeshPointGrid::Verify(), and MeshCore::MeshFacetGrid::Verify().
void MeshCore::MeshGridIterator::GetGridPos | ( | unsigned long & | rulX, | |
unsigned long & | rulY, | |||
unsigned long & | rulZ | |||
) | const [inline] |
Returns the grid number of the current position.
Definition at line 332 of file Grid.h.
Referenced by Mesh::MeshPy::nearestFacetOnRay().
void MeshCore::MeshGridIterator::Init | ( | void | ) | [inline] |
Sets the iterator to the first element.
Definition at line 308 of file Grid.h.
Referenced by MeshCore::MeshAlgorithm::CheckFacets(), MeshCore::MeshAlgorithm::CutWithPlane(), MeshCore::MeshEvalSelfIntersection::Evaluate(), MeshCore::MeshAlgorithm::GetFacetsFromPlane(), MeshCore::MeshAlgorithm::GetFacetsFromToolMesh(), MeshCore::MeshEvalSelfIntersection::GetIntersections(), Mesh::MeshPy::nearestFacetOnRay(), MeshCore::MeshPointGrid::Verify(), and MeshCore::MeshFacetGrid::Verify().
bool MeshGridIterator::InitOnRay | ( | const Base::Vector3f & | rclPt, | |
const Base::Vector3f & | rclDir, | |||
float | fMaxSearchArea, | |||
std::vector< unsigned long > & | raulElements | |||
) |
Searches for facets around the ray.
Definition at line 1066 of file Grid.cpp.
References _fMaxSearchArea, and InitOnRay().
bool MeshGridIterator::InitOnRay | ( | const Base::Vector3f & | rclPt, | |
const Base::Vector3f & | rclDir, | |||
std::vector< unsigned long > & | raulElements | |||
) |
Searches for facets around the ray.
Definition at line 1074 of file Grid.cpp.
References MeshCore::MeshGrid::_aulGrid, _bValidRay, _clDir, _clPt, _cSearchPositions, _fMaxSearchArea, _rclGrid, _ulX, _ulY, _ulZ, FLOAT_MAX, MeshCore::MeshGrid::GetBoundBox(), Base::BoundBox3< _Precision >::IntersectWithLine(), Base::BoundBox3< _Precision >::IsInBox(), Base::Length, and MeshCore::MeshGrid::Position().
Referenced by InitOnRay(), and MeshCore::MeshAlgorithm::NearestFacetOnRay().
bool MeshCore::MeshGridIterator::More | ( | void | ) | const [inline] |
Checks if the iterator has not yet reached the end position.
Definition at line 311 of file Grid.h.
Referenced by MeshCore::MeshAlgorithm::CheckFacets(), MeshCore::MeshAlgorithm::CutWithPlane(), MeshCore::MeshEvalSelfIntersection::Evaluate(), MeshCore::MeshAlgorithm::GetFacetsFromPlane(), MeshCore::MeshAlgorithm::GetFacetsFromToolMesh(), MeshCore::MeshEvalSelfIntersection::GetIntersections(), Mesh::MeshPy::nearestFacetOnRay(), MeshCore::MeshPointGrid::Verify(), and MeshCore::MeshFacetGrid::Verify().
void MeshCore::MeshGridIterator::Next | ( | void | ) | [inline] |
Go to the next grid.
Definition at line 314 of file Grid.h.
Referenced by MeshCore::MeshAlgorithm::CheckFacets(), MeshCore::MeshAlgorithm::CutWithPlane(), MeshCore::MeshEvalSelfIntersection::Evaluate(), MeshCore::MeshAlgorithm::GetFacetsFromPlane(), MeshCore::MeshAlgorithm::GetFacetsFromToolMesh(), MeshCore::MeshEvalSelfIntersection::GetIntersections(), Mesh::MeshPy::nearestFacetOnRay(), MeshCore::MeshPointGrid::Verify(), and MeshCore::MeshFacetGrid::Verify().
bool MeshGridIterator::NextOnRay | ( | std::vector< unsigned long > & | raulElements | ) |
Searches for facets around the ray.
Definition at line 1113 of file Grid.cpp.
References MeshCore::MeshGrid::_aulGrid, _bValidRay, _clDir, _clPt, _cSearchPositions, _fMaxSearchArea, _rclGrid, _ulX, _ulY, _ulZ, Base::BoundBox3< _Precision >::BACK, Base::BoundBox3< _Precision >::BOTTOM, MeshCore::MeshGrid::CheckPos(), Base::BoundBox3< _Precision >::FRONT, MeshCore::MeshGrid::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.
Referenced by MeshCore::MeshAlgorithm::NearestFacetOnRay().
bool MeshCore::MeshGridIterator::_bValidRay [protected] |
Base::Vector3f MeshCore::MeshGridIterator::_clDir [protected] |
Direction of search ray.
Definition at line 341 of file Grid.h.
Referenced by InitOnRay(), and NextOnRay().
Base::Vector3f MeshCore::MeshGridIterator::_clPt [protected] |
Base point of search ray.
Definition at line 340 of file Grid.h.
Referenced by InitOnRay(), and NextOnRay().
std::set<GridElement> MeshCore::MeshGridIterator::_cSearchPositions [protected] |
Definition at line 359 of file Grid.h.
Referenced by InitOnRay(), and NextOnRay().
float MeshCore::MeshGridIterator::_fMaxSearchArea [protected] |
Definition at line 343 of file Grid.h.
Referenced by InitOnRay(), and NextOnRay().
const MeshGrid& MeshCore::MeshGridIterator::_rclGrid [protected] |
unsigned long MeshCore::MeshGridIterator::_ulX [protected] |
Number of grids in x.
Definition at line 337 of file Grid.h.
Referenced by InitOnRay(), and NextOnRay().
unsigned long MeshCore::MeshGridIterator::_ulY [protected] |
Number of grids in y.
Definition at line 338 of file Grid.h.
Referenced by InitOnRay(), and NextOnRay().
unsigned long MeshCore::MeshGridIterator::_ulZ [protected] |
Number of grids in z.
Definition at line 339 of file Grid.h.
Referenced by InitOnRay(), and NextOnRay().