Special grid class that stores facet indices of the mesh object in its grids. More...
#include <Grid.h>
Public Member Functions | |
virtual void | Validate (void) |
Validates the grid structure and rebuilds it if needed. | |
virtual void | Validate (const MeshKernel &rclM) |
Validates the grid structure and rebuilds it if needed. | |
virtual bool | Verify () const |
Verifies the grid structure and returns false if inconsistencies are found. | |
Construction | |
MeshFacetGrid (const MeshKernel &rclM, float fGridLen) | |
Construction. | |
MeshFacetGrid (const MeshKernel &rclM, int iCtGridPerAxis) | |
Construction. | |
MeshFacetGrid (const MeshKernel &rclM, unsigned long ulX, unsigned long ulY, unsigned long ulZ) | |
Construction. | |
MeshFacetGrid (void) | |
Construction. | |
MeshFacetGrid (const MeshKernel &rclM) | |
Construction. | |
virtual | ~MeshFacetGrid (void) |
Destruction. | |
Search | |
void | SearchNearestFacetInGrid (unsigned long ulX, unsigned long ulY, unsigned long ulZ, const Base::Vector3f &rclPt, float &rfMinDist, unsigned long &rulFacetInd) const |
Searches for the nearest facet in a given grid element and returns the facet index and the actual distance. | |
void | SearchNearestFacetInHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ, unsigned long ulDistance, const Base::Vector3f &rclPt, unsigned long &rulFacetInd, float &rfMinDist) const |
Does basically the same as the method above unless that grid neighbours upto the order of ulDistance are introduced into the search. | |
unsigned long | SearchNearestFromPoint (const Base::Vector3f &rclPt, float fMaxSearchArea) const |
Searches for the nearest facet from a point with the maximum search area. | |
unsigned long | SearchNearestFromPoint (const Base::Vector3f &rclPt) const |
Searches for the nearest facet from a point. | |
Protected Member Functions | |
void | AddFacet (const MeshGeomFacet &rclFacet, unsigned long ulFacetIndex, float fEpsilon=0.0f) |
Adds a new facet element to the grid structure. | |
unsigned long | HasElements (void) const |
Returns the number of stored elements. | |
void | Pos (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const |
Returns the grid numbers to the given point rclPoint. | |
void | PosWithCheck (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const |
Returns the grid numbers to the given point rclPoint. | |
virtual void | RebuildGrid (void) |
Rebuilds the grid structure. |
Special grid class that stores facet indices of the mesh object in its grids.
Definition at line 181 of file Grid.h.
MeshFacetGrid::MeshFacetGrid | ( | const MeshKernel & | rclM | ) |
MeshCore::MeshFacetGrid::MeshFacetGrid | ( | void | ) | [inline] |
MeshFacetGrid::MeshFacetGrid | ( | const MeshKernel & | rclM, | |
unsigned long | ulX, | |||
unsigned long | ulY, | |||
unsigned long | ulZ | |||
) |
MeshFacetGrid::MeshFacetGrid | ( | const MeshKernel & | rclM, | |
int | iCtGridPerAxis | |||
) |
MeshFacetGrid::MeshFacetGrid | ( | const MeshKernel & | rclM, | |
float | fGridLen | |||
) |
Construction.
Definition at line 655 of file Grid.cpp.
References MeshCore::MeshGrid::_pclMesh, MeshCore::MeshKernel::GetBoundBox(), Base::BoundBox3< _Precision >::LengthX(), Base::BoundBox3< _Precision >::LengthY(), Base::BoundBox3< _Precision >::LengthZ(), and MeshCore::MeshGrid::Rebuild().
virtual MeshCore::MeshFacetGrid::~MeshFacetGrid | ( | void | ) | [inline, virtual] |
void MeshCore::MeshFacetGrid::AddFacet | ( | const MeshGeomFacet & | rclFacet, | |
unsigned long | ulFacetIndex, | |||
float | fEpsilon = 0.0f | |||
) | [inline, protected] |
Adds a new facet element to the grid structure.
rclFacet is the geometric facet and ulFacetIndex the corresponding index in the mesh kernel. The facet is added to each grid element that intersects the facet.
Definition at line 437 of file Grid.h.
References MeshCore::MeshGeomFacet::_aclPoints, MeshCore::MeshGrid::_aulGrid, MeshCore::MeshGrid::GetBoundBox(), insert(), MeshCore::MeshGeomFacet::IntersectBoundingBox(), Base::BoundBox3< _Precision >::MaxX, Base::BoundBox3< _Precision >::MaxY, Base::BoundBox3< _Precision >::MaxZ, Base::BoundBox3< _Precision >::MinX, Base::BoundBox3< _Precision >::MinY, Base::BoundBox3< _Precision >::MinZ, and Pos().
Referenced by RebuildGrid().
unsigned long MeshCore::MeshFacetGrid::HasElements | ( | void | ) | const [inline, protected, virtual] |
Returns the number of stored elements.
Implements MeshCore::MeshGrid.
void MeshCore::MeshFacetGrid::Pos | ( | const Base::Vector3f & | rclPoint, | |
unsigned long & | rulX, | |||
unsigned long & | rulY, | |||
unsigned long & | rulZ | |||
) | const [inline, protected] |
Returns the grid numbers to the given point rclPoint.
Definition at line 396 of file Grid.h.
References MeshCore::MeshGrid::_fGridLenX, MeshCore::MeshGrid::_fGridLenY, MeshCore::MeshGrid::_fGridLenZ, MeshCore::MeshGrid::_fMinX, MeshCore::MeshGrid::_fMinY, MeshCore::MeshGrid::_fMinZ, MeshCore::MeshGrid::_ulCtGridsX, MeshCore::MeshGrid::_ulCtGridsY, MeshCore::MeshGrid::_ulCtGridsZ, Py::long, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by AddFacet().
void MeshCore::MeshFacetGrid::PosWithCheck | ( | const Base::Vector3f & | rclPoint, | |
unsigned long & | rulX, | |||
unsigned long & | rulY, | |||
unsigned long & | rulZ | |||
) | const [inline, protected] |
Returns the grid numbers to the given point rclPoint.
Definition at line 405 of file Grid.h.
References MeshCore::MeshGrid::_fGridLenX, MeshCore::MeshGrid::_fGridLenY, MeshCore::MeshGrid::_fGridLenZ, MeshCore::MeshGrid::_fMinX, MeshCore::MeshGrid::_fMinY, MeshCore::MeshGrid::_fMinZ, MeshCore::MeshGrid::_ulCtGridsX, MeshCore::MeshGrid::_ulCtGridsY, MeshCore::MeshGrid::_ulCtGridsZ, Py::long, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
void MeshFacetGrid::RebuildGrid | ( | void | ) | [protected, virtual] |
Rebuilds the grid structure.
Implements MeshCore::MeshGrid.
Definition at line 705 of file Grid.cpp.
References MeshCore::MeshGrid::_pclMesh, MeshCore::MeshGrid::_ulCtElements, AddFacet(), MeshCore::MeshKernel::CountFacets(), MeshCore::MeshFacetIterator::Init(), MeshCore::MeshGrid::InitGrid(), MeshCore::MeshFacetIterator::More(), and MeshCore::MeshFacetIterator::Next().
Referenced by MeshFacetGrid(), and Validate().
void MeshFacetGrid::SearchNearestFacetInGrid | ( | unsigned long | ulX, | |
unsigned long | ulY, | |||
unsigned long | ulZ, | |||
const Base::Vector3f & | rclPt, | |||
float & | rfMinDist, | |||
unsigned long & | rulFacetInd | |||
) | const |
Searches for the nearest facet in a given grid element and returns the facet index and the actual distance.
Definition at line 917 of file Grid.cpp.
References MeshCore::MeshGrid::_aulGrid, MeshCore::MeshGrid::_pclMesh, MeshCore::MeshGeomFacet::DistanceToPoint(), and MeshCore::MeshKernel::GetFacet().
Referenced by SearchNearestFacetInHull(), and SearchNearestFromPoint().
void MeshFacetGrid::SearchNearestFacetInHull | ( | unsigned long | ulX, | |
unsigned long | ulY, | |||
unsigned long | ulZ, | |||
unsigned long | ulDistance, | |||
const Base::Vector3f & | rclPt, | |||
unsigned long & | rulFacetInd, | |||
float & | rfMinDist | |||
) | const |
Does basically the same as the method above unless that grid neighbours upto the order of ulDistance are introduced into the search.
Definition at line 866 of file Grid.cpp.
References MeshCore::MeshGrid::_ulCtGridsX, MeshCore::MeshGrid::_ulCtGridsY, MeshCore::MeshGrid::_ulCtGridsZ, Py::int, and SearchNearestFacetInGrid().
Referenced by SearchNearestFromPoint().
unsigned long MeshFacetGrid::SearchNearestFromPoint | ( | const Base::Vector3f & | rclPt, | |
float | fMaxSearchArea | |||
) | const |
Searches for the nearest facet from a point with the maximum search area.
Definition at line 839 of file Grid.cpp.
References MeshCore::MeshGrid::_pclMesh, MeshCore::MeshAlgorithm::Distance(), MeshCore::MeshGrid::Inside(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
unsigned long MeshFacetGrid::SearchNearestFromPoint | ( | const Base::Vector3f & | rclPt | ) | const |
Searches for the nearest facet from a point.
Definition at line 723 of file Grid.cpp.
References MeshCore::MeshGrid::_fGridLenX, MeshCore::MeshGrid::_fGridLenY, MeshCore::MeshGrid::_fGridLenZ, MeshCore::MeshGrid::_ulCtGridsX, MeshCore::MeshGrid::_ulCtGridsY, MeshCore::MeshGrid::_ulCtGridsZ, Base::BoundBox3< _Precision >::BACK, Base::BoundBox3< _Precision >::BOTTOM, Base::BoundBox3< _Precision >::CalcCenter(), FLOAT_MAX, Base::BoundBox3< _Precision >::FRONT, MeshCore::MeshGrid::GetBoundBox(), Base::BoundBox3< _Precision >::GetSideFromRay(), Base::BoundBox3< _Precision >::IsInBox(), Base::BoundBox3< _Precision >::LEFT, Py::long, Base::BoundBox3< _Precision >::MinX, Base::BoundBox3< _Precision >::MinY, Base::BoundBox3< _Precision >::MinZ, MeshCore::MeshGrid::Position(), Base::BoundBox3< _Precision >::RIGHT, SearchNearestFacetInGrid(), SearchNearestFacetInHull(), Base::BoundBox3< _Precision >::TOP, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by MeshCore::MeshAlgorithm::NearestPointFromPoint().
void MeshFacetGrid::Validate | ( | void | ) | [virtual] |
Validates the grid structure and rebuilds it if needed.
Definition at line 672 of file Grid.cpp.
References MeshCore::MeshGrid::_pclMesh, MeshCore::MeshGrid::_ulCtElements, MeshCore::MeshKernel::CountFacets(), and RebuildGrid().
void MeshFacetGrid::Validate | ( | const MeshKernel & | rclM | ) | [virtual] |
Validates the grid structure and rebuilds it if needed.
Implements MeshCore::MeshGrid.
Definition at line 664 of file Grid.cpp.
References MeshCore::MeshGrid::_pclMesh, MeshCore::MeshGrid::_ulCtElements, MeshCore::MeshGrid::Attach(), MeshCore::MeshKernel::CountFacets(), and RebuildGrid().
bool MeshFacetGrid::Verify | ( | ) | const [virtual] |
Verifies the grid structure and returns false if inconsistencies are found.
Implements MeshCore::MeshGrid.
Definition at line 681 of file Grid.cpp.
References MeshCore::MeshGrid::_pclMesh, MeshCore::MeshGrid::_ulCtElements, MeshCore::MeshKernel::CountFacets(), MeshCore::MeshGridIterator::GetBoundBox(), MeshCore::MeshGridIterator::GetElements(), MeshCore::MeshGridIterator::Init(), MeshCore::MeshGridIterator::More(), MeshCore::MeshGridIterator::Next(), and MeshCore::MeshFacetIterator::Set().