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

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

Detailed Description

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

Public Member Functions

virtual void Validate (const MeshKernel &rclM)
 
virtual void Validate (void)
 
virtual bool Verify () const
 
Construction
 MeshFacetGrid (const MeshKernel &rclM)
 Construction.
 
 MeshFacetGrid (void)
 Construction.
 
 MeshFacetGrid (const MeshKernel &rclM, unsigned long ulX, unsigned long ulY, unsigned long ulZ)
 Construction.
 
 MeshFacetGrid (const MeshKernel &rclM, int iCtGridPerAxis)
 Construction.
 
 MeshFacetGrid (const MeshKernel &rclM, float fGridLen)
 Construction.
 
virtual ~MeshFacetGrid (void)
 Destruction.
 
Search
unsigned long SearchNearestFromPoint (const Base::Vector3f &rclPt) const
 
unsigned long SearchNearestFromPoint (const Base::Vector3f &rclPt, float fMaxSearchArea) const
 
void SearchNearestFacetInGrid (unsigned long ulX, unsigned long ulY, unsigned long ulZ, const Base::Vector3f &rclPt, float &rfMinDist, unsigned long &rulFacetInd) const
 
void SearchNearestFacetInHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ, unsigned long ulDistance, const Base::Vector3f &rclPt, unsigned long &rulFacetInd, float &rfMinDist) const
 
- 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 Pos (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
 
void PosWithCheck (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
 
void AddFacet (const MeshGeomFacet &rclFacet, unsigned long ulFacetIndex, float fEpsilon=0.0f)
 
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

◆ AddFacet()

void MeshCore::MeshFacetGrid::AddFacet ( const MeshGeomFacet rclFacet,
unsigned long  ulFacetIndex,
float  fEpsilon = 0.0f 
)
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.

◆ HasElements()

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

Returns the number of stored elements.

Implements MeshCore::MeshGrid.

◆ Pos()

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

◆ PosWithCheck()

void MeshCore::MeshFacetGrid::PosWithCheck ( 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::MeshFacetGrid::RebuildGrid ( void  )
protectedvirtual

Rebuilds the grid structure.

Implements MeshCore::MeshGrid.

◆ SearchNearestFacetInGrid()

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

◆ SearchNearestFacetInHull()

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

◆ SearchNearestFromPoint() [1/2]

unsigned long MeshCore::MeshFacetGrid::SearchNearestFromPoint ( const Base::Vector3f rclPt) const

Searches for the nearest facet from a point.

◆ SearchNearestFromPoint() [2/2]

unsigned long MeshCore::MeshFacetGrid::SearchNearestFromPoint ( const Base::Vector3f rclPt,
float  fMaxSearchArea 
) const

Searches for the nearest facet from a point with the maximum search area.

◆ Validate() [1/2]

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

Validates the grid structure and rebuilds it if needed.

Implements MeshCore::MeshGrid.

◆ Validate() [2/2]

virtual void MeshCore::MeshFacetGrid::Validate ( void  )
virtual

Validates the grid structure and rebuilds it if needed.

◆ Verify()

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

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

Implements MeshCore::MeshGrid.