IncrementalOctreeNode
Introduction
vtkIncrementalOctreeNode
Methods
containsDuplicatePointsOnly
Given a point, determine whether (true) or not (false) it is an exact duplicate of all the points, if any, maintained in this node. In other words, to check if this given point and all existing points, if any, of this node are exactly duplicate with one another.
| Argument | Type | Required | Description |
|---|---|---|---|
point | Vector3 | Yes |
containsPoint
| Argument | Type | Required | Description |
|---|---|---|---|
point | Vector3 | Yes |
containsPointByData
| Argument | Type | Required | Description |
|---|---|---|---|
point | Vector3 | Yes |
createChildNodes
Divide this LEAF node into eight child nodes as the number of points maintained by this leaf node has reached the threshold maxPts while another point newPnt is just going to be inserted to it. The available point-indices pntIds are distributed to the child nodes based on the point coordinates (available through points). Note that this function can incur recursive node-division to determine the specific leaf node for accepting the new point (with pntIdx storing the index in points) because the existing maxPts points may fall within only one of the eight child nodes to make a radically imbalanced layout within the node (to be divided). Argument ptMode specifies whether the point is not inserted at all but instead only the point index is provided upon 0, the point is inserted via vtkPoints.InsertPoint() upon 1, or the point is inserted by vtkPoints.InsertNextPoint() upon 2. The returned value of this function indicates whether pntIds needs to be destroyed (1) or just unregistered from this node as it has been attached to another node (0). numberOfNodes in the tree is updated with new created nodes
| Argument | Type | Required | Description |
|---|---|---|---|
points | vtkPoints | Yes | |
pntIds | Array[Number] | Yes | |
newPnt | Vector3 | Yes | |
pntIdx | Number | Yes | |
maxPts | Number | Yes | |
ptMode | Number | Yes | |
numberOfNodes | Number | Yes |
createPointIdSet
Create a list object for storing point indices.
extend
Method use to decorate a given object (publicAPI+model) with vtkIncrementalOctreeNode 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: {}) |
getBounds
Get the spatial bounding box of the node. The values are returned via an array in order of: x_min, x_max, y_min, y_max, z_min, z_max.
| Argument | Type | Required | Description |
|---|---|---|---|
bounds | Bounds | Yes |
getChild
Get the child at the given index i. i must be an int between 0 and 7.
| Argument | Type | Required | Description |
|---|---|---|---|
i | Number | Yes |
getChildIndex
| Argument | Type | Required | Description |
|---|---|---|---|
point | Vector3 | Yes |
getDistance2ToBoundary
Compute the minimum squared distance from a point to this node, with all six boundaries considered. The data bounding box is checked if checkData is non-zero. The closest on-boundary point is returned via closest.
| Argument | Type | Required | Description |
|---|---|---|---|
point | Vector3 | Yes | |
closest | Vector3 | Yes | |
innerOnly | Boolean | Yes | |
rootNode | vtkIncrementalOctreeNode | Yes | |
checkData | Boolean | Yes |
Returns
| Type | Description |
|---|---|
| Number |
getDistance2ToInnerBoundary
Given a point inside this node, get the minimum squared distance to all inner boundaries. An inner boundary is a node's face that is shared by another non-root node.
| Argument | Type | Required | Description |
|---|---|---|---|
point | Vector3 | Yes | |
rootNode | vtkIncrementalOctreeNode | Yes |
insertPoint
This function is called after a successful point-insertion check and only applies to a leaf node. Prior to a call to this function, the octree should have been retrieved top-down to find the specific leaf node in which this new point (newPt) will be inserted. The actual index of the new point (to be inserted to points) is stored in pntId. Argument ptMode specifies whether the point is not inserted at all but instead only the point index is provided upon 0, the point is inserted via vtkPoints. insertPoint() upon 1, or it is inserted via vtkPoints.insertNextPoint() upon 2. For case 0, pntId needs to be specified. For cases 1 and 2, the actual point index is returned via pntId. Note that this function always returns 1 to indicate the success of point insertion. numberOfNodes is the number of nodes present in the tree at this time. it is used to assign an ID to each node which can be used to associate application specific information with each node. It is updated if new nodes are added to the tree.
| Argument | Type | Required | Description |
|---|---|---|---|
points | Number | Yes | |
newPnt | Number | Yes | |
maxPts | Number | Yes | |
pntId | Number | Yes | |
ptMode | Number | Yes | |
numberOfNodes | Number | Yes |
isLeaf
Determine whether or not this node is a leaf.
newInstance
Method use to create a new instance of vtkIncrementalOctreeNode
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IIncrementalOctreeNodeInitialValues | No | for pre-setting some of its content |
separateExactlyDuplicatePointsFromNewInsertion
Given a number (>= threshold) of all exactly duplicate points (accessible via points and pntIds, but with exactly the same 3D coordinate) maintained in this leaf node and a point (absolutely not a duplicate any more, with pntIdx storing the index in points)) to be inserted to this node, separate all the duplicate points from this new point by means of usually recursive node sub-division such that the former points are inserted to a descendant leaf while the new point is inserted to a sibling of this descendant leaf. Argument ptMode specifies whether the point is not inserted at all but only the point index is provided upon 0, the point is inserted via vtkPoints:: InsertPoint() upon 1, or this point is instead inserted through vtkPoints:: InsertNextPoint() upon 2.
| Argument | Type | Required | Description |
|---|---|---|---|
points | vtkPoints | Yes | |
pntIds | Array[Number] | Yes | |
newPnt | Vector3 | Yes | |
pntIdx | Number | Yes | |
maxPts | Number | Yes | |
ptMode | Number | Yes |
setBounds
Set the spatial bounding box of the node. This function sets a default data bounding box.
| Argument | Type | Required | Description |
|---|---|---|---|
x1 | Number | Yes | |
x2 | Number | Yes | |
y1 | Number | Yes | |
y2 | Number | Yes | |
z1 | Number | Yes | |
z2 | Number | Yes |
updateCounterAndDataBounds
Given a point inserted to either this node (a leaf node) or a descendant leaf (of this node --- when this node is a non-leaf node), update the counter and the data bounding box for this node only. The data bounding box is considered only if updateData is non-zero. The returned value indicates whether (1) or not (0) the data bounding box is actually updated. Note that argument nHits must be 1 unless this node is updated with a number (nHits) of exactly duplicate points as a whole via a single call to this function.
| Argument | Type | Required | Description |
|---|---|---|---|
point | Vector3 | Yes | |
nHits | Number | Yes | |
updateData | Boolean | Yes |
updateCounterAndDataBoundsRecursively
Given a point inserted to either this node (a leaf node) or a descendant leaf (of this node --- when this node is a non-leaf node), update the counter and the data bounding box recursively bottom-up until a specified node. The data bounding box is considered only if updateData is non-zero. The returned value indicates whether (true) or not (false) the data bounding box is actually updated. Note that argument nHits must be 1 unless this node is updated with a number (nHits) of exactly duplicate points as a whole via a single call to this function.
| Argument | Type | Required | Description |
|---|---|---|---|
point | Vector3 | Yes | |
nHits | Number | Yes | |
updateData | Boolean | Yes | |
endNode | vtkIncrementalOctreeNode | Yes |