ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::DgmOctree Class Reference

The octree structure used throughout the library. More...

#include <DgmOctree.h>

Inheritance diagram for cloudViewer::DgmOctree:
Collaboration diagram for cloudViewer::DgmOctree:

Classes

struct  BoxNeighbourhood
 Input/output parameters structure for getPointsInBoxNeighbourhood. More...
 
struct  CellDescriptor
 Structure used during nearest neighbour search. More...
 
struct  CylindricalNeighbourhood
 
struct  IndexAndCode
 Association between an index and the code of an octree cell. More...
 
struct  NearestNeighboursSearchStruct
 Container of in/out parameters for nearest neighbour(s) search. More...
 
struct  NearestNeighboursSphericalSearchStruct
 
struct  octreeCell
 Octree cell descriptor. More...
 
struct  octreeTopDownScanStruct
 Internal structure used to perform a top-down scan of the octree. More...
 
struct  PointDescriptor
 Structure used during nearest neighbour search. More...
 
struct  ProgressiveCylindricalNeighbourhood
 

Public Types

enum  RayCastProcess { RC_NEAREST_POINT , RC_CLOSE_POINTS }
 Ray casting processes. More...
 
using CellCode = unsigned
 Type of the code of an octree cell. More...
 
using cellCodesContainer = std::vector< CellCode >
 Octree cell codes container. More...
 
using cellIndexesContainer = std::vector< unsigned int >
 Octree cell indexes container. More...
 
using NeighboursSet = std::vector< PointDescriptor >
 A set of neighbours. More...
 
using NeighbourCellsSet = std::vector< CellDescriptor >
 A set of neighbour cells descriptors. More...
 
using cellsContainer = std::vector< IndexAndCode >
 Container of 'IndexAndCode' structures. More...
 
using octreeCellFunc = bool(*)(const octreeCell &, void **, NormalizedProgress *)
 

Public Member Functions

 DgmOctree (GenericIndexedCloudPersist *cloud)
 DgmOctree constructor. More...
 
 ~DgmOctree () override=default
 DgmOctree destructor. More...
 
virtual void clear ()
 Clears the octree. More...
 
int build (GenericProgressCallback *progressCb=nullptr)
 Builds the structure. More...
 
int build (const CCVector3 &octreeMin, const CCVector3 &octreeMax, const CCVector3 *pointsMinFilter=nullptr, const CCVector3 *pointsMaxFilter=nullptr, GenericProgressCallback *progressCb=nullptr)
 Builds the structure with constraints. More...
 
unsigned getNumberOfProjectedPoints () const
 Returns the number of points projected into the octree. More...
 
const CCVector3getOctreeMins () const
 Returns the lower boundaries of the octree. More...
 
const CCVector3getOctreeMaxs () const
 Returns the higher boundaries of the octree. More...
 
void getBoundingBox (CCVector3 &bbMin, CCVector3 &bbMax) const
 Returns the octree bounding box. More...
 
const int * getMinFillIndexes (unsigned char level) const
 
const int * getMaxFillIndexes (unsigned char level) const
 
const PointCoordinateTypegetCellSize (unsigned char level) const
 Returns the octree cells length for a given level of subdivision. More...
 
void getCellDistanceFromBorders (const Tuple3i &cellPos, unsigned char level, int *cellDists) const
 
void getCellDistanceFromBorders (const Tuple3i &cellPos, unsigned char level, int neighbourhoodLength, int *cellDists) const
 
bool getPointsInCellByCellIndex (ReferenceCloud *cloud, unsigned cellIndex, unsigned char level, bool clearOutputCloud=true) const
 Returns the points lying in a specific cell. More...
 
bool getPointsInCell (CellCode cellCode, unsigned char level, ReferenceCloud *subset, bool isCodeTruncated=false, bool clearOutputCloud=true) const
 Returns the points lying in a specific cell. More...
 
ReferenceCloudgetPointsInCellsWithSortedCellCodes (cellCodesContainer &cellCodes, unsigned char level, ReferenceCloud *subset, bool areCodesTruncated=false) const
 Returns the points lying in multiple cells. More...
 
unsigned findPointNeighbourhood (const CCVector3 *_queryPoint, ReferenceCloud *Yk, unsigned maxNumberOfNeighbors, unsigned char level, double &maxSquareDist, double maxSearchDist=0, int *finalNeighbourhoodSize=nullptr) const
 Finds the nearest neighbours around a query point. More...
 
double findTheNearestNeighborStartingFromCell (NearestNeighboursSearchStruct &nNSS) const
 
unsigned findNearestNeighborsStartingFromCell (NearestNeighboursSearchStruct &nNSS, bool getOnlyPointsWithValidScalar=false) const
 
int findNeighborsInASphereStartingFromCell (NearestNeighboursSearchStruct &nNSS, double radius, bool sortValues=true) const
 Advanced form of the nearest neighbours search algorithm (in a sphere) More...
 
int getPointsInSphericalNeighbourhood (const CCVector3 &sphereCenter, PointCoordinateType radius, NeighboursSet &neighbours, unsigned char level) const
 Returns the points falling inside a sphere. More...
 
std::size_t getPointsInCylindricalNeighbourhood (CylindricalNeighbourhood &params) const
 Returns the points falling inside a cylinder. More...
 
std::size_t getPointsInCylindricalNeighbourhoodProgressive (ProgressiveCylindricalNeighbourhood &params) const
 Same as getPointsInCylindricalNeighbourhood with progressive approach. More...
 
std::size_t getPointsInBoxNeighbourhood (BoxNeighbourhood &params) const
 Returns the points falling inside a box. More...
 
void getTheCellPosWhichIncludesThePoint (const CCVector3 *thePoint, Tuple3i &cellPos) const
 
void getTheCellPosWhichIncludesThePoint (const CCVector3 *thePoint, Tuple3i &cellPos, unsigned char level) const
 
void getTheCellPosWhichIncludesThePoint (const CCVector3 *thePoint, Tuple3i &cellPos, unsigned char level, bool &inBounds) const
 
void getCellPos (CellCode code, unsigned char level, Tuple3i &cellPos, bool isCodeTruncated) const
 
void computeCellCenter (CellCode code, unsigned char level, CCVector3 &center, bool isCodeTruncated=false) const
 
void computeCellCenter (const Tuple3i &cellPos, unsigned char level, CCVector3 &center) const
 
void computeCellCenter (const Tuple3s &cellPos, unsigned char level, CCVector3 &center) const
 Short version of computeCellCenter. More...
 
void computeCellLimits (CellCode code, unsigned char level, CCVector3 &cellMin, CCVector3 &cellMax, bool isCodeTruncated=false) const
 Returns the spatial limits of a given cell. More...
 
unsigned char findBestLevelForAGivenNeighbourhoodSizeExtraction (PointCoordinateType radius) const
 
unsigned char findBestLevelForComparisonWithOctree (const DgmOctree *theOtherOctree) const
 
unsigned char findBestLevelForAGivenPopulationPerCell (unsigned indicativeNumberOfPointsPerCell) const
 
unsigned char findBestLevelForAGivenCellNumber (unsigned indicativeNumberOfCells) const
 
const CellCodegetCellCode (unsigned index) const
 Returns the ith cell code. More...
 
bool getCellCodes (unsigned char level, cellCodesContainer &vec, bool truncatedCodes=false) const
 
bool getCellIndexes (unsigned char level, cellIndexesContainer &vec) const
 
bool getCellCodesAndIndexes (unsigned char level, cellsContainer &vec, bool truncatedCodes=false) const
 
void diff (const cellCodesContainer &codesA, const cellCodesContainer &codesB, cellCodesContainer &diffA, cellCodesContainer &diffB) const
 
bool diff (unsigned char octreeLevel, const cellsContainer &codesA, const cellsContainer &codesB, int &diffA, int &diffB, int &cellsA, int &cellsB) const
 
const unsigned & getCellNumber (unsigned char level) const
 Returns the number of cells for a given level of subdivision. More...
 
double computeMeanOctreeDensity (unsigned char level) const
 
int extractCCs (const cellCodesContainer &cellCodes, unsigned char level, bool sixConnexity, GenericProgressCallback *progressCb=nullptr) const
 
int extractCCs (unsigned char level, bool sixConnexity, GenericProgressCallback *progressCb=nullptr) const
 
unsigned executeFunctionForAllCellsStartingAtLevel (unsigned char startingLevel, octreeCellFunc func, void **additionalParameters, unsigned minNumberOfPointsPerCell, unsigned maxNumberOfPointsPerCell, bool multiThread=true, GenericProgressCallback *progressCb=nullptr, const char *functionTitle=nullptr, int maxThreadCount=0)
 
unsigned executeFunctionForAllCellsAtLevel (unsigned char level, octreeCellFunc func, void **additionalParameters, bool multiThread=false, GenericProgressCallback *progressCb=nullptr, const char *functionTitle=nullptr, int maxThreadCount=0)
 
bool rayCast (const CCVector3 &rayAxis, const CCVector3 &rayOrigin, double maxRadiusOrFov, bool isFOV, RayCastProcess process, std::vector< PointDescriptor > &output) const
 Ray casting algorithm. More...
 
GenericIndexedCloudPersistassociatedCloud () const
 Returns the associated cloud. More...
 
