CCCoreLib 31 May 2022
CloudCompare Core algorithms
Public Member Functions | Protected Attributes | List of all members
CCCoreLib::GridAndMeshIntersection Class Reference

Structure to compute the intersection between a mesh and a grid (to compute fast distances) More...

#include <GridAndMeshIntersection.h>

Collaboration diagram for CCCoreLib::GridAndMeshIntersection:
Collaboration graph
[legend]

Public Member Functions

 GridAndMeshIntersection ()
 Default constructor.
 
virtual ~GridAndMeshIntersection ()
 Destructor.
 
void clear ()
 Clears the structure.
 
bool isInitialized () const
 Returns whether the structure is initialized or not.
 
bool computeMeshIntersection (GenericIndexedMesh *mesh, const CCVector3 &minGridBB, const CCVector3 &maxGridBB, PointCoordinateType cellSize, GenericProgressCallback *progressCb=nullptr)
 Initializes the structure with a mesh.
 
bool initDistanceTransformWithMesh (GenericIndexedMesh *mesh, const CCVector3 &minGridBB, const CCVector3 &maxGridBB, const CCVector3 &minFilledBB, const CCVector3 &maxFilledBB, PointCoordinateType cellSize, GenericProgressCallback *progressCb=nullptr)
 Initializes the structure with a mesh.
 
Tuple3i computeCellPos (const CCVector3 &P) const
 Computes the (grid) cell position that contains a given point.
 
void computeCellCenter (const Tuple3i &cellPos, CCVector3 &center) const
 Computes the center of a given (grid) cell. More...
 
const GenericIndexedMeshmesh () const
 Returns the associated mesh (if any)
 
const SaitoSquaredDistanceTransformdistanceTransform () const
 Returns the distance transform (if any)
 
unsigned distanceTransformValue (const Tuple3i &cellPos, bool isLocalCellPos) const
 Returns the distance transform value (if any)
 
PointCoordinateType cellSize () const
 Returns the virtual grid cell size.
 
Tuple3i toLocal (const Tuple3i &cellPos) const
 Converts a global cell position to a local one.
 
const TriangleList * trianglesInCell (const Tuple3i &cellPos, bool isLocalCellPos) const
 Returns the list of triangles intersecting a given cell.
 
void computeSignedDistToBoundaries (const Tuple3i &cellPos, Tuple3i &distToLowerBorder, Tuple3i &distToUpperBorder) const
 Computes the distances between a given cell and the inner grid boundaries.
 

Protected Attributes

GenericIndexedMeshm_mesh
 Mesh.
 
SaitoSquaredDistanceTransformm_distanceTransform
 Distance transform.
 
CCVector3 m_minGridBB
 Virtual grid bounding-box (min corner)
 
CCVector3 m_maxGridBB
 Virtual grid bounding-box (max corner)
 
Tuple3i m_minFillIndexes
 Virtual grid occupancy of the mesh (minimum indexes for each dimension)
 
Tuple3i m_maxFillIndexes
 Virtual grid occupancy of the mesh (maximum indexes for each dimension)
 
PointCoordinateType m_cellSize
 Virtual grid cell size.
 
Grid3D< TriangleList * > m_perCellTriangleList
 Grid of TriangleList items. More...
 
bool m_initialized
 Whether the structure is properly initialized.
 

Detailed Description

Structure to compute the intersection between a mesh and a grid (to compute fast distances)

Member Function Documentation

◆ computeCellCenter()

void CCCoreLib::GridAndMeshIntersection::computeCellCenter ( const Tuple3i cellPos,
CCVector3 center 
) const
inline

Computes the center of a given (grid) cell.

Parameters
cellPosthe (grid) cell position
centerthe computed center

Member Data Documentation

◆ m_perCellTriangleList

Grid3D<TriangleList*> CCCoreLib::GridAndMeshIntersection::m_perCellTriangleList
protected

Grid of TriangleList items.

Warning
: may be smaller than the 'virtual grid' (see m_minFillIndexes and m_maxFillIndexes)

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