CCCoreLib 31 May 2022
CloudCompare Core algorithms
|
Container of in/out parameters for nearest neighbour(s) search. More...
#include <DgmOctree.h>
Public Member Functions | |
NearestNeighboursSearchStruct () | |
Default constructor. | |
Public Attributes | |
CCVector3 | queryPoint |
Query point. More... | |
unsigned char | level |
Level of subdivision of the octree at which to start the search. More... | |
unsigned | minNumberOfNeighbors |
Minimal number of neighbours to find. More... | |
Tuple3i | cellPos |
Position in the octree of the cell including the query point. More... | |
CCVector3 | cellCenter |
Coordinates of the center of the cell including the query point. More... | |
double | maxSearchSquareDistd |
Maximum neihgbours distance. More... | |
cellIndexesContainer | minimalCellsSetToVisit |
List of indexes of the cells that have been already visited by the algorithm. More... | |
NeighboursSet | pointsInNeighbourhood |
All the points that belong to the cubical neighbourhood of the current cell. More... | |
int | alreadyVisitedNeighbourhoodSize |
Size of the cell neighbourhood that has been already visited by the algorithm. More... | |
unsigned | theNearestPointIndex |
The nearest point. More... | |
Container of in/out parameters for nearest neighbour(s) search.
This structure is generic and can be used in multiple cases. It is particularly useful when searching nearest neighbours around points that lie in the same octree cell. In this case, several informations about this cell should be given to the search algorithm through this structure, but only once,before the first search. Then the search algorithm can be called multiple times, and only few informations need to be updated (the query point, etc.).
int CCCoreLib::DgmOctree::NearestNeighboursSearchStruct::alreadyVisitedNeighbourhoodSize |
Size of the cell neighbourhood that has been already visited by the algorithm.
This field is updated by the search algorithm. It should only be reset to 0 when the cell that includes the query point changes. A value of 0 means that no cell has been visited yet, 1 means that only the cell that includes the query point has been visited, 2 means that this cell and its 27 neighbourhing cells have been visited, etc.
CCVector3 CCCoreLib::DgmOctree::NearestNeighboursSearchStruct::cellCenter |
Coordinates of the center of the cell including the query point.
Use DgmOctree::computeCellCenter to determine these coordinates. This information should only be updated if the cell changes.
Tuple3i CCCoreLib::DgmOctree::NearestNeighboursSearchStruct::cellPos |
Position in the octree of the cell including the query point.
The position is expressed for the level of subdivision at which the search will be processed. Use see DgmOctree::getCellPos to determine this position. This information should only be updated if the cell changes.
unsigned char CCCoreLib::DgmOctree::NearestNeighboursSearchStruct::level |
Level of subdivision of the octree at which to start the search.
Should be set once and for all.
double CCCoreLib::DgmOctree::NearestNeighboursSearchStruct::maxSearchSquareDistd |
Maximum neihgbours distance.
The NN search process will stop if it reaches this radius even if it hasn't find any neighbour (acceleration). To disable this behavior, set the maxSearchSquareDistd to something <= 0).
cellIndexesContainer CCCoreLib::DgmOctree::NearestNeighboursSearchStruct::minimalCellsSetToVisit |
List of indexes of the cells that have been already visited by the algorithm.
This field is updated by the search algorithm. It should only be emptied if the cell that includes the query points change. Only used by the "unique nearest point" search algorithm.
unsigned CCCoreLib::DgmOctree::NearestNeighboursSearchStruct::minNumberOfNeighbors |
Minimal number of neighbours to find.
used only during multiple neighbours search (see findNearestNeighborsStartingFromCell). This is only indicative and not guaranteed.
NeighboursSet CCCoreLib::DgmOctree::NearestNeighboursSearchStruct::pointsInNeighbourhood |
All the points that belong to the cubical neighbourhood of the current cell.
This structure is only used by the "multiple nearest neighbours" search algorithms. The nearest points (relatively to the query point) are stored at the beginning of the vector. They are associated to their square distance to the query point.
CCVector3 CCCoreLib::DgmOctree::NearestNeighboursSearchStruct::queryPoint |
Query point.
Should be updated each time.
unsigned CCCoreLib::DgmOctree::NearestNeighboursSearchStruct::theNearestPointIndex |
The nearest point.
This field is only used by the "unique nearest neighbour" search algorithm (see DgmOctree::findTheNearestNeighborStartingFromCell).