const cellsContainerpointsAndTheirCellCodes () const
 Returns the octree 'structure'. More...
 
- Public Member Functions inherited from cloudViewer::GenericOctree
virtual ~GenericOctree ()=default
 Default destructor. More...
 

Static Public Member Functions

static unsigned char GET_BIT_SHIFT (unsigned char level)
 Returns the binary shift for a given level of subdivision. More...
 
static int OCTREE_LENGTH (int level)
 
static CellCode GenerateTruncatedCellCode (const Tuple3i &cellPos, unsigned char level)
 
static CellCode GenerateTruncatedCellCode (const Tuple3s &pos, unsigned char level)
 Short version of GenerateTruncatedCellCode. More...
 
static PointCoordinateType ComputeMinDistanceToCellBorder (const CCVector3 &queryPoint, PointCoordinateType cs, const CCVector3 &cellCenter)
 
static bool MultiThreadSupport ()
 

Static Public Attributes

static const int MAX_OCTREE_LEVEL = 10
 Max octree subdivision level. More...
 
static const int MAX_OCTREE_LENGTH = (1 << MAX_OCTREE_LEVEL)
 Max octree length at last level of subdivision (number of cells) More...
 
static const CellCode INVALID_CELL_CODE = (~static_cast<CellCode>(0))
 Invalid cell code. More...
 

Protected Member Functions

int genericBuild (GenericProgressCallback *progressCb=nullptr)
 Generic method to build the octree structure. More...
 
void updateMinAndMaxTables ()
 Updates the tables containing octree limits and boundaries. More...
 
void updateCellSizeTable ()
 
void updateCellCountTable ()
 
void computeCellsStatistics (unsigned char level)
 Computes statistics about cells for a given level of subdivision. More...
 
void getNeighborCellsAround (const Tuple3i &cellPos, cellIndexesContainer &neighborCellsIndexes, int neighbourhoodLength, unsigned char level) const
 
void getPointsInNeighbourCellsAround (NearestNeighboursSearchStruct &nNSS, int neighbourhoodLength, bool getOnlyPointsWithValidScalar=false) const
 Gets point in the neighbourhing cells of a specific cell. More...
 
unsigned getCellIndex (CellCode truncatedCellCode, unsigned char bitDec) const
 Returns the index of a given cell represented by its code. More...
 
unsigned getCellIndex (CellCode truncatedCellCode, unsigned char bitDec, unsigned begin, unsigned end) const
 Returns the index of a given cell represented by its code. More...
 

Protected Attributes

cellsContainer m_thePointsAndTheirCellCodes
 The coded octree structure. More...
 
GenericIndexedCloudPersistm_theAssociatedCloud
 Associated cloud. More...
 
unsigned m_numberOfProjectedPoints
 Number of points projected in the octree. More...
 
unsigned m_nearestPow2
 
CCVector3 m_dimMin
 Min coordinates of the octree bounding-box. More...
 
CCVector3 m_dimMax
 Max coordinates of the octree bounding-box. More...
 
CCVector3 m_pointsMin
 
CCVector3 m_pointsMax
 
PointCoordinateType m_cellSize [MAX_OCTREE_LEVEL+2]
 Cell dimensions for all subdivision levels. More...
 
int m_fillIndexes [(MAX_OCTREE_LEVEL+1) *6]
 
unsigned m_cellCount [MAX_OCTREE_LEVEL+1]
 Number of cells per level of subdivision. More...
 
unsigned m_maxCellPopulation [MAX_OCTREE_LEVEL+1]
 Max cell population per level of subdivision. More...
 
double m_averageCellPopulation [MAX_OCTREE_LEVEL+1]
 Average cell population per level of subdivision. More...
 
double m_stdDevCellPopulation [MAX_OCTREE_LEVEL+1]
 Std. dev. of cell population per level of subdivision. More...
 

Detailed Description

The octree structure used throughout the library.

Implements the GenericOctree interface. Corresponds to the octree structure developed during Daniel Girardeau-Montaut's PhD (see PhD manuscript, Chapter 4).

Definition at line 39 of file DgmOctree.h.

Member Typedef Documentation

◆ CellCode

Type of the code of an octree cell.

Warning
3 bits per level are required.
Never pass a 'constant initializer' by reference

Definition at line 78 of file DgmOctree.h.

◆ cellCodesContainer

Octree cell codes container.

Definition at line 92 of file DgmOctree.h.

◆ cellIndexesContainer

using cloudViewer::DgmOctree::cellIndexesContainer = std::vector<unsigned int>

Octree cell indexes container.

Definition at line 95 of file DgmOctree.h.

◆ cellsContainer

Container of 'IndexAndCode' structures.

Definition at line 351 of file DgmOctree.h.

◆ NeighbourCellsSet

A set of neighbour cells descriptors.

Definition at line 150 of file DgmOctree.h.

◆ NeighboursSet

A set of neighbours.

Definition at line 133 of file DgmOctree.h.

◆ octreeCellFunc

Generic form of a function that can be applied automatically to all cells of the octree See DgmOctree::executeFunctionForAllCellsAtLevel and DgmOctree::executeFunctionForAllCellsStartingAtLevel. The parameters of such a function are:

  • (octreeCell) cell descriptor
  • (void**) table of user parameters for the function (maybe void)
  • (NormalizedProgress*) optional (normalized) progress callback
  • return success

Definition at line 393 of file DgmOctree.h.

Member Enumeration Documentation

◆ RayCastProcess

Ray casting processes.

Enumerator
RC_NEAREST_POINT 
RC_CLOSE_POINTS 

Definition at line 1179 of file DgmOctree.h.

Constructor & Destructor Documentation

◆ DgmOctree()

DgmOctree::DgmOctree ( GenericIndexedCloudPersist cloud)
explicit

DgmOctree constructor.

METHODS

Parameters
cloudthe cloud to construct the octree on

Definition at line 174 of file DgmOctree.cpp.

References clear(), and m_theAssociatedCloud.

◆ ~DgmOctree()

cloudViewer::DgmOctree::~DgmOctree ( )
overridedefault

DgmOctree destructor.

Member Function Documentation

◆ associatedCloud()

◆ build() [1/2]

int DgmOctree::build ( const CCVector3 octreeMin,
const CCVector3 octreeMax,
const CCVector3 pointsMinFilter = nullptr,
const CCVector3 pointsMaxFilter = nullptr,
GenericProgressCallback progressCb = nullptr 
)

Builds the structure with constraints.

Octree spatial limits must be specified. Also, if specified, points falling outside the "pointsFilter" limits won't be projected into the octree structure. Otherwise, all points will be taken into account. Octree 3D limits in space should be cubical.

Parameters
octreeMinthe lower limits for the octree cells along X, Y and Z
octreeMaxthe upper limits for the octree cells along X, Y and Z
pointsMinFilterthe lower limits for the projected points along X, Y and Z (is specified)
pointsMaxFilterthe upper limits for the projected points along X, Y and Z (is specified)
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
Returns
the number of points projected in the octree

Definition at line 204 of file DgmOctree.cpp.

References clear(), genericBuild(), m_dimMax, m_dimMin, m_pointsMax, m_pointsMin, and m_thePointsAndTheirCellCodes.

◆ build() [2/2]

int DgmOctree::build ( GenericProgressCallback progressCb = nullptr)

Builds the structure.

Octree 3D limits are determined automatically.

Parameters
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
Returns
the number of points projected in the octree

Definition at line 196 of file DgmOctree.cpp.

References clear(), genericBuild(), m_thePointsAndTheirCellCodes, and updateMinAndMaxTables().

Referenced by cloudViewer::ScalarFieldTools::applyScalarFieldGaussianFilter(), qCanupoProcess::Classify(), cloudViewer::GeometricalAnalysisTools::ComputeCharactersitic(), cloudViewer::DistanceComputationTools::computeCloud2MeshDistances(), qCanupoTools::ComputeCorePointsDescriptors(), qM3C2Normals::ComputeCorePointsNormals(), cloudViewer::DistanceComputationTools::computeGeodesicDistances(), cloudViewer::GeometricalAnalysisTools::ComputeLocalDensityApprox(), ccEntityAction::computeOctree(), cloudViewer::ScalarFieldTools::computeScalarFieldGradient(), FastMarchingForFacetExtraction::ExtractPlanarFacets(), cloudViewer::GeometricalAnalysisTools::FlagDuplicatePoints(), cloudViewer::AutoSegmentationTools::frontPropagationBasedSegmentation(), cloudViewer::AutoSegmentationTools::labelConnectedComponents(), cloudViewer::CloudSamplingTools::noiseFilter(), cloudViewer::ICPRegistrationTools::Register(), cloudViewer::CloudSamplingTools::resampleCloudSpatially(), cloudViewer::CloudSamplingTools::resampleCloudWithOctree(), cloudViewer::CloudSamplingTools::resampleCloudWithOctreeAtLevel(), cloudViewer::CloudSamplingTools::sorFilter(), cloudViewer::CloudSamplingTools::subsampleCloudWithOctree(), cloudViewer::CloudSamplingTools::subsampleCloudWithOctreeAtLevel(), cloudViewer::DistanceComputationTools::synchronizeOctrees(), and cloudViewer::StatisticalTestingTools::testCloudWithStatisticalModel().

