Special grid class that stores facet indices of the mesh object in its grids. More...
#include <Grid.h>
Public Member Functions | |
Construction | |
MeshFacetGrid (const MeshKernel &rclM) | |
Construction. More... | |
MeshFacetGrid (void) | |
Construction. More... | |
MeshFacetGrid (const MeshKernel &rclM, unsigned long ulX, unsigned long ulY, unsigned long ulZ) | |
Construction. More... | |
MeshFacetGrid (const MeshKernel &rclM, int iCtGridPerAxis) | |
Construction. More... | |
MeshFacetGrid (const MeshKernel &rclM, float fGridLen) | |
Construction. More... | |
virtual ~MeshFacetGrid (void) | |
Destruction. More... | |
![]() | |
virtual unsigned long Inside (const Base::BoundBox3f &rclBB, std::vector< unsigned long > &raulElements, bool bDelDoubles=true) const | |
Searches for elements lying in the intersection area of the grid and the bounding box. More... | |
virtual unsigned long Inside (const Base::BoundBox3f &rclBB, std::set< unsigned long > &raulElementss) const | |
Searches for elements lying in the intersection area of the grid and the bounding box. More... | |
virtual unsigned long Inside (const Base::BoundBox3f &rclBB, std::vector< unsigned long > &raulElements, const Base::Vector3f &rclOrg, float fMaxDist, bool bDelDoubles=true) const | |
Searches for elements lying in the intersection area of the grid and the bounding box. More... | |
void SearchNearestFromPoint (const Base::Vector3f &rclPt, std::set< unsigned long > &rclInd) const | |
Searches for the nearest grids that contain elements from a point, the result are grid indices. More... | |
unsigned long GetElements (unsigned long ulX, unsigned long ulY, unsigned long ulZ, std::set< unsigned long > &raclInd) const | |
Returns the indices of the elements in the given grid. More... | |
unsigned long GetElements (const Base::Vector3f &rclPoint, std::vector< unsigned long > &aulFacets) const | |
virtual void GetGridLengths (float &rfLenX, float &rfLenY, float &rfLenZ) const | |
Returns the lengths of the grid elements in x,y and z direction. More... | |
virtual void GetCtGrids (unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const | |
Returns the number of grid elements in x,y and z direction. More... | |
Base::BoundBox3f GetBoundBox (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const | |
Returns the bounding box of a given grid element. More... | |
Base::BoundBox3f GetBoundBox (void) const | |
Returns the bounding box of the whole. More... | |
Base::BoundBox3f GetMeshBoundBox (void) const | |
Returns an extended bounding box of the mesh object. More... | |
unsigned long GetIndexToPosition (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const | |
Returns an index for the given grid position. More... | |
bool GetPositionToIndex (unsigned long id, unsigned long &ulX, unsigned long &ulY, unsigned long &ulZ) const | |
Returns the grid position to the given index. More... | |
unsigned long GetCtElements (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const | |
Returns the number of elements in a given grid. More... | |
bool CheckPosition (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const | |
Checks whether the point is inside the grid. More... | |
virtual void Position (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const | |
Returns the indices of the grid this point lies in. More... | |
bool CheckPos (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const | |
Checks if this is a valid grid position. More... | |
void GetHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ, unsigned long ulDistance, std::set< unsigned long > &raclInd) const | |
Get the indices of all elements lying in the grids around a given grid with distance ulDistance. More... | |
virtual ~MeshGrid (void) | |
Destruction. More... | |
virtual void Attach (const MeshKernel &rclM) | |
Attaches the mesh kernel to this grid, an already attached mesh gets detached. More... | |
virtual void Rebuild (unsigned long ulPerGrid=MESH_CT_GRID, unsigned long ulMaxGrid=MESH_MAX_GRIDS) | |
Rebuilds the grid structure. More... | |
virtual void Rebuild (int iCtGridPerAxis=MESH_CT_GRID_PER_AXIS) | |
Rebuilds the grid structure. More... | |
virtual void Rebuild (unsigned long ulX, unsigned long ulY, unsigned long ulZ) | |
Rebuilds the grid structure. More... | |
Search | |
unsigned long SearchNearestFromPoint (const Base::Vector3f &rclPt) const | |
Searches for the nearest facet from a point. More... | |
unsigned long SearchNearestFromPoint (const Base::Vector3f &rclPt, float fMaxSearchArea) const | |
Searches for the nearest facet from a point with the maximum search area. More... | |
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. More... | |
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 up to the order of ulDistance are introduced into the search. More... | |
virtual void Validate (const MeshKernel &rclM) | |
Validates the grid structure and rebuilds it if needed. More... | |
virtual void Validate (void) | |
Validates the grid structure and rebuilds it if needed. More... | |
virtual bool Verify () const | |
Verifies the grid structure and returns false if inconsistencies are found. More... | |
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. More... | |
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. More... | |
void AddFacet (const MeshGeomFacet &rclFacet, unsigned long ulFacetIndex, float fEpsilon=0.0f) | |
Adds a new facet element to the grid structure. More... | |
unsigned long HasElements (void) const | |
Returns the number of stored elements. More... | |
virtual void RebuildGrid (void) | |
Rebuilds the grid structure. More... | |
Additional Inherited Members | |
![]() | |
virtual void InitGrid (void) | |
Initializes the size of the internal structure. More... | |
virtual void Clear (void) | |
Deletes the grid structure. More... | |
virtual void CalculateGridLength (unsigned long ulCtGrid, unsigned long ulMaxGrids) | |
Calculates the grid length dependent on maximum number of grids. More... | |
virtual void CalculateGridLength (int iCtGridPerAxis) | |
Calculates the grid length dependent on the number of grids per axis. More... | |
MeshGrid (const MeshKernel &rclM) | |
Construction. More... | |
MeshGrid (void) | |
Construction. More... | |
Detailed Description
Special grid class that stores facet indices of the mesh object in its grids.
Constructor & Destructor Documentation
◆ MeshFacetGrid() [1/5]
MeshFacetGrid::MeshFacetGrid | ( | const MeshKernel & | rclM | ) |
Construction.
References RebuildGrid().
◆ MeshFacetGrid() [2/5]
MeshCore::MeshFacetGrid::MeshFacetGrid | ( | void | ) |
Construction.
◆ MeshFacetGrid() [3/5]
MeshFacetGrid::MeshFacetGrid | ( | const MeshKernel & | rclM, |
unsigned long | ulX, | ||
unsigned long | ulY, | ||
unsigned long | ulZ | ||
) |
Construction.
References MeshCore::MeshGrid::Rebuild().
◆ MeshFacetGrid() [4/5]
MeshFacetGrid::MeshFacetGrid | ( | const MeshKernel & | rclM, |
int | iCtGridPerAxis | ||
) |
Construction.
References MeshCore::MeshGrid::Rebuild().
◆ MeshFacetGrid() [5/5]
MeshFacetGrid::MeshFacetGrid | ( | const MeshKernel & | rclM, |
float | fGridLen | ||
) |
◆ ~MeshFacetGrid()
|
virtual |
Destruction.
Member Function Documentation
◆ AddFacet()
|
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.
References Base::BoundBox3< _Precision >::Add(), MeshCore::MeshGrid::GetBoundBox(), 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().
◆ HasElements()
|
protectedvirtual |
Returns the number of stored elements.
Implements MeshCore::MeshGrid.
◆ Pos()
|
protected |
Returns the grid numbers to the given point rclPoint.
References Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by AddFacet().
◆ PosWithCheck()
|
protected |
Returns the grid numbers to the given point rclPoint.
References Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
◆ RebuildGrid()
|
protectedvirtual |
Rebuilds the grid structure.
Implements MeshCore::MeshGrid.
References AddFacet(), MeshCore::MeshFacetIterator::Init(), MeshCore::MeshGrid::InitGrid(), MeshCore::MeshFacetIterator::More(), and MeshCore::MeshFacetIterator::Next().
Referenced by MeshFacetGrid(), and Validate().
◆ SearchNearestFacetInGrid()
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.
Referenced by SearchNearestFacetInHull(), and SearchNearestFromPoint().
◆ SearchNearestFacetInHull()
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 up to the order of ulDistance are introduced into the search.
References SearchNearestFacetInGrid().
Referenced by SearchNearestFromPoint().
◆ SearchNearestFromPoint() [1/2]
unsigned long MeshFacetGrid::SearchNearestFromPoint | ( | const Base::Vector3f & | rclPt | ) | const |
Searches for the nearest facet from a point.
References Base::BoundBox3< _Precision >::BACK, Base::BoundBox3< _Precision >::BOTTOM, Base::BoundBox3< _Precision >::FRONT, MeshCore::MeshGrid::GetBoundBox(), Base::BoundBox3< _Precision >::GetCenter(), Base::BoundBox3< _Precision >::GetSideFromRay(), Base::BoundBox3< _Precision >::IsInBox(), Base::BoundBox3< _Precision >::LEFT, 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().
◆ SearchNearestFromPoint() [2/2]
unsigned long MeshFacetGrid::SearchNearestFromPoint | ( | const Base::Vector3f & | rclPt, |
float | fMaxSearchArea | ||
) | const |
Searches for the nearest facet from a point with the maximum search area.
References MeshCore::MeshAlgorithm::Distance(), MeshCore::MeshGrid::Inside(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
◆ Validate() [1/2]
|
virtual |
Validates the grid structure and rebuilds it if needed.
Implements MeshCore::MeshGrid.
References MeshCore::MeshGrid::Attach(), MeshCore::MeshKernel::CountFacets(), and RebuildGrid().
◆ Validate() [2/2]
|
virtual |
Validates the grid structure and rebuilds it if needed.
References RebuildGrid().
◆ Verify()
|
virtual |
Verifies the grid structure and returns false if inconsistencies are found.
Implements MeshCore::MeshGrid.
References MeshCore::MeshGridIterator::GetBoundBox(), MeshCore::MeshGridIterator::GetElements(), MeshCore::MeshGridIterator::Init(), MeshCore::MeshGeomFacet::IntersectBoundingBox(), MeshCore::MeshGridIterator::More(), MeshCore::MeshGridIterator::Next(), and MeshCore::MeshFacetIterator::Set().
The documentation for this class was generated from the following files:
- src/Mod/Mesh/App/Core/Grid.h
- src/Mod/Mesh/App/Core/Grid.cpp