IncrementalOctreePointLocator
Introduction
vtkIncrementalOctreePointLocator
Methods
extend
Method use to decorate a given object (publicAPI+model) with vtkIncrementalOctreePointLocator characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | object | No | (default: {}) |
findClosestPointInLeafNode
Given a leaf node, find the closest point it stores to the given point.
| Argument | Type | Required | Description |
|---|---|---|---|
leafNode | vtkIncrementalOctreeNode | Yes | |
point | Vector3 | Yes |
Returns
| Type | Description |
|---|---|
| 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.
| Argument | Type | Required | Description |
|---|---|---|---|
point | Vector3 | Yes | |
radius2 | Number | Yes | the squared search radius |
maskNode | vtkIncrementalOctreeNode | Yes | a node to exclude from the search |
minDist2 | Number | Yes | the initial upper bound on the squared distance; the search stops descending once it cannot improve on it |
refDist2 | Number | Yes |
Returns
| Type | Description |
|---|---|
| PointIdAndDistance2 |
findClosestPointInSphereWithTolerance
Same as findClosestPointInSphere, using the octree extent as the reference distance.
| Argument | Type | Required | Description |
|---|---|---|---|
point | Vector3 | Yes | |
radius2 | Number | Yes | the squared search radius |
maskNode | vtkIncrementalOctreeNode | Yes | a node to exclude from the search |
Returns
| Type | Description |
|---|---|
| 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.
| Argument | Type | Required | Description |
|---|---|---|---|
leafNode | vtkIncrementalOctreeNode | Yes | |
point | Vector3 | Yes |
Returns
| Type | Description |
|---|---|
| Number | the 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.
| Argument | Type | Required | Description |
|---|---|---|---|
leafNode | vtkIncrementalOctreeNode | Yes | |
point | Vector3 | Yes |
Returns
| Type | Description |
|---|---|
| Number | the 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.
| Argument | Type | Required | Description |
|---|---|---|---|
leafNode | vtkIncrementalOctreeNode | Yes | |
point | Vector3 | Yes |
Returns
| Type | Description |
|---|---|
| Number | the 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.
| Argument | Type | Required | Description |
|---|---|---|---|
points | vtkPoints | Yes | |
bounds | Bounds | Yes | |
estNumPts | Number | No | (default: 0) |
Returns
| Type | Description |
|---|---|
| Boolean | false when no valid points object was given |
insertNextPoint
Append a point, without checking for duplicates. initPointInsertion must have been called first.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Vector3 | Yes |
Returns
| Type | Description |
|---|---|
| Number | the index of the inserted point |
insertPoint
Insert a point at the given index, without checking for duplicates. initPointInsertion must have been called first.
| Argument | Type | Required | Description |
|---|---|---|---|
ptId | Number | Yes | |
x | Vector3 | Yes |
insertUniquePoint
Insert a point only if no point already lies within the insertion tolerance of it.
| Argument | Type | Required | Description |
|---|---|---|---|
point | Vector3 | Yes |
Returns
| Type | Description |
|---|---|
| IInsertUniquePointResult | success 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.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Vector3 | Yes |
Returns
| Type | Description |
|---|---|
| IInsertedPointResult |
isInsertedPointForNonZeroTolerance
Determine whether a point lies within the insertion tolerance of an already inserted point.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Vector3 | Yes |
Returns
| Type | Description |
|---|---|
| IInsertedPointResult |
isInsertedPointForZeroTolerance
Determine whether a point with exactly these coordinates is already present in the leaf node that contains it.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Vector3 | Yes |
Returns
| Type | Description |
|---|---|
| IInsertedPointResult |
newInstance
Method use to create a new instance of vtkIncrementalOctreePointLocator
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IIncrementalOctreePointLocatorInitialValues | No | for 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.
| Argument | Type | Required | Description |
|---|---|---|---|
buildCubicOctree | Boolean | Yes |
setFudgeFactor
Set the padding applied to the lower bounds of the octree root.
| Argument | Type | Required | Description |
|---|---|---|---|
fudgeFactor | Number | Yes |
setInsertTolerance2
Set the squared insertion tolerance. initPointInsertion recomputes it from the locator tolerance.
| Argument | Type | Required | Description |
|---|---|---|---|
insertTolerance2 | Number | Yes |
setLocatorPoints
Set the points into which insertion writes.
| Argument | Type | Required | Description |
|---|---|---|---|
locatorPoints | vtkPoints | Yes |
setMaxPointsPerLeaf
Set the maximum number of points a leaf node may hold before it is sub-divided.
| Argument | Type | Required | Description |
|---|---|---|---|
maxPointsPerLeaf | Number | Yes |
setNumberOfNodes
Set the number of nodes in the octree.
| Argument | Type | Required | Description |
|---|---|---|---|
numberOfNodes | Number | Yes |
setOctreeMaxDimSize
Set the largest side length of the octree root node.
| Argument | Type | Required | Description |
|---|---|---|---|
octreeMaxDimSize | Number | Yes |
setOctreeRootNode
Set the root node of the octree.
| Argument | Type | Required | Description |
|---|---|---|---|
octreeRootNode | vtkIncrementalOctreeNode | Yes |