MeshCore::MeshPointGrid Class Reference

Special grid class that stores point indices of the mesh object in its grids. More...

#include <Grid.h>

Construction

 MeshPointGrid ()
 Construction. More...
 
 MeshPointGrid (const MeshKernel &rclM)
 Construction. More...
 
 MeshPointGrid (const MeshKernel &rclM, int iCtGridPerAxis)
 Construction. More...
 
 MeshPointGrid (const MeshKernel &rclM, float fGridLen)
 Construction. More...
 
 MeshPointGrid (const MeshKernel &rclM, unsigned long ulX, unsigned long ulY, unsigned long ulZ)
 Construction. More...
 
virtual ~MeshPointGrid ()
 Destruction. More...
 
unsigned long FindElements (const Base::Vector3f &rclPoint, std::set< ElementIndex > &aulElements) const
 Finds all points that lie in the same grid as the point rclPoint. More...
 
virtual void Validate (const MeshKernel &rclM)
 Validates the grid structure and rebuilds it if needed. More...
 
virtual void Validate ()
 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 AddPoint (const MeshPoint &rclPt, ElementIndex ulPtIndex, float fEpsilon=0.0f)
 Adds a new point element to the grid structure. 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...
 
unsigned long HasElements () const
 Returns the number of stored elements. More...
 
virtual void RebuildGrid ()
 Rebuilds the grid structure. More...
 

Additional Inherited Members

- Public Member Functions inherited from MeshCore::MeshGrid
virtual unsigned long Inside (const Base::BoundBox3f &rclBB, std::vector< ElementIndex > &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< ElementIndex > &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< ElementIndex > &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< ElementIndex > &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< ElementIndex > &raclInd) const
 Returns the indices of the elements in the given grid. More...
 
unsigned long GetElements (const Base::Vector3f &rclPoint, std::vector< ElementIndex > &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 () const
 Returns the bounding box of the whole. More...
 
Base::BoundBox3f GetMeshBoundBox () 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< ElementIndex > &raclInd) const
 Get the indices of all elements lying in the grids around a given grid with distance ulDistance. More...
 
virtual ~MeshGrid ()
 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...
 
- Protected Member Functions inherited from MeshCore::MeshGrid
virtual void InitGrid ()
 Initializes the size of the internal structure. More...
 
virtual void Clear ()
 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 ()
 Construction. More...
 

Detailed Description

Special grid class that stores point indices of the mesh object in its grids.

Constructor & Destructor Documentation

◆ MeshPointGrid() [1/5]

MeshPointGrid::MeshPointGrid ( )

Construction.

◆ MeshPointGrid() [2/5]

MeshPointGrid::MeshPointGrid ( const MeshKernel rclM)

Construction.

References RebuildGrid().

◆ MeshPointGrid() [3/5]

MeshPointGrid::MeshPointGrid ( const MeshKernel rclM,
int  iCtGridPerAxis 
)

Construction.

References MeshCore::MeshGrid::Rebuild().

◆ MeshPointGrid() [4/5]

MeshPointGrid::MeshPointGrid ( const MeshKernel rclM,
float  fGridLen 
)

◆ MeshPointGrid() [5/5]

MeshPointGrid::MeshPointGrid ( const MeshKernel rclM,
unsigned long  ulX,
unsigned long  ulY,
unsigned long  ulZ 
)

Construction.

References MeshCore::MeshGrid::Rebuild().

◆ ~MeshPointGrid()

virtual MeshCore::MeshPointGrid::~MeshPointGrid ( )
virtual

Destruction.

Member Function Documentation

◆ AddPoint()

void MeshPointGrid::AddPoint ( const MeshPoint rclPt,
ElementIndex  ulPtIndex,
float  fEpsilon = 0.0f 
)
protected

Adds a new point element to the grid structure.

rclPt is the geometric point and ulPtIndex the corresponding index in the mesh kernel.

References Pos(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.

Referenced by RebuildGrid().

◆ FindElements()

unsigned long MeshPointGrid::FindElements ( const Base::Vector3f rclPoint,
std::set< ElementIndex > &  aulElements 
) const

Finds all points that lie in the same grid as the point rclPoint.

References MeshCore::MeshGrid::GetElements(), and Pos().

◆ HasElements()

unsigned long MeshCore::MeshPointGrid::HasElements ( void  ) const
protectedvirtual

Returns the number of stored elements.

Implements MeshCore::MeshGrid.

◆ Pos()

void MeshPointGrid::Pos ( const Base::Vector3f rclPoint,
unsigned long &  rulX,
unsigned long &  rulY,
unsigned long &  rulZ 
) const
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 AddPoint(), and FindElements().

◆ RebuildGrid()

void MeshPointGrid::RebuildGrid ( void  )
protectedvirtual

◆ Validate() [1/2]

void MeshPointGrid::Validate ( void  )
virtual

Validates the grid structure and rebuilds it if needed.

References RebuildGrid().

◆ Validate() [2/2]

void MeshPointGrid::Validate ( const MeshKernel rclM)
virtual

Validates the grid structure and rebuilds it if needed.

Implements MeshCore::MeshGrid.

References MeshCore::MeshGrid::Attach(), MeshCore::MeshKernel::CountPoints(), and RebuildGrid().

◆ Verify()


The documentation for this class was generated from the following files: