ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
FastMarchingForFacetExtraction Class Reference

Fast Marching algorithm for planar facets extraction (qFacets plugin) More...

#include <fastMarchingForFacetExtraction.h>

Inheritance diagram for FastMarchingForFacetExtraction:
Collaboration diagram for FastMarchingForFacetExtraction:

Classes

class  PlanarCell
 A Fast Marching grid cell for planar facets extraction. More...
 

Public Member Functions

 FastMarchingForFacetExtraction ()
 Default constructor. More...
 
virtual ~FastMarchingForFacetExtraction ()
 Destructor. More...
 
int init (ccGenericPointCloud *cloud, cloudViewer::DgmOctree *theOctree, unsigned char gridLevel, ScalarType maxError, cloudViewer::DistanceComputationTools::ERROR_MEASURES errorMeasure, bool useRetroProjectionError, cloudViewer::GenericProgressCallback *progressCb=0)
 Initializes the grid with a point cloud (and ist corresponding octree) More...
 
unsigned updateFlagsTable (ccGenericPointCloud *theCloud, std::vector< unsigned char > &flags, unsigned facetIndex)
 Updates a list of point flags, indicating the points alreay processed. More...
 
void setPropagateCallback (cloudViewer::GenericProgressCallback *propagateProgressCb)
 Sets the propagation progress callback. More...
 
virtual int propagate () override
 Propagates the front. More...
 
virtual bool setSeedCell (const Tuple3i &pos) override
 Sets a given cell as "seed". More...
 
- Public Member Functions inherited from cloudViewer::FastMarching
 FastMarching ()
 Default constructor. More...
 
virtual ~FastMarching ()
 Destructor. More...
 
virtual void cleanLastPropagation ()
 
virtual float getTime (Tuple3i &pos, bool absoluteCoordinates=false) const
 Returns the front arrival time at a given cell. More...
 
virtual void setExtendedConnectivity (bool state)
 Sets extended connectivity mode. More...
 

Static Public Member Functions

static int ExtractPlanarFacets (ccPointCloud *theCloud, unsigned char octreeLevel, ScalarType maxError, cloudViewer::DistanceComputationTools::ERROR_MEASURES errorMeasure, bool useRetroProjectionError=true, cloudViewer::GenericProgressCallback *progressCb=0, cloudViewer::DgmOctree *_theOctree=0)
 Static entry point (helper) More...
 

Protected Member Functions

virtual float computeTCoefApprox (cloudViewer::FastMarching::Cell *currentCell, cloudViewer::FastMarching::Cell *neighbourCell) const override
 Computes the front acceleration between two cells. More...
 
virtual int step () override
 Propagates the front (one step) More...
 
virtual void initTrialCells () override
 Initializes the TRIAL cells list. More...
 
virtual bool instantiateGrid (unsigned size) override
 Instantiates grid in memory. More...
 
ScalarType addCellToCurrentFacet (unsigned index)
 
- Protected Member Functions inherited from cloudViewer::FastMarching
unsigned pos2index (const Tuple3i &pos) const
 
virtual int initGridWithOctree (DgmOctree *octree, unsigned char gridLevel)
 
virtual int initGrid (float step, unsigned dim[3])
 Intializes the grid with a given step and dimensions. More...
 
virtual int initOther ()
 
virtual float computeT (unsigned index)
 Computes the front arrival time at a given cell. More...
 
template<class T >
bool instantiateGridTpl (unsigned size)
 Grid instantiation helper. More...
 
virtual void addTrialCell (unsigned index)
 Add a cell to the TRIAL cells list. More...
 
virtual void addActiveCell (unsigned index)
 Add a cell to the ACTIVE cells list. More...
 
virtual void addIgnoredCell (unsigned index)
 Add a cell to the IGNORED cells list. More...
 
virtual unsigned getNearestTrialCell ()
 Returns the TRIAL cell with the smallest front arrival time. More...
 
void resetCells (std::vector< unsigned > &list)
 Resets the state of cells in a given list. More...
 

Protected Attributes

cloudViewer::ReferenceCloudm_currentFacetPoints
 Current facet points. More...
 
ScalarType m_currentFacetError
 Current facet error. More...
 
ScalarType m_maxError
 Max facet error. More...
 
cloudViewer::DistanceComputationTools::ERROR_MEASURES m_errorMeasure
 Error measrue. More...
 
