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

Fast Marching algorithm for normals direction resolution. More...

#include <ecvFastMarchingForNormsDirection.h>

Inheritance diagram for ccFastMarchingForNormsDirection:
Collaboration diagram for ccFastMarchingForNormsDirection:

Classes

class  DirectionCell
 A Fast Marching grid cell for normals direction resolution. More...
 

Public Member Functions

 ccFastMarchingForNormsDirection ()
 Default constructor. More...
 
int init (ccGenericPointCloud *cloud, NormsIndexesTableType *theNorms, ccOctree *theOctree, unsigned char gridLevel)
 Initializes the grid with a point cloud (and ist corresponding octree) More...
 
unsigned updateResolvedTable (ccGenericPointCloud *theCloud, std::vector< unsigned char > &resolved, NormsIndexesTableType *theNorms)
 Updates a list of point flags, indicating the points already processed. More...
 
int propagate () override
 Propagates the front. More...
 
- Public Member Functions inherited from cloudViewer::FastMarching
 FastMarching ()
 Default constructor. More...
 
virtual ~FastMarching ()
 Destructor. More...
 
virtual bool setSeedCell (const Tuple3i &pos)
 Sets a given cell as "seed". 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 OrientNormals (ccPointCloud *theCloud, unsigned char octreeLevel, ecvProgressDialog *progressCb=nullptr)
 Static entry point (helper) More...
 

Protected Member Functions

float computeTCoefApprox (cloudViewer::FastMarching::Cell *currentCell, cloudViewer::FastMarching::Cell *neighbourCell) const override
 Computes the front acceleration between two cells. More...
 
int step () override
 Propagates the front (one step) More...
 
void initTrialCells () override
 Initializes the TRIAL cells list. More...
 
bool instantiateGrid (unsigned size) override
 Instantiates grid in memory. More...
 
float computePropagationConfidence (DirectionCell *originCell, DirectionCell *destCell) const
 Computes relative 'confidence' between two cells (orientations) More...
 
void resolveCellOrientation (unsigned index)
 Resolves the direction of a given cell (once and for all) More...
 
- 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...
 

Additional Inherited Members

- 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 normals direction resolution.

Extends the FastMarching class.

Definition at line 28 of file ecvFastMarchingForNormsDirection.h.

Constructor & Destructor Documentation

◆ ccFastMarchingForNormsDirection()

ccFastMarchingForNormsDirection::ccFastMarchingForNormsDirection ( )

Default constructor.

Member Function Documentation

◆ computePropagationConfidence()

float ccFastMarchingForNormsDirection::computePropagationConfidence ( DirectionCell originCell,
DirectionCell destCell 
) const
protected

Computes relative 'confidence' between two cells (orientations)

Returns
confidence between 0 and 1

◆ computeTCoefApprox()

float ccFastMarchingForNormsDirection::computeTCoefApprox ( cloudViewer::FastMarching::Cell currentCell,
cloudViewer::FastMarching::Cell neighbourCell 
) const
overrideprotectedvirtual

Computes the front acceleration between two cells.

Parameters
currentCellthe "central" cell
neighbourCellthe other cell
Returns
the front acceleration

Implements cloudViewer::FastMarching.

◆ init()

int ccFastMarchingForNormsDirection::init ( ccGenericPointCloud cloud,
NormsIndexesTableType theNorms,
ccOctree theOctree,
unsigned char  gridLevel 
)

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
theNormsthe normals array
theOctreethe associated octree
gridLevelthe level of subdivision
Returns
a negative value if something went wrong

◆ initTrialCells()

void ccFastMarchingForNormsDirection::initTrialCells ( )
overrideprotectedvirtual

Initializes the TRIAL cells list.

See the Fast Marching algorithm theory for more information

Reimplemented from cloudViewer::FastMarching.

◆ instantiateGrid()

bool ccFastMarchingForNormsDirection::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 103 of file ecvFastMarchingForNormsDirection.h.

References size.

◆ OrientNormals()

static int ccFastMarchingForNormsDirection::OrientNormals ( ccPointCloud theCloud,
unsigned char  octreeLevel,
ecvProgressDialog progressCb = nullptr 
)
static

Static entry point (helper)

◆ propagate()

int ccFastMarchingForNormsDirection::propagate ( )
overridevirtual

Propagates the front.

The seeds should have already been initialized

Returns
propagation result (errors = negative values)

Implements cloudViewer::FastMarching.

◆ resolveCellOrientation()

void ccFastMarchingForNormsDirection::resolveCellOrientation ( unsigned  index)
protected

Resolves the direction of a given cell (once and for all)

◆ step()

int ccFastMarchingForNormsDirection::step ( )
overrideprotectedvirtual

Propagates the front (one step)

Returns
a negative value if a problem occurred

Implements cloudViewer::FastMarching.

◆ updateResolvedTable()

unsigned ccFastMarchingForNormsDirection::updateResolvedTable ( ccGenericPointCloud theCloud,
std::vector< unsigned char > &  resolved,
NormsIndexesTableType theNorms 
)

Updates a list of point flags, indicating the points already processed.

Returns
the number of resolved points

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