-
-
Notifications
You must be signed in to change notification settings - Fork 416
Expand file tree
/
Copy pathindex.d.ts
More file actions
297 lines (275 loc) · 9.96 KB
/
index.d.ts
File metadata and controls
297 lines (275 loc) · 9.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
import { vtkObject } from '../../../interfaces';
import { Bounds, Vector3 } from '../../../types';
import vtkPoints from '../../Core/Points';
/**
*
*/
export interface IIncrementalOctreeNodeInitialValues {
pointIdSet?: number[];
minBounds?: Bounds;
maxBounds?: Bounds;
minDataBounds?: Bounds;
maxDataBounds?: Bounds;
parent?: vtkIncrementalOctreeNode;
children?: vtkIncrementalOctreeNode[];
}
export interface vtkIncrementalOctreeNode extends vtkObject {
/**
* Create a list object for storing point indices.
*/
createPointIdSet(): void;
/**
* Set the spatial bounding box of the node. This function sets a default
* data bounding box.
*
* @param {Number} x1
* @param {Number} x2
* @param {Number} y1
* @param {Number} y2
* @param {Number} z1
* @param {Number} z2
*/
setBounds(
x1: number,
x2: number,
y1: number,
y2: number,
z1: number,
z2: number
): void;
/**
* 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.
*
* @param {Bounds} bounds
*/
getBounds(bounds: Bounds): void;
/**
* @param {Vector3} point
*/
getChildIndex(point: Vector3): number;
/**
* @param {Vector3} point
*/
containsPoint(point: Vector3): boolean;
/**
* @param {Vector3} point
*/
containsPointByData(point: Vector3): boolean;
/**
* 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.
*
* @param {Vector3} point
* @param {Number} nHits
* @param {Boolean} updateData
*/
updateCounterAndDataBounds(
point: Vector3,
nHits: number,
updateData: boolean
): boolean;
/**
* 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.
*
* @param {Vector3} point
* @param {Number} nHits
* @param {Boolean} updateData
* @param {vtkIncrementalOctreeNode} endNode
*/
updateCounterAndDataBoundsRecursively(
point: Vector3,
nHits: number,
updateData: boolean,
endNode: vtkIncrementalOctreeNode
): boolean;
/**
* 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.
*
* @param {Vector3} point
*/
containsDuplicatePointsOnly(point: Vector3): boolean;
/**
* Determine whether or not this node is a leaf.
*/
isLeaf(): boolean;
/**
* Get the child at the given index i.
* i must be an int between 0 and 7.
*
* @param {Number} i
*/
getChild(i: number): vtkIncrementalOctreeNode;
/**
* 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.
*
* @param {vtkPoints} points
* @param {Number[]} pntIds
* @param {Vector3} newPnt
* @param {Number} pntIdx
* @param {Number} maxPts
* @param {Number} ptMode
*/
separateExactlyDuplicatePointsFromNewInsertion(
points: vtkPoints,
pntIds: number[],
newPnt: Vector3,
pntIdx: number,
maxPts: number,
ptMode: number
): void;
/**
* 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
*
* @param {vtkPoints} points
* @param {Number[]} pntIds
* @param {Vector3} newPnt
* @param {Number} pntIdx
* @param {Number} maxPts
* @param {Number} ptMode
* @param {Number} numberOfNodes
*/
createChildNodes(
points: vtkPoints,
pntIds: number[],
newPnt: Vector3,
pntIdx: number,
maxPts: number,
ptMode: number,
numberOfNodes: number
): { success: boolean; numberOfNodes: number; pointIdx: number };
/**
* 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.
*
* @param {Number} points
* @param {Number} newPnt
* @param {Number} maxPts
* @param {Number} pntId
* @param {Number} ptMode
* @param {Number} numberOfNodes
*/
insertPoint(
points: number,
newPnt: number,
maxPts: number,
pntId: number,
ptMode: number,
numberOfNodes: number
): { numberOfNodes: number; pointIdx: number };
/**
* 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.
*
* @param {Vector3} point
* @param {Vector3} closest
* @param {Boolean} innerOnly
* @param {vtkIncrementalOctreeNode} rootNode
* @param {Boolean} checkData
* @returns {Number}
*/
getDistance2ToBoundary(
point: Vector3,
closest: Vector3,
innerOnly: boolean,
rootNode: vtkIncrementalOctreeNode,
checkData: boolean
): number;
/**
* 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.
*
* @param {Vector3} point
* @param {vtkIncrementalOctreeNode} rootNode
*/
getDistance2ToInnerBoundary(
point: Vector3,
rootNode: vtkIncrementalOctreeNode
): number;
}
// ----------------------------------------------------------------------------
// Static API
// ----------------------------------------------------------------------------
/**
* Method use to decorate a given object (publicAPI+model) with vtkIncrementalOctreeNode characteristics.
*
* @param publicAPI object on which methods will be bounds (public)
* @param model object on which data structure will be bounds (protected)
* @param {object} [initialValues] (default: {})
*/
export function extend(
publicAPI: object,
model: object,
initialValues?: object
): void;
// ----------------------------------------------------------------------------
/**
* Method use to create a new instance of vtkIncrementalOctreeNode
* @param {IIncrementalOctreeNodeInitialValues} [initialValues] for pre-setting some of its content
*/
export function newInstance(
initialValues?: IIncrementalOctreeNodeInitialValues
): vtkIncrementalOctreeNode;
/**
* vtkIncrementalOctreeNode
*/
export declare const vtkIncrementalOctreeNode: {
newInstance: typeof newInstance;
extend: typeof extend;
};
export default vtkIncrementalOctreeNode;