bool m_useRetroProjectionError
 Whether to use retro-projection error in propagation. More...
 
cloudViewer::GenericProgressCallbackm_propagateProgressCb
 Propagation progress callback. More...
 
unsigned m_propagateProgress
 Propagation progress. More...
 
- Protected Attributes inherited from cloudViewer::FastMarching
std::vector< unsigned > m_activeCells
 ACTIVE cells list. More...
 
std::vector< unsigned > m_trialCells
 TRIAL cells list. More...
 
std::vector< unsigned > m_ignoredCells
 IGNORED cells lits. More...
 
bool m_initialized
 Specifiies whether structure is initialized or not. More...
 
unsigned m_dx
 Grid size along the X dimension. More...
 
unsigned m_dy
 Grid size along the Y dimension. More...
 
unsigned m_dz
 Grid size along the Z dimension. More...
 
unsigned m_rowSize
 Shift for cell access acceleration (Y dimension) More...
 
unsigned m_sliceSize
 Shift for cell access acceleration (Z dimension) More...
 
unsigned m_indexShift
 First index of innerbound grid. More...
 
unsigned m_gridSize
 Grid size. More...
 
Cell ** m_theGrid
 Grid used to process Fast Marching. More...
 
DgmOctreem_octree
 Associated octree. More...
 
unsigned char m_gridLevel
 Equivalent octree subdivision level. More...
 
float m_cellSize
 Octree cell size at equivalent subdivision level. More...
 
Tuple3i m_minFillIndexes
 Octree min fill indexes at 'm_gridLevel'. More...
 
unsigned m_numberOfNeighbours
 Current number of neighbours (6 or 26) More...
 
int m_neighboursIndexShift [26]
 Neighbours coordinates shifts in grid. More...
 
float m_neighboursDistance [26]
 Neighbours distance weight. More...
 

Detailed Description

Fast Marching algorithm for planar facets extraction (qFacets plugin)

Extends the FastMarching class.

Definition at line 24 of file fastMarchingForFacetExtraction.h.

Constructor & Destructor Documentation

◆ FastMarchingForFacetExtraction()

FastMarchingForFacetExtraction::FastMarchingForFacetExtraction ( )

Default constructor.

Definition at line 26 of file fastMarchingForFacetExtraction.cpp.

◆ ~FastMarchingForFacetExtraction()

FastMarchingForFacetExtraction::~FastMarchingForFacetExtraction ( )
virtual

Destructor.

Definition at line 36 of file fastMarchingForFacetExtraction.cpp.

References m_currentFacetPoints.

Member Function Documentation

◆ addCellToCurrentFacet()

◆ computeTCoefApprox()

◆ ExtractPlanarFacets()

◆ init()

int FastMarchingForFacetExtraction::init ( ccGenericPointCloud cloud,
cloudViewer::DgmOctree theOctree,
unsigned char  gridLevel,
ScalarType  maxError,
cloudViewer::DistanceComputationTools::ERROR_MEASURES  errorMeasure,
bool  useRetroProjectionError,
cloudViewer::GenericProgressCallback progressCb = 0 
)

Initializes the grid with a point cloud (and ist corresponding octree)

The points should be associated to an (active) scalar field. The Fast Marching grid will have the same dimensions as the input octree considered at a given level of subdivision.

Parameters
cloudthe point cloud
theOctreethe associated octree
gridLevelthe level of subdivision
maxErrormaximum error allowed by 'propagated' facet
errorMeasureerror measure
useRetroProjectionErrorwhether to use retro-projection error in propagation
progressCbprogeress callback
Returns
a negative value if something went wrong

Definition at line 70 of file fastMarchingForFacetExtraction.cpp.

References cloudViewer::DgmOctree::associatedCloud(), FastMarchingForFacetExtraction::PlanarCell::C, FastMarchingForFacetExtraction::PlanarCell::cellCode, ComputeCellStats(), error(), cloudViewer::DgmOctree::getCellCodes(), cloudViewer::DgmOctree::getCellPos(), cloudViewer::DgmOctree::getPointsInCell(), cloudViewer::FastMarching::initGridWithOctree(), m_errorMeasure, cloudViewer::FastMarching::m_initialized, m_maxError, cloudViewer::FastMarching::m_theGrid, m_useRetroProjectionError, FastMarchingForFacetExtraction::PlanarCell::N, nProgress, cloudViewer::NormalizedProgress::oneStep(), FastMarchingForFacetExtraction::PlanarCell::planarError, cloudViewer::FastMarching::pos2index(), result, cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::stop(), cloudViewer::GenericProgressCallback::textCanBeEdited(), and cloudViewer::GenericProgressCallback::update().

