Skip to content

IncrementalOctreePointLocator ​

Introduction ​

vtkIncrementalOctreePointLocator

Methods ​

extend ​

Method use to decorate a given object (publicAPI+model) with vtkIncrementalOctreePointLocator characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesobjectNo(default: {})

findClosestPointInLeafNode ​

Given a leaf node, find the closest point it stores to the given point.

ArgumentTypeRequiredDescription
leafNodevtkIncrementalOctreeNodeYes
pointVector3Yes

Returns ​

TypeDescription
PointIdAndDistance2

findClosestPointInSphere ​

Find the closest point within a squared radius of the given point, skipping maskNode. refDist2 bounds the sub-trees that are worth descending into.

ArgumentTypeRequiredDescription
pointVector3Yes
radius2NumberYesthe squared search radius
maskNodevtkIncrementalOctreeNodeYesa node to exclude from the search
minDist2NumberYesthe initial upper bound on the squared distance; the search stops descending once it cannot improve on it
refDist2NumberYes

Returns ​

TypeDescription
PointIdAndDistance2

findClosestPointInSphereWithTolerance ​

Same as findClosestPointInSphere, using the octree extent as the reference distance.

ArgumentTypeRequiredDescription
pointVector3Yes
radius2NumberYesthe squared search radius
maskNodevtkIncrementalOctreeNodeYesa node to exclude from the search

Returns ​

TypeDescription
PointIdAndDistance2

findDuplicateDoubleTypePointInVisitedLeafNode ​

Find, in a leaf node, a point with exactly the same coordinates as the given one, reading the locator points as 64-bit floats.

ArgumentTypeRequiredDescription
leafNodevtkIncrementalOctreeNodeYes
pointVector3Yes

Returns ​

TypeDescription
Numberthe point index, or -1 when there is no duplicate

findDuplicateFloatTypePointInVisitedLeafNode ​

Find, in a leaf node, a point with exactly the same coordinates as the given one, reading the locator points as 32-bit floats.

ArgumentTypeRequiredDescription
leafNodevtkIncrementalOctreeNodeYes
pointVector3Yes

Returns ​

TypeDescription
Numberthe point index, or -1 when there is no duplicate

findDuplicatePointInLeafNode ​

Find, in a leaf node, a point with exactly the same coordinates as the given one, dispatching on the data type of the locator points.

ArgumentTypeRequiredDescription
leafNodevtkIncrementalOctreeNodeYes
pointVector3Yes

Returns ​

TypeDescription
Numberthe point index, or -1 when there is no duplicate

freeSearchStructure ​

Delete the octree search structure and release the points being located.

getBuildCubicOctree ​

Get whether the octree root is inflated to a cube so that every octant is a cube too.

getFudgeFactor ​

Get the padding applied to the lower bounds of the octree root.

getInsertTolerance2 ​

Get the squared insertion tolerance, i.e. the square of the tolerance.

getLocatorPoints ​

Get the points into which insertion writes.

getMaxPointsPerLeaf ​

Get the maximum number of points a leaf node may hold before it is sub-divided.

getNumberOfNodes ​

Get the number of nodes currently in the octree.

getOctreeMaxDimSize ​

Get the largest side length of the octree root node.

getOctreeRootNode ​

Get the root node of the octree.

initPointInsertion ​

Initialize the octree with an empty root node covering the given bounds and take ownership of the points object used for insertion.

ArgumentTypeRequiredDescription
pointsvtkPointsYes
boundsBoundsYes
estNumPtsNumberNo(default: 0)

Returns ​

TypeDescription
Booleanfalse when no valid points object was given

insertNextPoint ​

Append a point, without checking for duplicates. initPointInsertion must have been called first.

ArgumentTypeRequiredDescription
xVector3Yes

Returns ​

TypeDescription
Numberthe index of the inserted point

insertPoint ​

Insert a point at the given index, without checking for duplicates. initPointInsertion must have been called first.

ArgumentTypeRequiredDescription
ptIdNumberYes
xVector3Yes

insertUniquePoint ​

Insert a point only if no point already lies within the insertion tolerance of it.

ArgumentTypeRequiredDescription
pointVector3Yes

Returns ​

TypeDescription
IInsertUniquePointResultsuccess is false when a point was already there, in which case idx is that existing point's index

isInsertedPoint ​

Determine whether a point is already present, dispatching on whether the insertion tolerance is zero.

ArgumentTypeRequiredDescription
xVector3Yes

Returns ​

TypeDescription
IInsertedPointResult

isInsertedPointForNonZeroTolerance ​

Determine whether a point lies within the insertion tolerance of an already inserted point.

ArgumentTypeRequiredDescription
xVector3Yes

Returns ​

TypeDescription
IInsertedPointResult

isInsertedPointForZeroTolerance ​

Determine whether a point with exactly these coordinates is already present in the leaf node that contains it.

ArgumentTypeRequiredDescription
xVector3Yes

Returns ​

TypeDescription
IInsertedPointResult

newInstance ​

Method use to create a new instance of vtkIncrementalOctreePointLocator

ArgumentTypeRequiredDescription
initialValuesIIncrementalOctreePointLocatorInitialValuesNofor pre-setting some of its content

setBuildCubicOctree ​

Set whether the octree root is inflated to a cube so that every octant is a cube too. Must be set before initPointInsertion.

ArgumentTypeRequiredDescription
buildCubicOctreeBooleanYes

setFudgeFactor ​

Set the padding applied to the lower bounds of the octree root.

ArgumentTypeRequiredDescription
fudgeFactorNumberYes

setInsertTolerance2 ​

Set the squared insertion tolerance. initPointInsertion recomputes it from the locator tolerance.

ArgumentTypeRequiredDescription
insertTolerance2NumberYes

setLocatorPoints ​

Set the points into which insertion writes.

ArgumentTypeRequiredDescription
locatorPointsvtkPointsYes

setMaxPointsPerLeaf ​

Set the maximum number of points a leaf node may hold before it is sub-divided.

ArgumentTypeRequiredDescription
maxPointsPerLeafNumberYes

setNumberOfNodes ​

Set the number of nodes in the octree.

ArgumentTypeRequiredDescription
numberOfNodesNumberYes

setOctreeMaxDimSize ​

Set the largest side length of the octree root node.

ArgumentTypeRequiredDescription
octreeMaxDimSizeNumberYes

setOctreeRootNode ​

Set the root node of the octree.

ArgumentTypeRequiredDescription
octreeRootNodevtkIncrementalOctreeNodeYes