◆ clear()

◆ computeCellCenter() [1/3]

void cloudViewer::DgmOctree::computeCellCenter ( CellCode  code,
unsigned char  level,
CCVector3 center,
bool  isCodeTruncated = false 
) const
inline

◆ computeCellCenter() [2/3]

void cloudViewer::DgmOctree::computeCellCenter ( const Tuple3i cellPos,
unsigned char  level,
CCVector3 center 
) const
inline

Returns the cell center for a given level of subdivision of a cell designated by its position

Parameters
cellPosthe cell position
levelthe level of subdivision
centerthe computed center

Definition at line 878 of file DgmOctree.h.

References Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

◆ computeCellCenter() [3/3]

void cloudViewer::DgmOctree::computeCellCenter ( const Tuple3s cellPos,
unsigned char  level,
CCVector3 center 
) const
inline

Short version of computeCellCenter.

Definition at line 895 of file DgmOctree.h.

References Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

◆ computeCellLimits()

void DgmOctree::computeCellLimits ( CellCode  code,
unsigned char  level,
CCVector3 cellMin,
CCVector3 cellMax,
bool  isCodeTruncated = false 
) const

Returns the spatial limits of a given cell.

Parameters
codethe cell code
levelthe level of subdivision
cellMinthe minimum coordinates along each dimension
cellMaxthe maximum coordinates along each dimension
isCodeTruncatedindicates if the given code is truncated or not

Definition at line 520 of file DgmOctree.cpp.

References getCellPos(), getCellSize(), m_dimMin, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

◆ computeCellsStatistics()

void DgmOctree::computeCellsStatistics ( unsigned char  level)
protected

Computes statistics about cells for a given level of subdivision.

This method requires some computation, therefore it shouldn't be called too often.

Parameters
levelthe level of subdivision

Definition at line 423 of file DgmOctree.cpp.

References GET_BIT_SHIFT(), m_averageCellPopulation, m_cellCount, m_maxCellPopulation, m_stdDevCellPopulation, m_thePointsAndTheirCellCodes, and MAX_OCTREE_LEVEL.

Referenced by updateCellCountTable().

◆ computeMeanOctreeDensity()

double DgmOctree::computeMeanOctreeDensity ( unsigned char  level) const

Computes mean octree density (point/cell) at a given level of subdivision

Parameters
levelthe level of subdivision
Returns
mean density (point/cell)

Definition at line 2789 of file DgmOctree.cpp.

References getCellNumber(), and m_numberOfProjectedPoints.

◆ ComputeMinDistanceToCellBorder()

static PointCoordinateType cloudViewer::DgmOctree::ComputeMinDistanceToCellBorder ( const CCVector3 queryPoint,
PointCoordinateType  cs,
const CCVector3 cellCenter 
)
inlinestatic

Computes the minimal distance between a point and the borders (faces) of the cell (cube) in which it is included