Referenced by ExtractPlanarFacets().

◆ initTrialCells()

◆ instantiateGrid()

virtual bool FastMarchingForFacetExtraction::instantiateGrid ( unsigned  size)
inlineoverrideprotectedvirtual

Instantiates grid in memory.

Grid is also filled with zeros.

Parameters
sizegrid size
Returns
success

Implements cloudViewer::FastMarching.

Definition at line 108 of file fastMarchingForFacetExtraction.h.

References size.

◆ propagate()

int FastMarchingForFacetExtraction::propagate ( )
overridevirtual

Propagates the front.

The seeds should have already been initialized

Returns
propagation result (errors = negative values)

Implements cloudViewer::FastMarching.

Definition at line 267 of file fastMarchingForFacetExtraction.cpp.

References initTrialCells(), cloudViewer::GenericProgressCallback::isCancelRequested(), m_propagateProgressCb, result, and step().

Referenced by ExtractPlanarFacets().

◆ setPropagateCallback()

void FastMarchingForFacetExtraction::setPropagateCallback ( cloudViewer::GenericProgressCallback propagateProgressCb)
inline

Sets the propagation progress callback.

Definition at line 71 of file fastMarchingForFacetExtraction.h.

References m_propagateProgress, and m_propagateProgressCb.

Referenced by ExtractPlanarFacets().

◆ setSeedCell()

bool FastMarchingForFacetExtraction::setSeedCell ( const Tuple3i pos)
overridevirtual

Sets a given cell as "seed".

Parameters
posthe cell position in the grid (3 integer coordinates)
Returns
whether the cell could be set as a seed or not

Reimplemented from cloudViewer::FastMarching.

Definition at line 333 of file fastMarchingForFacetExtraction.cpp.

References addCellToCurrentFacet(), cloudViewer::DgmOctree::associatedCloud(), m_currentFacetError, m_currentFacetPoints, cloudViewer::FastMarching::m_octree, m_propagateProgress, cloudViewer::FastMarching::pos2index(), cloudViewer::FastMarching::setSeedCell(), and cloudViewer::ReferenceCloud::size().

Referenced by ExtractPlanarFacets().

◆ step()

◆ updateFlagsTable()

Member Data Documentation

◆ m_currentFacetError

ScalarType FastMarchingForFacetExtraction::m_currentFacetError
protected

Current facet error.

Definition at line 120 of file fastMarchingForFacetExtraction.h.

Referenced by initTrialCells(), setSeedCell(), and step().

◆ m_currentFacetPoints

cloudViewer::ReferenceCloud* FastMarchingForFacetExtraction::m_currentFacetPoints
protected

◆ m_errorMeasure

cloudViewer::DistanceComputationTools::ERROR_MEASURES FastMarchingForFacetExtraction::m_errorMeasure
protected

Error measrue.

Definition at line 126 of file fastMarchingForFacetExtraction.h.

Referenced by addCellToCurrentFacet(), computeTCoefApprox(), and init().

◆ m_maxError

ScalarType FastMarchingForFacetExtraction::m_maxError
protected

Max facet error.

Definition at line 123 of file fastMarchingForFacetExtraction.h.

Referenced by init(), initTrialCells(), and step().

◆ m_propagateProgress

unsigned FastMarchingForFacetExtraction::m_propagateProgress
protected

Propagation progress.

Definition at line 134 of file fastMarchingForFacetExtraction.h.

Referenced by setPropagateCallback(), setSeedCell(), and step().

◆ m_propagateProgressCb

cloudViewer::GenericProgressCallback* FastMarchingForFacetExtraction::m_propagateProgressCb
protected

Propagation progress callback.

Definition at line 132 of file fastMarchingForFacetExtraction.h.

Referenced by propagate(), setPropagateCallback(), and step().

◆ m_useRetroProjectionError

bool FastMarchingForFacetExtraction::m_useRetroProjectionError
protected

Whether to use retro-projection error in propagation.

Definition at line 129 of file fastMarchingForFacetExtraction.h.

Referenced by computeTCoefApprox(), and init().


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