FreeCAD C++
Public Member Functions | Protected Member Functions | List of all members
MeshCore::MeshPointGrid Class Reference

#include <Mod/Mesh/App/Core/Grid.h>

Detailed Description

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

Public Member Functions

unsigned long FindElements (const Base::Vector3f &rclPoint, std::set< unsigned long > &aulElements) const
 
virtual void Validate (const MeshKernel &rclM)
 
virtual void Validate (void)
 
virtual bool Verify () const
 
Construction
 MeshPointGrid (void)
 Construction.
 
 MeshPointGrid (const MeshKernel &rclM)
 Construction.
 
 MeshPointGrid (const MeshKernel &rclM, int iCtGridPerAxis)
 Construction.
 
 MeshPointGrid (const MeshKernel &rclM, float fGridLen)
 Construction.
 
 MeshPointGrid (const MeshKernel &rclM, unsigned long ulX, unsigned long ulY, unsigned long ulZ)
 Construction.
 
virtual ~MeshPointGrid (void)
 Destruction.
 
- Public Member Functions inherited from MeshCore::MeshGrid
virtual ~MeshGrid (void)
 Destruction.
 
virtual void Attach (const MeshKernel &rclM)
 
virtual void Rebuild (unsigned long ulPerGrid=MESH_CT_GRID, unsigned long ulMaxGrid=MESH_MAX_GRIDS)
 
virtual void Rebuild (int iCtGridPerAxis=MESH_CT_GRID_PER_AXIS)
 
virtual void Rebuild (unsigned long ulX, unsigned long ulY, unsigned long ulZ)
 
virtual void GetGridLengths (float &rfLenX, float &rfLenY, float &rfLenZ) const
 
virtual void GetCtGrids (unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
 
unsigned long GetIndexToPosition (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const
 
bool GetPositionToIndex (unsigned long id, unsigned long &ulX, unsigned long &ulY, unsigned long &ulZ) const
 
unsigned long GetCtElements (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const
 
bool CheckPosition (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
 
virtual void Position (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
 
bool CheckPos (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const
 
void GetHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ, unsigned long ulDistance, std::set< unsigned long > &raclInd) const
 
virtual unsigned long Inside (const Base::BoundBox3f &rclBB, std::vector< unsigned long > &raulElements, bool bDelDoubles=true) const
 
virtual unsigned long Inside (const Base::BoundBox3f &rclBB, std::set< unsigned long > &raulElementss) const
 
virtual unsigned long Inside (const Base::BoundBox3f &rclBB, std::vector< unsigned long > &raulElements, const Base::Vector3f &rclOrg, float fMaxDist, bool bDelDoubles=true) const
 
void SearchNearestFromPoint (const Base::Vector3f &rclPt, std::set< unsigned long > &rclInd) const
 
unsigned long GetElements (unsigned long ulX, unsigned long ulY, unsigned long ulZ, std::set< unsigned long > &raclInd) const
 
unsigned long GetElements (const Base::Vector3f &rclPoint, std::vector< unsigned long > &aulFacets) const
 
Base::BoundBox3f GetBoundBox (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const
 
Base::BoundBox3f GetBoundBox (void) const
 
Base::BoundBox3f GetMeshBoundBox (void) const
 

Protected Member Functions

void AddPoint (const MeshPoint &rclPt, unsigned long ulPtIndex, float fEpsilon=0.0f)
 
void Pos (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
 
unsigned long HasElements (void) const
 
virtual void RebuildGrid (void)
 
- Protected Member Functions inherited from MeshCore::MeshGrid
virtual void InitGrid (void)
 
virtual void Clear (void)
 
virtual void CalculateGridLength (unsigned long ulCtGrid, unsigned long ulMaxGrids)
 
virtual void CalculateGridLength (int iCtGridPerAxis)
 
 MeshGrid (const MeshKernel &rclM)
 Construction.
 
 MeshGrid (void)
 Construction.
 

Additional Inherited Members

- Protected Attributes inherited from MeshCore::MeshGrid
std::vector< std::vector< std::vector< std::set< unsigned long > > > > _aulGrid
 
const MeshKernel_pclMesh
 
unsigned long _ulCtElements
 
unsigned long _ulCtGridsX
 
unsigned long _ulCtGridsY
 
unsigned long _ulCtGridsZ
 
float _fGridLenX
 
float _fGridLenY
 
float _fGridLenZ
 
float _fMinX
 
float _fMinY
 
float _fMinZ
 

Member Function Documentation

◆ AddPoint()

void MeshCore::MeshPointGrid::AddPoint ( const MeshPoint rclPt,
unsigned long  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.

◆ FindElements()

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

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

◆ HasElements()

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

Returns the number of stored elements.

Implements MeshCore::MeshGrid.

◆ Pos()

void MeshCore::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.

◆ RebuildGrid()

virtual void MeshCore::MeshPointGrid::RebuildGrid ( void  )
protectedvirtual

Rebuilds the grid structure.

Implements MeshCore::MeshGrid.

◆ Validate() [1/2]

virtual void MeshCore::MeshPointGrid::Validate ( const MeshKernel rclM)
virtual

Validates the grid structure and rebuilds it if needed.

Implements MeshCore::MeshGrid.

◆ Validate() [2/2]

virtual void MeshCore::MeshPointGrid::Validate ( void  )
virtual

Validates the grid structure and rebuilds it if needed.

◆ Verify()

virtual bool MeshCore::MeshPointGrid::Verify ( ) const
virtual

Verifies the grid structure and returns false if inconsistencies are found.

Implements MeshCore::MeshGrid.