Parameters
queryPointthe point
csthe cell size (as cells are cubical, it's the same along every dimension)
cellCenterthe cell center
Returns
the minimal distance

Definition at line 1057 of file DgmOctree.h.

References abs(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by cloudViewer::DistanceComputationTools::computeCloud2MeshDistanceWithOctree(), ComputeNeighborhood2MeshDistancesWithOctree(), findNearestNeighborsStartingFromCell(), findNeighborsInASphereStartingFromCell(), and findTheNearestNeighborStartingFromCell().

◆ diff() [1/2]

void DgmOctree::diff ( const cellCodesContainer codesA,
const cellCodesContainer codesB,
cellCodesContainer diffA,
cellCodesContainer diffB 
) const

Returns the cells that differ between two octrees (for a same implicit level of subdivision) Warning: the two octrees should have been computed with the same bounding-box.

Parameters
codesAthe cell codes of the first octree for the implicit level
codesBthe cell codes of the second octree for the implicit level
diffAthe cells of the first octree that are not in the second octree
diffBthe cells of the second octree that are not in the first octree

Definition at line 2955 of file DgmOctree.cpp.

Referenced by findBestLevelForComparisonWithOctree().

◆ diff() [2/2]

bool DgmOctree::diff ( unsigned char  octreeLevel,
const cellsContainer codesA,
const cellsContainer codesB,
int &  diffA,
int &  diffB,
int &  cellsA,
int &  cellsB 
) const

Returns the differences (in terms of number of cells) between two octrees for a given level of subdivision Warning: the two octrees should have been computed with the same bounding-box.

Parameters
octreeLevelthe octree level
codesAthe cell codes (and point index) of the first octree
codesBthe cell codes (and point index) of the second octree
diffAthe number of cells of the first octree that are not in the second octree
diffBthe number of cells of the second octree that are not in the first octree
cellsAthe number of cells of the first octree for the given number of subdivision
cellsBthe number of cells of the second octree for the given number of subdivision
Returns
false if it could not calculate the differences

Definition at line 2980 of file DgmOctree.cpp.

References GET_BIT_SHIFT(), and octreeLevel.

◆ executeFunctionForAllCellsAtLevel()

unsigned DgmOctree::executeFunctionForAllCellsAtLevel ( unsigned char  level,
octreeCellFunc  func,
void **  additionalParameters,
bool  multiThread = false,
GenericProgressCallback progressCb = nullptr,
const char *  functionTitle = nullptr,
int  maxThreadCount = 0 
)

Method to apply automatically a specific function to each cell of the octree The function to apply should be of the form DgmOctree::octreeCellFunc. In this case the octree cells are scanned one by one at the same level of subdivision.

    Parallel processing is based on QtConcurrent::map system.

    \param level the level of subdivision
    \param func the function to apply
    \param additionalParameters the function parameters
    \param multiThread whether to use parallel processing or not
    \param progressCb the client application can get some notification

of the process progress through this callback mechanism (see GenericProgressCallback)

Parameters
functionTitlefunction title
maxThreadCountthe maximum number of threads to use (0 = all). Ignored if 'multiThread' is false.
Returns
the number of processed cells (or 0 is something went wrong)

Definition at line 3573 of file DgmOctree.cpp.

References cloudViewer::ReferenceCloud::addPointIndex(), GET_BIT_SHIFT(), getCellNumber(), cloudViewer::DgmOctree::octreeCell::index, cloudViewer::DgmOctree::octreeCell::level, m_averageCellPopulation, m_maxCellPopulation, m_stdDevCellPopulation, m_theAssociatedCloud, m_thePointsAndTheirCellCodes, max(), cloudViewer::DgmOctree::octreeCell::points, cloudViewer::ReferenceCloud::reserve(), result, cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::GenericCloud::size(), cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::stop(), cloudViewer::GenericProgressCallback::textCanBeEdited(), cloudViewer::DgmOctree::octreeCell::truncatedCode, and cloudViewer::GenericProgressCallback::update().

Referenced by cloudViewer::ScalarFieldTools::applyScalarFieldGaussianFilter(), cloudViewer::GeometricalAnalysisTools::ComputeCharactersitic(), cloudViewer::DistanceComputationTools::computeCloud2CloudDistances(), cloudViewer::GeometricalAnalysisTools::ComputeLocalDensityApprox(), cloudViewer::ScalarFieldTools::computeScalarFieldGradient(), cloudViewer::GeometricalAnalysisTools::FlagDuplicatePoints(), cloudViewer::CloudSamplingTools::noiseFilter(), cloudViewer::CloudSamplingTools::resampleCloudWithOctreeAtLevel(), cloudViewer::CloudSamplingTools::sorFilter(), and cloudViewer::CloudSamplingTools::subsampleCloudWithOctreeAtLevel().

◆ executeFunctionForAllCellsStartingAtLevel()

unsigned DgmOctree::executeFunctionForAllCellsStartingAtLevel ( unsigned char  startingLevel,
octreeCellFunc  func,
void **  additionalParameters,
unsigned  minNumberOfPointsPerCell,
unsigned  maxNumberOfPointsPerCell,
bool  multiThread = true,
GenericProgressCallback progressCb = nullptr,
const char *  functionTitle = nullptr,
int  maxThreadCount = 0 
)

Method to apply automatically a specific function to each cell of the octree The function to apply should be of the form DgmOctree::octreeCellFunc. In this case the octree cells are scanned one by one at the same level of subdivision, but the scan can also be sometimes done (inside the cell) at deeper levels, in order to limit the number of points in a cell. Thanks to this, the function is applied on a limited number of points, avoiding great loss of performances. The only limitation is when the level of subdivision is deepest level. In this case no more splitting is possible.

    Parallel processing is based on QtConcurrent::map system.

    \param startingLevel the initial level of subdivision
    \param func the function to apply
    \param additionalParameters the function parameters
    \param minNumberOfPointsPerCell minimal number of points inside

a cell (indicative)

Parameters
maxNumberOfPointsPerCellmaximum number of points inside a cell (indicative)
multiThreadwhether to use parallel processing or not
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
functionTitlefunction title
maxThreadCountthe maximum number of threads to use (0 = all). Ignored if 'multiThread' is false.
Returns
the number of processed cells (or 0 is something went wrong)

Definition at line 3820 of file DgmOctree.cpp.

References cloudViewer::ReferenceCloud::addPointIndex(), cloudViewer::ReferenceCloud::clear(), GET_BIT_SHIFT(), getCellNumber(), cloudViewer::DgmOctree::octreeCell::index, cloudViewer::GenericProgressCallback::isCancelRequested(), cloudViewer::DgmOctree::octreeCell::level, m_averageCellPopulation, m_maxCellPopulation, m_numberOfProjectedPoints, m_stdDevCellPopulation, m_theAssociatedCloud, m_thePointsAndTheirCellCodes, max(), MAX_OCTREE_LEVEL, nProgress, cloudViewer::DgmOctree::octreeCell::points, cloudViewer::ReferenceCloud::reserve(), result, cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::GenericCloud::size(), cloudViewer::GenericProgressCallback::start(), stddev(), cloudViewer::GenericProgressCallback::stop(), cloudViewer::GenericProgressCallback::textCanBeEdited(), cloudViewer::DgmOctree::octreeCell::truncatedCode, and cloudViewer::GenericProgressCallback::update().

Referenced by cloudViewer::StatisticalTestingTools::testCloudWithStatisticalModel().

◆ extractCCs() [1/2]

int DgmOctree::extractCCs ( const cellCodesContainer cellCodes,
unsigned char  level,
bool  sixConnexity,
GenericProgressCallback progressCb = nullptr 
) const

Computes the connected components (considering the octree cells only) for a given level of subdivision (partial) The octree is seen as a regular 3D grid, and each cell of this grid is either set to 0 (if no points lies in it) or to 1 (if some points lie in it, e.g. if it is indeed a cell of this octree). This version of the algorithm can be applied by considering only a specified list of octree cells (ignoring the others).

Parameters
cellCodesthe cell codes to consider for the CC computation
levelthe level of subdivision at which to perform the algorithm
sixConnexityindicates if the CC's 3D connexity should be 6 (26 otherwise)
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
Returns
error code:
  • '>= 0' = number of components
  • '-1' = no cells (input)
  • '-2' = not enough memory
  • '-3' = no CC found

Definition at line 3093 of file DgmOctree.cpp.

References cloudViewer::ReferenceCloud::forwardIterator(), GET_BIT_SHIFT(), getCellPos(), getPointsInCell(), IndexAndCodeExt::indexComp(), m_theAssociatedCloud, cloudViewer::NormalizedProgress::oneStep(), ParallelSort, cloudViewer::ReferenceCloud::placeIteratorAtBeginning(), cloudViewer::ReferenceCloud::setCurrentPointScalarValue(), cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::ReferenceCloud::size(), cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::stop(), std::swap(), cloudViewer::GenericProgressCallback::textCanBeEdited(), Tuple3Tpl< Type >::u, cloudViewer::GenericProgressCallback::update(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by extractCCs(), and cloudViewer::AutoSegmentationTools::labelConnectedComponents().

◆ extractCCs() [2/2]

int DgmOctree::extractCCs ( unsigned char  level,
bool  sixConnexity,
GenericProgressCallback progressCb = nullptr 
) const

Computes the connected components (considering the octree cells only) for a given level of subdivision (complete) The octree is seen as a regular 3D grid, and each cell of this grid is either set to 0 (if no points lies in it) or to 1 (if some points lie in it, e.g. if it is indeed a cell of this octree). This version of the algorithm is directly applied on the whole octree.

Parameters
levelthe level of subdivision at which to perform the algorithm
sixConnexityindicates if the CC's 3D connexity should be 6 (26 otherwise)
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
Returns
error code:
  • '>= 0' = number of components
  • '-1' = no cells (input)
  • '-2' = not enough memory
  • '-3' = no CC found

Definition at line 3058 of file DgmOctree.cpp.

References extractCCs(), and getCellCodes().

◆ findBestLevelForAGivenCellNumber()

unsigned char DgmOctree::findBestLevelForAGivenCellNumber ( unsigned  indicativeNumberOfCells) const

Determines the best subdivision level of the octree to match a given number of cells

Parameters
indicativeNumberOfCells'desired' number of cells
Returns
the 'best' level

Definition at line 2766 of file DgmOctree.cpp.

References abs(), getCellNumber(), and MAX_OCTREE_LEVEL.

Referenced by cloudViewer::CloudSamplingTools::resampleCloudWithOctree(), and cloudViewer::CloudSamplingTools::subsampleCloudWithOctree().

◆ findBestLevelForAGivenNeighbourhoodSizeExtraction()

unsigned char DgmOctree::findBestLevelForAGivenNeighbourhoodSizeExtraction ( PointCoordinateType  radius) const

◆ findBestLevelForAGivenPopulationPerCell()

unsigned char DgmOctree::findBestLevelForAGivenPopulationPerCell ( unsigned  indicativeNumberOfPointsPerCell) const

Determines the best subdivision level of the octree that gives the average population per cell closest to the input value

Parameters
indicativeNumberOfPointsPerCell'desired' average number of points per cell
Returns
the 'best' level

Definition at line 2737 of file DgmOctree.cpp.

References m_averageCellPopulation, and MAX_OCTREE_LEVEL.

Referenced by cloudViewer::GeometricalAnalysisTools::ComputeLocalDensityApprox(), ComputeMathOpWithNearestNeighbor(), cloudViewer::ScalarFieldTools::computeScalarFieldGradient(), cloudViewer::CloudSamplingTools::noiseFilter(), rayCast(), cloudViewer::CloudSamplingTools::sorFilter(), and cloudViewer::StatisticalTestingTools::testCloudWithStatisticalModel().

◆ findBestLevelForComparisonWithOctree()

unsigned char DgmOctree::findBestLevelForComparisonWithOctree ( const DgmOctree theOtherOctree) const

Determines the best level of subdivision of the octree at which to apply a cloud-2-cloud distance computation algorithm The octree instance on which is "applied" this method should be the compared cloud's one. "theOtherOctree" should be the reference cloud's octree.

Parameters
theOtherOctreethe octree of the other cloud
Returns
the 'best' level

Definition at line 2691 of file DgmOctree.cpp.

References diff(), getNumberOfProjectedPoints(), m_thePointsAndTheirCellCodes, max(), MAX_OCTREE_LEVEL, and min().

Referenced by cloudViewer::DistanceComputationTools::computeCloud2CloudDistances(), and cloudViewer::ICPRegistrationTools::Register().

◆ findNearestNeighborsStartingFromCell()

unsigned DgmOctree::findNearestNeighborsStartingFromCell ( NearestNeighboursSearchStruct nNSS,
bool  getOnlyPointsWithValidScalar = false 
) const

Advanced form of the nearest neighbours search algorithm (multiple neighbours) This version is optimized for a multiple nearest neighbours search that is applied around several query points included in the same octree cell. See DgmOctree::NearestNeighboursSearchStruct for more details.

Parameters
nNSSNN search parameters
getOnlyPointsWithValidScalarwhether to ignore points having an invalid associated scalar value
Returns
the number of neighbours found

Definition at line 1655 of file DgmOctree.cpp.

References cloudViewer::DgmOctree::NearestNeighboursSearchStruct::alreadyVisitedNeighbourhoodSize, cloudViewer::utility::ceil(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellCenter, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellPos, ComputeMinDistanceToCellBorder(), cloudViewer::DgmOctree::PointDescriptor::distComp(), GenerateTruncatedCellCode(), GET_BIT_SHIFT(), getCellIndex(), getCellSize(), cloudViewer::GenericIndexedCloudPersist::getPointPersistentPtr(), cloudViewer::GenericCloud::getPointScalarValue(), getPointsInNeighbourCellsAround(), INVALID_CELL_CODE, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::level, m_fillIndexes, m_numberOfProjectedPoints, m_theAssociatedCloud, m_thePointsAndTheirCellCodes, max(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::maxSearchSquareDistd, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::minNumberOfNeighbors, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::pointsInNeighbourhood, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::queryPoint, std::swap(), Tuple3Tpl< Type >::u, and cloudViewer::ScalarField::ValidValue().

Referenced by cloudViewer::CloudSamplingTools::applyNoiseFilterAtLevel(), cloudViewer::CloudSamplingTools::applySORFilterAtLevel(), cloudViewer::GeometricalAnalysisTools::ComputeApproxPointsDensityInACellAtLevel(), cloudViewer::DistanceComputationTools::computeCellHausdorffDistanceWithLocalModel(), cloudViewer::StatisticalTestingTools::computeLocalChi2DistAtLevel(), and findPointNeighbourhood().

◆ findNeighborsInASphereStartingFromCell()

int DgmOctree::findNeighborsInASphereStartingFromCell ( NearestNeighboursSearchStruct nNSS,
double  radius,
bool  sortValues = true 
) const

Advanced form of the nearest neighbours search algorithm (in a sphere)

This version is optimized for a spatially bounded search instead of a search bounded by a number of neighbours.

Warning
the number of points in the output buffer (nNSS.pointsInNeighbourhood) may be greater than the actual count of closest points inside the sphere! (which is returned by the method). Only the 'k' first points are actually inside the sphere (the others are not removed for the sake of performance).
Parameters
nNSSa pack of parameters
radiusthe sphere radius
sortValuesspecifies if the neighbours needs to be sorted by their distance to the query point or not
Returns
the number of neighbours found

TEST_CELLS_FOR_SPHERICAL_NN

Definition at line 2479 of file DgmOctree.cpp.

References cloudViewer::DgmOctree::NearestNeighboursSearchStruct::alreadyVisitedNeighbourhoodSize, cloudViewer::utility::ceil(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellCenter, ComputeMinDistanceToCellBorder(), copy, count, cloudViewer::DgmOctree::PointDescriptor::distComp(), getCellSize(), getPointsInNeighbourCellsAround(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::level, cloudViewer::DgmOctree::PointDescriptor::point, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::pointsInNeighbourhood, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::queryPoint, SQRT_3, cloudViewer::DgmOctree::PointDescriptor::squareDistd, and std::swap().

Referenced by cloudViewer::CloudSamplingTools::applyNoiseFilterAtLevel(), cloudViewer::ScalarFieldTools::computeCellGaussianFilter(), cloudViewer::DistanceComputationTools::computeCellHausdorffDistanceWithLocalModel(), cloudViewer::GeometricalAnalysisTools::ComputeGeomCharacteristicAtLevel(), cloudViewer::ScalarFieldTools::computeMeanGradientOnPatch(), cloudViewer::GeometricalAnalysisTools::FlagDuplicatePointsInACellAtLevel(), and masc::Tools::PrepareFeatures().

◆ findPointNeighbourhood()

unsigned DgmOctree::findPointNeighbourhood ( const CCVector3 _queryPoint,
ReferenceCloud Yk,
unsigned  maxNumberOfNeighbors,
unsigned char  level,
double &  maxSquareDist,
double  maxSearchDist = 0,
int *  finalNeighbourhoodSize = nullptr 
) const

Finds the nearest neighbours around a query point.

This is the simplest form of the nearest neighbour search algorithm. It should only be used for unique/few requests as it is not optimized for repetitive search around points lying in the same octree cell (see DgmOctree::findNearestNeighborsStartingFromCell for example). Moreover, distances between each neighbour and the query aren't stored in this version of the algorithm.

Parameters
_queryPointthe query point
Ykthe nearest neighbours
maxNumberOfNeighborsthe maximal number of points to find
levelthe subdivision level of the octree at which to perform the search
maxSquareDistthe square distance between the farthest "nearest neighbour" and the query point
maxSearchDistthe maximum search distance (ignored if <= 0)
[out]thefinal neighborhood (half)size (optional)
Returns
the number of neighbours found

Definition at line 721 of file DgmOctree.cpp.

References cloudViewer::ReferenceCloud::addPointIndex(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::alreadyVisitedNeighbourhoodSize, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellCenter, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellPos, computeCellCenter(), findNearestNeighborsStartingFromCell(), findTheNearestNeighborStartingFromCell(), getTheCellPosWhichIncludesThePoint(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::level, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::maxSearchSquareDistd, min(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::minNumberOfNeighbors, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::pointsInNeighbourhood, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::queryPoint, and cloudViewer::DgmOctree::NearestNeighboursSearchStruct::theNearestPointIndex.

Referenced by qCanupoProcess::Classify(), ComputeMathOpWithNearestNeighbor(), and RefinePointClassif().

◆ findTheNearestNeighborStartingFromCell()

double DgmOctree::findTheNearestNeighborStartingFromCell ( NearestNeighboursSearchStruct nNSS) const

Advanced form of the nearest neighbour search algorithm (unique neighbour) This version is optimized for a unique nearest-neighbour search. See DgmOctree::NearestNeighboursSearchStruct for more details.

Parameters
nNSSNN search parameters
Returns
the square distance between the query point and its nearest neighbour (or -1 if none was found - i.e. maxSearchDist was reached)

Definition at line 1468 of file DgmOctree.cpp.

References cloudViewer::DgmOctree::NearestNeighboursSearchStruct::alreadyVisitedNeighbourhoodSize, cloudViewer::utility::ceil(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellCenter, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellPos, ComputeMinDistanceToCellBorder(), GenerateTruncatedCellCode(), GET_BIT_SHIFT(), getCellIndex(), getCellSize(), getNeighborCellsAround(), cloudViewer::GenericIndexedCloudPersist::getPointPersistentPtr(), INVALID_CELL_CODE, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::level, m_fillIndexes, m_numberOfProjectedPoints, m_theAssociatedCloud, m_thePointsAndTheirCellCodes, max(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::maxSearchSquareDistd, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::minimalCellsSetToVisit, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::queryPoint, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::theNearestPointIndex, and Tuple3Tpl< Type >::u.

Referenced by cloudViewer::DistanceComputationTools::computeCellHausdorffDistance(), cloudViewer::DistanceComputationTools::computeCellHausdorffDistanceWithLocalModel(), and findPointNeighbourhood().

◆ GenerateTruncatedCellCode() [1/2]

DgmOctree::CellCode DgmOctree::GenerateTruncatedCellCode ( const Tuple3i cellPos,
unsigned char  level 
)
static

Generates the truncated cell code of a cell given its position at a given level of subdivision For a given level of subdivision (lets call it N), the cell position can be expressed as 3 integer coordinates between 0 and 2^N-1 (the number of cells along each dimension). This method computes the corresponding cell code, truncated at the level N (meaning that it is only valid for the Nth level, not for other levels).

Parameters
cellPosthe cell position
levelthe level of subdivision
Returns
the truncated cell code

Definition at line 120 of file DgmOctree.cpp.

References GET_BIT_SHIFT(), MAX_OCTREE_LEVEL, PRE_COMPUTED_POS_CODES, MonoDimensionalCellCodes::VALUE_COUNT, MonoDimensionalCellCodes::values, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by findNearestNeighborsStartingFromCell(), findTheNearestNeighborStartingFromCell(), genericBuild(), getPointsInBoxNeighbourhood(), getPointsInCylindricalNeighbourhood(), getPointsInCylindricalNeighbourhoodProgressive(), and getPointsInSphericalNeighbourhood().

◆ GenerateTruncatedCellCode() [2/2]

DgmOctree::CellCode DgmOctree::GenerateTruncatedCellCode ( const Tuple3s pos,
unsigned char  level 
)
static

◆ genericBuild()

◆ GET_BIT_SHIFT()

◆ getBoundingBox()

void DgmOctree::getBoundingBox ( CCVector3 bbMin,
CCVector3 bbMax 
) const

Returns the octree bounding box.

Method to request the octree bounding box limits

Parameters
bbMinlower bounding-box limits (Xmin,Ymin,Zmin)
bbMaxhigher bounding-box limits (Xmax,Ymax,Zmax)

Definition at line 493 of file DgmOctree.cpp.

References m_dimMax, and m_dimMin.

◆ getCellCode()

const CellCode& cloudViewer::DgmOctree::getCellCode ( unsigned  index) const
inline

Returns the ith cell code.

Definition at line 963 of file DgmOctree.h.

Referenced by cloudViewer::DistanceComputationTools::computeApproxCloud2CloudDistance().

◆ getCellCodes()

bool DgmOctree::getCellCodes ( unsigned char  level,
cellCodesContainer vec,
bool  truncatedCodes = false 
) const

Returns the list of codes corresponding to the octree cells for a given level of subdivision Only the non empty cells are represented in the octree structure.

Parameters
levelthe level of subdivision
vecthe list of codes
truncatedCodesindicates if the resulting codes should be truncated or not
Returns
false if an error occurred (e.g. not enough memory)

Definition at line 2822 of file DgmOctree.cpp.

References GET_BIT_SHIFT(), m_numberOfProjectedPoints, and m_thePointsAndTheirCellCodes.

Referenced by cloudViewer::DistanceComputationTools::computeApproxCloud2CloudDistance(), extractCCs(), FastMarchingForFacetExtraction::init(), and cloudViewer::FastMarchingForPropagation::init().

◆ getCellCodesAndIndexes()

bool DgmOctree::getCellCodesAndIndexes ( unsigned char  level,
cellsContainer vec,
bool  truncatedCodes = false 
) const

Returns the list of indexes and codes corresponding to the octree cells for a given level of subdivision Only the non empty cells are represented in the octree structure. Cell indexes are expressed relatively to the DgmOctree structure. They correspond to the indexes of the first points of each cell.

Parameters
levelthe level of subdivision
vecthe list of codes & indexes
truncatedCodesindicates if the resulting codes should be truncated or not
Returns
false if an error occurred (e.g. not enough memory)

Definition at line 2794 of file DgmOctree.cpp.

References GET_BIT_SHIFT(), m_numberOfProjectedPoints, and m_thePointsAndTheirCellCodes.

Referenced by cloudViewer::DistanceComputationTools::computeCloud2MeshDistancesWithOctree(), and cloudViewer::DistanceComputationTools::computeCloud2MeshDistanceWithOctree().

◆ getCellDistanceFromBorders() [1/2]

void DgmOctree::getCellDistanceFromBorders ( const Tuple3i cellPos,
unsigned char  level,
int *  cellDists 
) const

Returns distance form a cell to the filled octree borders in all directions. WARNING: distance values may be negative! (if cell is outside

Parameters
cellPoscell position
levellevel at which octree grid is considered
cellDistsoutput

Definition at line 781 of file DgmOctree.cpp.

References m_fillIndexes, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by getNeighborCellsAround(), and getPointsInNeighbourCellsAround().

◆ getCellDistanceFromBorders() [2/2]

void DgmOctree::getCellDistanceFromBorders ( const Tuple3i cellPos,
unsigned char  level,
int  neighbourhoodLength,
int *  cellDists 
) const

Returns distance from cell center to cell neighbourhood INSIDE filled octree WARNING: if cell neighbourhood is totally outside filled octree, the method returns false and cellDists is invalid.

Parameters
cellPoscenter cell position
levellevel at which octree grid is considered
neighbourhoodLengthcell neighbourhood "radius"
cellDistsoutput

Definition at line 795 of file DgmOctree.cpp.

References m_fillIndexes, and Tuple3Tpl< Type >::u.

◆ getCellIndex() [1/2]

unsigned DgmOctree::getCellIndex ( CellCode  truncatedCellCode,
unsigned char  bitDec 
) const
protected

Returns the index of a given cell represented by its code.

The index is found thanks to a binary search. The index of an existing cell is between 0 and the number of points projected in the octree minus 1. If the cell code cannot be found in the octree structure, then the method returns an index equal to the number of projected points (m_numberOfProjectedPoints).

Parameters
truncatedCellCodetruncated cell code (i.e. original cell code shifted of 'bitDec' bits)
bitDecbinary shift corresponding to the level of subdivision (see GET_BIT_SHIFT)
Returns
the index of the cell (or 'm_numberOfProjectedPoints' if none found)

Definition at line 559 of file DgmOctree.cpp.

References m_nearestPow2, m_numberOfProjectedPoints, and m_thePointsAndTheirCellCodes.

Referenced by findNearestNeighborsStartingFromCell(), findTheNearestNeighborStartingFromCell(), getNeighborCellsAround(), getPointsInBoxNeighbourhood(), getPointsInCell(), getPointsInCylindricalNeighbourhood(), getPointsInCylindricalNeighbourhoodProgressive(), getPointsInNeighbourCellsAround(), and getPointsInSphericalNeighbourhood().

◆ getCellIndex() [2/2]

unsigned DgmOctree::getCellIndex ( CellCode  truncatedCellCode,
unsigned char  bitDec,
unsigned  begin,
unsigned  end 
) const
protected

Returns the index of a given cell represented by its code.

Same algorithm as the other "getCellIndex" method, but in an optimized form. The binary search can be performed on a sub-part of the DgmOctree structure.

Parameters
truncatedCellCodetruncated cell code (i.e. original cell code shifted of 'bitDec' bits)
bitDecbinary shift corresponding to the level of subdivision (see GET_BIT_SHIFT)
beginfirst index of the sub-list in which to perform the binary search
endlast index of the sub-list in which to perform the binary search
Returns
the index of the cell (or 'm_numberOfProjectedPoints' if none found)

Definition at line 669 of file DgmOctree.cpp.

References count, INVALID_CELL_CODE, LOG_NAT_2, m_numberOfProjectedPoints, and m_thePointsAndTheirCellCodes.

◆ getCellIndexes()

bool DgmOctree::getCellIndexes ( unsigned char  level,
cellIndexesContainer vec 
) const

Returns the list of indexes corresponding to the octree cells for a given level of subdivision Only the non empty cells are represented in the octree structure. Cell indexes are expressed relatively to the DgmOctree structure. They correspond to the indexes of the first points of each cell.

Parameters
levelthe level of subdivision
vecthe list of indexes
Returns
false if an error occurred (e.g. not enough memory)

Definition at line 2850 of file DgmOctree.cpp.

References GET_BIT_SHIFT(), m_cellCount, m_numberOfProjectedPoints, and m_thePointsAndTheirCellCodes.

Referenced by cloudViewer::DistanceComputationTools::computeApproxCloud2CloudDistance().

◆ getCellNumber()

◆ getCellPos()

void DgmOctree::getCellPos ( CellCode  code,
unsigned char  level,
Tuple3i cellPos,
bool  isCodeTruncated 
) const

◆ getCellSize()

const PointCoordinateType& cloudViewer::DgmOctree::getCellSize ( unsigned char  level) const
inline

Returns the octree cells length for a given level of subdivision.

As the octree is cubical, cells are cubical.

Parameters
levelthe level of subdivision (up to MAX_OCTREE_LEVEL+1 for convenience)
Returns
the cell size

Definition at line 494 of file DgmOctree.h.

Referenced by cloudViewer::CloudSamplingTools::applyNoiseFilterAtLevel(), cloudViewer::DistanceComputationTools::computeApproxCloud2CloudDistance(), cloudViewer::DistanceComputationTools::computeCellHausdorffDistanceWithLocalModel(), computeCellLimits(), cloudViewer::DistanceComputationTools::computeCloud2MeshDistancesWithOctree(), cloudViewer::DistanceComputationTools::computeCloud2MeshDistanceWithOctree(), cloudViewer::GeometricalAnalysisTools::ComputeGeomCharacteristicAtLevel(), cloudViewer::ScalarFieldTools::computeMeanGradientOnPatch(), ComputeNeighborhood2MeshDistancesWithOctree(), cloudViewer::DistanceComputationTools::computePoint2MeshDistancesWithOctree(), cloudViewer::ScalarFieldTools::computeScalarFieldGradient(), ccPropertiesTreeDelegate::fillWithPointOctree(), findBestLevelForAGivenNeighbourhoodSizeExtraction(), findNearestNeighborsStartingFromCell(), findNeighborsInASphereStartingFromCell(), findTheNearestNeighborStartingFromCell(), cloudViewer::GeometricalAnalysisTools::FlagDuplicatePointsInACellAtLevel(), getPointsInBoxNeighbourhood(), getPointsInCylindricalNeighbourhood(), getPointsInCylindricalNeighbourhoodProgressive(), getPointsInSphericalNeighbourhood(), cloudViewer::FastMarching::initGridWithOctree(), cloudViewer::DistanceComputationTools::intersectMeshWithOctree(), and rayCast().

◆ getMaxFillIndexes()

const int* cloudViewer::DgmOctree::getMaxFillIndexes ( unsigned char  level) const
inline

Returns the highest cell positions in the octree along all dimensions and for a given level of subdivision For example, at a level n, the octree length is 2^n cells along each dimension. The highest cell position along each dimension will be expressed between 0 and 2^n-1.

Parameters
levelthe level of subdivision
Returns
the highest cell position along X,Y and Z for a given level of subdivision

Definition at line 485 of file DgmOctree.h.

Referenced by cloudViewer::DistanceComputationTools::computeApproxCloud2CloudDistance(), getPointsInBoxNeighbourhood(), getPointsInCylindricalNeighbourhood(), getPointsInCylindricalNeighbourhoodProgressive(), and cloudViewer::FastMarching::initGridWithOctree().

◆ getMinFillIndexes()

const int* cloudViewer::DgmOctree::getMinFillIndexes ( unsigned char  level) const
inline

Returns the lowest cell positions in the octree along all dimensions and for a given level of subdivision For example, at a level n, the octree length is 2^n cells along each dimension. The lowest cell position along each dimension will be expressed between 0 and 2^n-1.

Parameters
levelthe level of subdivision
Returns
the lowest cell position along X,Y and Z for a given level of subdivision

Definition at line 474 of file DgmOctree.h.

Referenced by cloudViewer::DistanceComputationTools::computeApproxCloud2CloudDistance(), getPointsInBoxNeighbourhood(), getPointsInCylindricalNeighbourhood(), getPointsInCylindricalNeighbourhoodProgressive(), and cloudViewer::FastMarching::initGridWithOctree().

◆ getNeighborCellsAround()

void DgmOctree::getNeighborCellsAround ( const Tuple3i cellPos,
cellIndexesContainer neighborCellsIndexes,
int  neighbourhoodLength,
unsigned char  level 
) const
protected

Returns the indexes of the neighbourhing (existing) cells of a given cell This function is used by the nearest neighbours search algorithms.

Parameters
cellPosthe query cell
neighborCellsIndexesthe found neighbourhing cells
neighbourhoodLengththe distance (in terms of cells) at which to look for neighbour cells
levelthe level of subdivision

Definition at line 825 of file DgmOctree.cpp.

References abs(), GenerateCellCodeForDim(), GET_BIT_SHIFT(), getCellDistanceFromBorders(), getCellIndex(), m_numberOfProjectedPoints, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by findTheNearestNeighborStartingFromCell().

◆ getNumberOfProjectedPoints()

unsigned cloudViewer::DgmOctree::getNumberOfProjectedPoints ( ) const
inline

Returns the number of points projected into the octree.

Returns
the number of projected points

Definition at line 446 of file DgmOctree.h.

Referenced by findBestLevelForComparisonWithOctree(), and cloudViewer::DistanceComputationTools::synchronizeOctrees().

◆ getOctreeMaxs()

const CCVector3& cloudViewer::DgmOctree::getOctreeMaxs ( ) const
inline

Returns the higher boundaries of the octree.

Returns
the higher coordinates along X,Y and Z

Definition at line 458 of file DgmOctree.h.

Referenced by cloudViewer::DistanceComputationTools::computeCloud2MeshDistances(), and cloudViewer::DistanceComputationTools::synchronizeOctrees().

◆ getOctreeMins()

const CCVector3& cloudViewer::DgmOctree::getOctreeMins ( ) const
inline

Returns the lower boundaries of the octree.

Returns
the lower coordinates along X,Y and Z

Definition at line 453 of file DgmOctree.h.

Referenced by cloudViewer::DistanceComputationTools::computeCloud2MeshDistances(), cloudViewer::DistanceComputationTools::intersectMeshWithOctree(), and cloudViewer::DistanceComputationTools::synchronizeOctrees().

◆ getPointsInBoxNeighbourhood()

std::size_t DgmOctree::getPointsInBoxNeighbourhood ( BoxNeighbourhood params) const

Returns the points falling inside a box.

Warning
the 'squareDistd' field of each neighbour in the NeighboursSet structure is not used/set
Returns
the number of extracted points

Definition at line 1951 of file DgmOctree.cpp.

References abs(), GenerateTruncatedCellCode(), GET_BIT_SHIFT(), getCellIndex(), getCellSize(), getMaxFillIndexes(), getMinFillIndexes(), cloudViewer::GenericIndexedCloud::getPoint(), getTheCellPosWhichIncludesThePoint(), m_dimMin, m_numberOfProjectedPoints, m_theAssociatedCloud, m_thePointsAndTheirCellCodes, params, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

◆ getPointsInCell()

bool DgmOctree::getPointsInCell ( CellCode  cellCode,
unsigned char  level,
ReferenceCloud subset,
bool  isCodeTruncated = false,
bool  clearOutputCloud = true 
) const

Returns the points lying in a specific cell.

Parameters
cellCodethe unique cell code
levelthe level of subdivision
[out]subsetset of points lying in the cell (references, no duplication)
isCodeTruncatedspecifies if the code is given in a truncated form or not
clearOutputCloudwhether to clear or not the output cloud (subest) if no points lie in the specified cell
Returns
success

Definition at line 537 of file DgmOctree.cpp.

References cloudViewer::ReferenceCloud::clear(), GET_BIT_SHIFT(), getCellIndex(), getPointsInCellByCellIndex(), and m_numberOfProjectedPoints.

Referenced by FastMarchingForFacetExtraction::addCellToCurrentFacet(), FastMarchingForFacetExtraction::computeTCoefApprox(), extractCCs(), cloudViewer::FastMarchingForPropagation::extractPropagatedPoints(), FastMarchingForFacetExtraction::init(), cloudViewer::FastMarchingForPropagation::init(), cloudViewer::FastMarchingForPropagation::setPropagationTimingsAsDistances(), and FastMarchingForFacetExtraction::updateFlagsTable().

◆ getPointsInCellByCellIndex()

bool DgmOctree::getPointsInCellByCellIndex ( ReferenceCloud cloud,
unsigned  cellIndex,
unsigned char  level,
bool  clearOutputCloud = true 
) const

Returns the points lying in a specific cell.

Each cell at a given level of subdivision can be recognized by the index in the DgmOctree structure of the first point that lies inside it. By construction, we are assured that every point lying in the same cell for a given level of subdivision are next to each others in the octree structure (which is the vector "m_thePointsAndTheirCellCodes" in practical). This is the quickest way to access the points inside a given cell (but its kind of hard to know directly what is the index of a given cell ;)

Parameters
cloudReferenceCloud to store the points lying inside the cell
cellIndexthe cell index
levelthe level of subdivision
clearOutputCloudwhether to clear the input cloud prior to inserting the points or not
Returns
success

Definition at line 2879 of file DgmOctree.cpp.

References cloudViewer::ReferenceCloud::addPointIndex(), cloudViewer::ReferenceCloud::clear(), GET_BIT_SHIFT(), cloudViewer::ReferenceCloud::getAssociatedCloud(), m_theAssociatedCloud, and m_thePointsAndTheirCellCodes.

Referenced by cloudViewer::DistanceComputationTools::computeApproxCloud2CloudDistance(), cloudViewer::DistanceComputationTools::computeCloud2MeshDistancesWithOctree(), cloudViewer::DistanceComputationTools::computeCloud2MeshDistanceWithOctree(), and getPointsInCell().

◆ getPointsInCellsWithSortedCellCodes()

ReferenceCloud * DgmOctree::getPointsInCellsWithSortedCellCodes ( cellCodesContainer cellCodes,
unsigned char  level,
ReferenceCloud subset,
bool  areCodesTruncated = false 
) const

Returns the points lying in multiple cells.

Cells are recognized here by their unique "code". They should be sorted along by codes, with an ascendant order. See DgmOctree::getPointsInCellByCellIndex for more information.

Parameters
cellCodesthe cells codes
levelthe level of subdivision
[out]subsetset of points lying in the cell (references, no duplication)
areCodesTruncatedspecifies if the codes are given in a truncated form or not
Returns
the set of points lying in the cell (references, no duplication)

Definition at line 2909 of file DgmOctree.cpp.

References cloudViewer::ReferenceCloud::addPointIndex(), cloudViewer::ReferenceCloud::clear(), GET_BIT_SHIFT(), m_numberOfProjectedPoints, and m_thePointsAndTheirCellCodes.

◆ getPointsInCylindricalNeighbourhood()

std::size_t DgmOctree::getPointsInCylindricalNeighbourhood ( CylindricalNeighbourhood params) const

Returns the points falling inside a cylinder.

Use findBestLevelForAGivenNeighbourhoodSizeExtraction to get the right value for 'level' (only once as it only depends on the radius value ;).

Warning
the 'squareDistd' field of each neighbour in the NeighboursSet structure is in fact the signed distance (not squared) of the point relatively to the cylinder's center and projected along its axis.
Parameters
paramsinput/output parameters structure
Returns
the number of extracted points

Definition at line 2111 of file DgmOctree.cpp.

References Vector3Tpl< Type >::dot(), dot(), GenerateTruncatedCellCode(), GET_BIT_SHIFT(), getCellIndex(), getCellSize(), getMaxFillIndexes(), getMinFillIndexes(), cloudViewer::GenericIndexedCloud::getPoint(), getTheCellPosWhichIncludesThePoint(), m_dimMin, m_numberOfProjectedPoints, m_theAssociatedCloud, m_thePointsAndTheirCellCodes, max(), min(), params, SQRT_3, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

◆ getPointsInCylindricalNeighbourhoodProgressive()

std::size_t DgmOctree::getPointsInCylindricalNeighbourhoodProgressive ( ProgressiveCylindricalNeighbourhood params) const

Same as getPointsInCylindricalNeighbourhood with progressive approach.

Can be called multiple times (the 'currentHalfLength' parameter will increase each time until 'maxHalfLength' is reached).

Definition at line 2264 of file DgmOctree.cpp.

References Vector3Tpl< Type >::dot(), dot(), GenerateTruncatedCellCode(), GET_BIT_SHIFT(), getCellIndex(), getCellSize(), getMaxFillIndexes(), getMinFillIndexes(), cloudViewer::GenericIndexedCloud::getPoint(), getTheCellPosWhichIncludesThePoint(), m_dimMin, m_numberOfProjectedPoints, m_theAssociatedCloud, m_thePointsAndTheirCellCodes, max(), min(), params, SQRT_3, std::swap(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

◆ getPointsInNeighbourCellsAround()

void DgmOctree::getPointsInNeighbourCellsAround ( NearestNeighboursSearchStruct nNSS,
int  neighbourhoodLength,
bool  getOnlyPointsWithValidScalar = false 
) const
protected

◆ getPointsInSphericalNeighbourhood()

int DgmOctree::getPointsInSphericalNeighbourhood ( const CCVector3 sphereCenter,
PointCoordinateType  radius,
NeighboursSet neighbours,
unsigned char  level 
) const

Returns the points falling inside a sphere.

Use findBestLevelForAGivenNeighbourhoodSizeExtraction to get the right value for 'level' (only once as it only depends on the radius value ;).

Parameters
sphereCentercenter
radiusradius
[out]neighbourspoints falling inside the sphere
levelsubdivision level at which to apply the extraction process
Returns
the number of extracted points

Definition at line 1846 of file DgmOctree.cpp.

References GenerateTruncatedCellCode(), GET_BIT_SHIFT(), getCellIndex(), getCellSize(), cloudViewer::GenericIndexedCloud::getPoint(), getTheCellPosWhichIncludesThePoint(), m_dimMin, m_numberOfProjectedPoints, m_theAssociatedCloud, m_thePointsAndTheirCellCodes, OCTREE_LENGTH(), SQRT_3, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by RefinePointClassif(), cloudViewer::CloudSamplingTools::resampleCloudSpatially(), and qCanupoTools::TrainClassifier().

◆ getTheCellPosWhichIncludesThePoint() [1/3]

void cloudViewer::DgmOctree::getTheCellPosWhichIncludesThePoint ( const CCVector3 thePoint,
Tuple3i cellPos 
) const
inline

◆ getTheCellPosWhichIncludesThePoint() [2/3]

void cloudViewer::DgmOctree::getTheCellPosWhichIncludesThePoint ( const CCVector3 thePoint,
Tuple3i cellPos,
unsigned char  level 
) const
inline

Returns the position for a given level of subdivision of the cell that includes a given point The cell coordinates can be negative or greater than 2^N-1 (where N is the level of subdivision) as the point can lie outside the octree bounding-box.

Parameters
thePointthe query point
cellPosthe computed position
levelthe level of subdivision

Definition at line 798 of file DgmOctree.h.

References Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

◆ getTheCellPosWhichIncludesThePoint() [3/3]

void cloudViewer::DgmOctree::getTheCellPosWhichIncludesThePoint ( const CCVector3 thePoint,
Tuple3i cellPos,
unsigned char  level,
bool &  inBounds 
) const
inline

Returns the position for a given level of subdivision of the cell that includes a given point The cell coordinates can be negative or greater than 2^N-1 (where N is the level of subdivision) as the point can lie outside the octree bounding-box. In this version, method indicates if the query point is inside ("inbounds") or outside the octree bounding-box.

Parameters
thePointthe query point
cellPosthe computed position
levelthe level of subdivision
inBoundsindicates if the query point is inside or outside the octree bounding-box

Definition at line 823 of file DgmOctree.h.

References Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

◆ MultiThreadSupport()

bool DgmOctree::MultiThreadSupport ( )
static

Returns whether multi-threading (parallel) computation is supported or not

Definition at line 162 of file DgmOctree.cpp.

◆ OCTREE_LENGTH()

int DgmOctree::OCTREE_LENGTH ( int  level)
static

Returns the octree length (in term of cells) for a given level of subdivision

Parameters
levelthe level of subdivision
Returns
2^level

Definition at line 118 of file DgmOctree.cpp.

Referenced by cloudViewer::AutoSegmentationTools::frontPropagationBasedSegmentation(), and getPointsInSphericalNeighbourhood().

◆ pointsAndTheirCellCodes()

const cellsContainer& cloudViewer::DgmOctree::pointsAndTheirCellCodes ( ) const
inline

Returns the octree 'structure'.

Definition at line 1196 of file DgmOctree.h.

◆ rayCast()

◆ updateCellCountTable()

void DgmOctree::updateCellCountTable ( )
protected

Updates the tables containing the number of octree cells for each level of subdivision

Definition at line 416 of file DgmOctree.cpp.

References computeCellsStatistics(), and MAX_OCTREE_LEVEL.

Referenced by clear(), and genericBuild().

◆ updateCellSizeTable()

void DgmOctree::updateCellSizeTable ( )
protected

Updates the tables containing the octree cells length for each level of subdivision

Definition at line 405 of file DgmOctree.cpp.

References m_cellSize, m_dimMax, m_dimMin, MAX_OCTREE_LEVEL, and Tuple3Tpl< Type >::x.

Referenced by genericBuild().

◆ updateMinAndMaxTables()

void DgmOctree::updateMinAndMaxTables ( )
protected

Updates the tables containing octree limits and boundaries.

Definition at line 395 of file DgmOctree.cpp.

References cloudViewer::GenericCloud::getBoundingBox(), m_dimMax, m_dimMin, m_pointsMax, m_pointsMin, m_theAssociatedCloud, and cloudViewer::CCMiscTools::MakeMinAndMaxCubical().

Referenced by build().

Member Data Documentation

◆ INVALID_CELL_CODE

const CellCode cloudViewer::DgmOctree::INVALID_CELL_CODE = (~static_cast<CellCode>(0))
static

Invalid cell code.

Warning
Never pass a 'constant initializer' by reference

Definition at line 89 of file DgmOctree.h.

Referenced by findNearestNeighborsStartingFromCell(), findTheNearestNeighborStartingFromCell(), getCellIndex(), and rayCast().

◆ m_averageCellPopulation

double cloudViewer::DgmOctree::m_averageCellPopulation[MAX_OCTREE_LEVEL+1]
protected

◆ m_cellCount

unsigned cloudViewer::DgmOctree::m_cellCount[MAX_OCTREE_LEVEL+1]
protected

Number of cells per level of subdivision.

Definition at line 1260 of file DgmOctree.h.

Referenced by computeCellsStatistics(), and getCellIndexes().

◆ m_cellSize

PointCoordinateType cloudViewer::DgmOctree::m_cellSize[MAX_OCTREE_LEVEL+2]
protected

Cell dimensions for all subdivision levels.

Definition at line 1255 of file DgmOctree.h.

Referenced by clear(), and updateCellSizeTable().

◆ m_dimMax

CCVector3 cloudViewer::DgmOctree::m_dimMax
protected

Max coordinates of the octree bounding-box.

Definition at line 1245 of file DgmOctree.h.

Referenced by build(), clear(), getBoundingBox(), rayCast(), updateCellSizeTable(), and updateMinAndMaxTables().

◆ m_dimMin

◆ m_fillIndexes

int cloudViewer::DgmOctree::m_fillIndexes[(MAX_OCTREE_LEVEL+1) *6]
protected

Min and max occupied cells indexes, for all dimensions and every subdivision level

Definition at line 1258 of file DgmOctree.h.

Referenced by clear(), findNearestNeighborsStartingFromCell(), findTheNearestNeighborStartingFromCell(), genericBuild(), and getCellDistanceFromBorders().

◆ m_maxCellPopulation

unsigned cloudViewer::DgmOctree::m_maxCellPopulation[MAX_OCTREE_LEVEL+1]
protected

Max cell population per level of subdivision.

Definition at line 1262 of file DgmOctree.h.

Referenced by computeCellsStatistics(), executeFunctionForAllCellsAtLevel(), and executeFunctionForAllCellsStartingAtLevel().

◆ m_nearestPow2

unsigned cloudViewer::DgmOctree::m_nearestPow2
protected

Nearest power of 2 less than the number of points (used for binary search)

Definition at line 1240 of file DgmOctree.h.

Referenced by clear(), genericBuild(), and getCellIndex().

◆ m_numberOfProjectedPoints

◆ m_pointsMax

CCVector3 cloudViewer::DgmOctree::m_pointsMax
protected

Max coordinates of the bounding-box of the set of points projected in the octree

Definition at line 1252 of file DgmOctree.h.

Referenced by build(), clear(), genericBuild(), and updateMinAndMaxTables().

◆ m_pointsMin

CCVector3 cloudViewer::DgmOctree::m_pointsMin
protected

Min coordinates of the bounding-box of the set of points projected in the octree

Definition at line 1249 of file DgmOctree.h.

Referenced by build(), clear(), genericBuild(), and updateMinAndMaxTables().

◆ m_stdDevCellPopulation

double cloudViewer::DgmOctree::m_stdDevCellPopulation[MAX_OCTREE_LEVEL+1]
protected

Std. dev. of cell population per level of subdivision.

Definition at line 1266 of file DgmOctree.h.

Referenced by computeCellsStatistics(), executeFunctionForAllCellsAtLevel(), and executeFunctionForAllCellsStartingAtLevel().

◆ m_theAssociatedCloud

◆ m_thePointsAndTheirCellCodes

◆ MAX_OCTREE_LENGTH

const int cloudViewer::DgmOctree::MAX_OCTREE_LENGTH = (1 << MAX_OCTREE_LEVEL)
static

Max octree length at last level of subdivision (number of cells)

Warning
Never pass a 'constant initializer' by reference

Definition at line 84 of file DgmOctree.h.

Referenced by genericBuild().

◆ MAX_OCTREE_LEVEL

const int cloudViewer::DgmOctree::MAX_OCTREE_LEVEL = 10
static

Max octree subdivision level.

STRUCTURES
Number of bits used to code the cells position: 3*MAX_OCTREE_LEVEL

Warning
Never pass a 'constant initializer' by reference

Definition at line 67 of file DgmOctree.h.

Referenced by FastMarchingForFacetExtraction::addCellToCurrentFacet(), BitShiftValues::BitShiftValues(), ccComparisonDlg::ccComparisonDlg(), ccComputeOctreeDlg::ccComputeOctreeDlg(), ccLabelingDlg::ccLabelingDlg(), ccAlignDlg::changeSamplingMethod(), ccSubsamplingDlg::changeSamplingMethod(), clear(), cloudViewer::DistanceComputationTools::computeApproxCloud2CloudDistance(), computeCellsStatistics(), ccComparisonDlg::computeDistances(), ComputeMathOpWithNearestNeighbor(), ccEntityAction::computeOctree(), ccPropertiesTreeDelegate::createEditor(), ccComparisonDlg::determineBestOctreeLevel(), cloudViewer::DistanceComputationTools::diff(), executeFunctionForAllCellsStartingAtLevel(), cloudViewer::FastMarchingForPropagation::extractPropagatedPoints(), ccPropertiesTreeDelegate::fillWithPointOctree(), findBestLevelForAGivenCellNumber(), findBestLevelForAGivenNeighbourhoodSizeExtraction(), findBestLevelForAGivenPopulationPerCell(), findBestLevelForComparisonWithOctree(), GenerateTruncatedCellCode(), genericBuild(), qM3C2Tools::GuessBestParams(), cloudViewer::FastMarching::initGridWithOctree(), MonoDimensionalCellCodes::MonoDimensionalCellCodes(), ccEntityAction::orientNormalsFM(), masc::ContextBasedFeature::prepare(), CommandSubsample::process(), CommandExtractCCs::process(), cloudViewer::FastMarchingForPropagation::setPropagationTimingsAsDistances(), updateCellCountTable(), and updateCellSizeTable().


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