@kitware/vtk.js 34.10.0 → 34.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/Core/DataArray.js +2 -1
- package/Common/Core/Points.d.ts +19 -1
- package/Common/Core/Points.js +35 -20
- package/Common/DataModel/AbstractPointLocator.d.ts +2 -2
- package/Common/DataModel/BoundingBox.d.ts +60 -7
- package/Common/DataModel/BoundingBox.js +190 -3
- package/Common/DataModel/Cell.js +4 -34
- package/Common/DataModel/DataSet.d.ts +7 -0
- package/Common/DataModel/DataSet.js +6 -0
- package/Common/DataModel/DataSetAttributes/FieldData.d.ts +6 -2
- package/Common/DataModel/DataSetAttributes.d.ts +2 -1
- package/Common/DataModel/ImageData.d.ts +7 -0
- package/Common/DataModel/ImageData.js +11 -0
- package/Common/DataModel/Locator.d.ts +97 -5
- package/Common/DataModel/MergePoints.d.ts +64 -0
- package/Common/DataModel/MergePoints.js +130 -0
- package/Common/DataModel/PointLocator.d.ts +217 -0
- package/Common/DataModel/PointLocator.js +751 -0
- package/Common/DataModel/PointSet.d.ts +6 -0
- package/Common/DataModel/PointSet.js +10 -0
- package/Common/DataModel/PolyData.d.ts +6 -0
- package/Common/DataModel/PolyData.js +7 -0
- package/Filters/Core/Cutter.js +1 -1
- package/Filters/Core/PolyDataNormals.js +1 -1
- package/Filters/Core/ThresholdPoints.js +1 -2
- package/Filters/General/AppendPolyData.js +1 -1
- package/Filters/General/Calculator.js +1 -1
- package/Filters/General/ClipClosedSurface.js +2 -2
- package/Filters/General/ClosedPolyLineToSurfaceFilter.js +1 -1
- package/Filters/General/ContourLoopExtraction.js +2 -4
- package/Filters/General/ContourTriangulator.js +1 -2
- package/Filters/General/ImageCropFilter.js +7 -10
- package/Filters/General/ImageMarchingCubes.js +1 -1
- package/Filters/General/ImageMarchingSquares.js +1 -1
- package/Filters/General/ImageOutlineFilter.js +2 -1
- package/Filters/General/ImageSliceFilter.js +2 -1
- package/Filters/General/ImageStreamline.js +1 -1
- package/Filters/General/LineFilter.js +1 -1
- package/Filters/General/MoleculeToRepresentation.js +2 -2
- package/Filters/General/OutlineFilter.js +1 -1
- package/Filters/General/ScalarToRGBA.js +2 -1
- package/Filters/General/ShrinkPolyData.js +1 -1
- package/Filters/General/TransformPolyDataFilter.js +1 -1
- package/Filters/General/TriangleFilter.js +1 -1
- package/Filters/General/TubeFilter.js +1 -2
- package/Filters/General/WarpScalar.js +1 -1
- package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
- package/Filters/Sources/ArcSource.js +1 -1
- package/Filters/Sources/Arrow2DSource.js +6 -9
- package/Filters/Sources/ArrowSource.js +2 -8
- package/Filters/Sources/CircleSource.js +3 -10
- package/Filters/Sources/ConcentricCylinderSource.js +5 -8
- package/Filters/Sources/ConeSource.js +3 -10
- package/Filters/Sources/CubeSource.js +3 -9
- package/Filters/Sources/Cursor3D.js +1 -4
- package/Filters/Sources/CylinderSource.js +3 -10
- package/Filters/Sources/DiskSource.js +1 -5
- package/Filters/Sources/EllipseArcSource.js +1 -1
- package/Filters/Sources/FrustumSource.d.ts +111 -0
- package/Filters/Sources/FrustumSource.js +248 -0
- package/Filters/Sources/ImageGridSource.js +0 -3
- package/Filters/Sources/LineSource.js +1 -4
- package/Filters/Sources/PlaneSource.js +1 -4
- package/Filters/Sources/PlatonicSolidSource.js +1 -1
- package/Filters/Sources/PointSource.js +1 -4
- package/Filters/Sources/RTAnalyticSource.js +0 -3
- package/Filters/Sources/SLICSource.js +1 -4
- package/Filters/Sources/SphereSource.js +1 -4
- package/Filters/Sources/ViewFinderSource.js +1 -1
- package/Filters/Texture/TextureMapToPlane.js +1 -4
- package/Filters/Texture/TextureMapToSphere.js +1 -4
- package/Imaging/Core/ImageReslice.js +1 -1
- package/Imaging/Hybrid/SampleFunction.js +1 -1
- package/Rendering/Core/VectorText.js +4 -3
- package/Rendering/OpenGL/Glyph3DMapper.js +16 -0
- package/Rendering/OpenGL/glsl/vtkVolumeVS.glsl.js +1 -1
- package/Widgets/Representations/ImplicitPlaneRepresentation.js +1 -1
- package/Widgets/Representations/RectangleContextRepresentation.js +0 -3
- package/Widgets/Representations/SplineContextRepresentation.js +1 -5
- package/index.d.ts +3 -0
- package/macros2.js +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { vtkObject } from './../../interfaces';
|
|
2
|
+
import vtkDataSet from './DataSet';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
*
|
|
5
6
|
*/
|
|
6
7
|
export interface ILocatorInitialValues {
|
|
7
|
-
dataSet?:
|
|
8
|
+
dataSet?: vtkDataSet;
|
|
8
9
|
maxLevel?: number;
|
|
9
10
|
level?: number;
|
|
10
11
|
automatic?: boolean;
|
|
@@ -12,7 +13,97 @@ export interface ILocatorInitialValues {
|
|
|
12
13
|
useExistingSearchStructure?: boolean;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
export interface vtkLocator extends vtkObject {
|
|
16
|
+
export interface vtkLocator extends vtkObject {
|
|
17
|
+
/**
|
|
18
|
+
* Get whether locator depth/resolution of locator is computed automatically
|
|
19
|
+
* from average number of entities in bucket.
|
|
20
|
+
*/
|
|
21
|
+
getAutomatic(): boolean;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get the dataset associated with this locator.
|
|
25
|
+
*
|
|
26
|
+
* @returns {vtkDataSet} The dataset associated with this locator.
|
|
27
|
+
*/
|
|
28
|
+
getDataSet(): vtkDataSet;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get the current level of the locator.
|
|
32
|
+
*
|
|
33
|
+
* @returns {Number} The current level of the locator.
|
|
34
|
+
*/
|
|
35
|
+
getLevel(): number;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get the maximum level of the locator.
|
|
39
|
+
*
|
|
40
|
+
* @returns {Number} The maximum level of the locator.
|
|
41
|
+
*/
|
|
42
|
+
getMaxLevel(): number;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get the tolerance used for the locator.
|
|
46
|
+
*
|
|
47
|
+
* @returns {Number} The tolerance value.
|
|
48
|
+
*/
|
|
49
|
+
getTolerance(): number;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Get whether to use an existing search structure.
|
|
53
|
+
*
|
|
54
|
+
* @returns {Boolean} Whether an existing search structure is used.
|
|
55
|
+
*/
|
|
56
|
+
getUseExistingSearchStructure(): boolean;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Set whether locator depth/resolution of locator is computed automatically
|
|
60
|
+
* from average number of entities in bucket.
|
|
61
|
+
*
|
|
62
|
+
* @param {Boolean} automatic - The automatic flag.
|
|
63
|
+
* @returns {Boolean} Whether the operation was successful.
|
|
64
|
+
*/
|
|
65
|
+
setAutomatic(automatic: boolean): boolean;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Set the dataset associated with this locator.
|
|
69
|
+
*
|
|
70
|
+
* @param {vtkDataSet} dataSet - The dataset to associate with this locator.
|
|
71
|
+
* @returns {Boolean} Whether the operation was successful.
|
|
72
|
+
*/
|
|
73
|
+
setDataSet(dataSet: vtkDataSet): boolean;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Set the current level of the locator.
|
|
77
|
+
*
|
|
78
|
+
* @param {Number} level - The level to set.
|
|
79
|
+
* @returns {Boolean} Whether the operation was successful.
|
|
80
|
+
*/
|
|
81
|
+
setLevel(level: number): boolean;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Set the maximum level of the locator.
|
|
85
|
+
*
|
|
86
|
+
* @param {Number} maxLevel - The maximum level to set.
|
|
87
|
+
* @returns {Boolean} Whether the operation was successful.
|
|
88
|
+
*/
|
|
89
|
+
setMaxLevel(maxLevel: number): boolean;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Set the tolerance used for the locator.
|
|
93
|
+
*
|
|
94
|
+
* @param {Number} tolerance - The tolerance value to set.
|
|
95
|
+
* @returns {Boolean} Whether the operation was successful.
|
|
96
|
+
*/
|
|
97
|
+
setTolerance(tolerance: number): boolean;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Set whether to use an existing search structure.
|
|
101
|
+
*
|
|
102
|
+
* @param {Boolean} useExistingSearchStructure - Whether to use an existing search structure.
|
|
103
|
+
* @returns {Boolean} Whether the operation was successful.
|
|
104
|
+
*/
|
|
105
|
+
setUseExistingSearchStructure(useExistingSearchStructure: boolean): boolean;
|
|
106
|
+
}
|
|
16
107
|
|
|
17
108
|
// ----------------------------------------------------------------------------
|
|
18
109
|
// Static API
|
|
@@ -31,10 +122,11 @@ export function extend(
|
|
|
31
122
|
initialValues?: ILocatorInitialValues
|
|
32
123
|
): void;
|
|
33
124
|
|
|
34
|
-
// ----------------------------------------------------------------------------
|
|
35
|
-
|
|
36
125
|
/**
|
|
37
|
-
* vtkLocator
|
|
126
|
+
* vtkLocator is an abstract base class for spatial search objects, or locators.
|
|
127
|
+
* The principle behind locators is that they divide 3-space into small regions
|
|
128
|
+
* (or "buckets") that can be quickly found in response to queries about point
|
|
129
|
+
* location, line intersection, or object-object intersection.
|
|
38
130
|
*/
|
|
39
131
|
export declare const vtkLocator: {
|
|
40
132
|
extend: typeof extend;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Vector3 } from './../../types';
|
|
2
|
+
import vtkPointLocator, {
|
|
3
|
+
IInsertPointResult,
|
|
4
|
+
IPointLocatorInitialValues,
|
|
5
|
+
} from './PointLocator';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Initial values for vtkMergePoints.
|
|
9
|
+
*/
|
|
10
|
+
export interface IMergePointsInitialValues extends IPointLocatorInitialValues {
|
|
11
|
+
bucketSize?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface vtkMergePoints extends vtkPointLocator {
|
|
15
|
+
/**
|
|
16
|
+
* Check if a point is already inserted in the merge points structure.
|
|
17
|
+
*
|
|
18
|
+
* @param {Vector3} x The point to check.
|
|
19
|
+
* @returns {Number} The ID of the point if it exists, otherwise -1.
|
|
20
|
+
*/
|
|
21
|
+
isInsertedPoint(x: Vector3): number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Insert a point into the merge points structure.
|
|
25
|
+
* If the point is already present, it returns the existing ID.
|
|
26
|
+
* Otherwise, it inserts the point and returns a new ID.
|
|
27
|
+
*
|
|
28
|
+
* @param {Vector3} x The point to insert as an array of 3 numbers.
|
|
29
|
+
* @returns {IInsertPointResult} An object indicating if the point was inserted and its ID.
|
|
30
|
+
*/
|
|
31
|
+
insertUniquePoint(x: Vector3): IInsertPointResult;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Method used to decorate a given object (publicAPI+model) with vtkMergePoints characteristics.
|
|
36
|
+
*
|
|
37
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
38
|
+
* @param model object on which data structure will be bounds (protected)
|
|
39
|
+
* @param {IMergePointsInitialValues} [initialValues] (default: {})
|
|
40
|
+
*/
|
|
41
|
+
export function extend(
|
|
42
|
+
publicAPI: object,
|
|
43
|
+
model: object,
|
|
44
|
+
initialValues?: IMergePointsInitialValues
|
|
45
|
+
): void;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Method used to create a new instance of vtkMergePoints.
|
|
49
|
+
* @param {IMergePointsInitialValues} [initialValues] for pre-setting some of its content
|
|
50
|
+
*/
|
|
51
|
+
export function newInstance(
|
|
52
|
+
initialValues?: IMergePointsInitialValues
|
|
53
|
+
): vtkMergePoints;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* vtkMergePoints merge exactly coincident points.
|
|
57
|
+
*
|
|
58
|
+
* vtkMergePoints is a locator object to quickly locate points in 3D.
|
|
59
|
+
*/
|
|
60
|
+
export declare const vtkMergePoints: {
|
|
61
|
+
newInstance: typeof newInstance;
|
|
62
|
+
extend: typeof extend;
|
|
63
|
+
};
|
|
64
|
+
export default vtkMergePoints;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { m as macro } from '../../macros2.js';
|
|
2
|
+
import vtkPointLocator from './PointLocator.js';
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
vtkErrorMacro
|
|
6
|
+
} = macro;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Search for a point in the array using indices from bucketIds
|
|
10
|
+
* @param {Number[]} bucketIds - The list of point IDs in the bucket.
|
|
11
|
+
* @param {vtkPoints} points - The vtkPoints object containing the points.
|
|
12
|
+
* @param {Vector3} x - The point to check.
|
|
13
|
+
* @returns {Number} - The ID of the point if it exists, otherwise -1.
|
|
14
|
+
*/
|
|
15
|
+
function findPointInBucket(bucketIds, points, x) {
|
|
16
|
+
const data = points.getData();
|
|
17
|
+
for (let i = 0; i < bucketIds.length; ++i) {
|
|
18
|
+
const ptId = bucketIds[i];
|
|
19
|
+
const idx = ptId * 3;
|
|
20
|
+
if (x[0] === data[idx] && x[1] === data[idx + 1] && x[2] === data[idx + 2]) {
|
|
21
|
+
return ptId;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return -1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// ----------------------------------------------------------------------------
|
|
28
|
+
// vtkMergePoints methods
|
|
29
|
+
// ----------------------------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
function vtkMergePoints(publicAPI, model) {
|
|
32
|
+
// Set our className
|
|
33
|
+
model.classHierarchy.push('vtkMergePoints');
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Check if a point is already inserted in the merge points structure.
|
|
37
|
+
*
|
|
38
|
+
* @param {Vector3} x The point to check.
|
|
39
|
+
* @returns {Number} The ID of the point if it exists, otherwise -1.
|
|
40
|
+
*/
|
|
41
|
+
publicAPI.isInsertedPoint = x => {
|
|
42
|
+
const idx = publicAPI.getBucketIndex(x);
|
|
43
|
+
const bucketIds = model.hashTable.get(idx);
|
|
44
|
+
if (bucketIds) {
|
|
45
|
+
return findPointInBucket(bucketIds, model.points, x);
|
|
46
|
+
}
|
|
47
|
+
return -1;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Insert a point into the merge points structure.
|
|
52
|
+
* If the point is already present, it returns the existing ID.
|
|
53
|
+
* Otherwise, it inserts the point and returns a new ID.
|
|
54
|
+
*
|
|
55
|
+
* @param {Vector3} x The point to insert as an array of 3 numbers.
|
|
56
|
+
* @returns {IInsertPointResult} An object indicating if the point was inserted and its ID.
|
|
57
|
+
*/
|
|
58
|
+
publicAPI.insertUniquePoint = x => {
|
|
59
|
+
if (!x || x.length !== 3) {
|
|
60
|
+
vtkErrorMacro('Point must be a Vector3.');
|
|
61
|
+
return {
|
|
62
|
+
inserted: false,
|
|
63
|
+
id: -1
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const idx = publicAPI.getBucketIndex(x);
|
|
67
|
+
let bucketIds = model.hashTable.get(idx);
|
|
68
|
+
let id = null;
|
|
69
|
+
if (bucketIds !== undefined) {
|
|
70
|
+
const ptId = findPointInBucket(bucketIds, model.points, x);
|
|
71
|
+
if (ptId !== -1) {
|
|
72
|
+
id = ptId;
|
|
73
|
+
return {
|
|
74
|
+
inserted: false,
|
|
75
|
+
id
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
bucketIds = [];
|
|
80
|
+
model.hashTable.set(idx, bucketIds);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Insert new point
|
|
84
|
+
bucketIds.push(model.insertionPointId);
|
|
85
|
+
model.points.insertNextPoint(...x);
|
|
86
|
+
id = model.insertionPointId++;
|
|
87
|
+
return {
|
|
88
|
+
inserted: true,
|
|
89
|
+
id
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ----------------------------------------------------------------------------
|
|
95
|
+
// Object factory
|
|
96
|
+
// ----------------------------------------------------------------------------
|
|
97
|
+
|
|
98
|
+
function defaultValues(initialValues) {
|
|
99
|
+
return {
|
|
100
|
+
// points: null,
|
|
101
|
+
// hashTable: null,
|
|
102
|
+
...initialValues
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ----------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
function extend(publicAPI, model) {
|
|
109
|
+
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
110
|
+
vtkPointLocator.extend(publicAPI, model, defaultValues(initialValues));
|
|
111
|
+
|
|
112
|
+
// Make this a VTK object
|
|
113
|
+
macro.obj(publicAPI, model);
|
|
114
|
+
|
|
115
|
+
// Object specific methods
|
|
116
|
+
vtkMergePoints(publicAPI, model);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ----------------------------------------------------------------------------
|
|
120
|
+
|
|
121
|
+
const newInstance = macro.newInstance(extend, 'vtkMergePoints');
|
|
122
|
+
|
|
123
|
+
// ----------------------------------------------------------------------------
|
|
124
|
+
|
|
125
|
+
var index = {
|
|
126
|
+
newInstance,
|
|
127
|
+
extend
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export { index as default, extend, newInstance };
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Bounds, Nullable, Vector3 } from './../../types';
|
|
2
|
+
import vtkPoints from './../Core/Points';
|
|
3
|
+
import vtkAbstractPointLocator, {
|
|
4
|
+
IAbstractPointLocatorInitialValues,
|
|
5
|
+
} from './AbstractPointLocator';
|
|
6
|
+
import vtkPolyData from './PolyData';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export interface IPointLocatorInitialValues
|
|
12
|
+
extends IAbstractPointLocatorInitialValues {
|
|
13
|
+
numberOfPointsPerBucket?: number;
|
|
14
|
+
bucketSize?: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface IInsertPointResult {
|
|
18
|
+
inserted: boolean;
|
|
19
|
+
id: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface IFindClosestPointResult {
|
|
23
|
+
id: number;
|
|
24
|
+
dist2: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface vtkPointLocator extends vtkAbstractPointLocator {
|
|
28
|
+
/**
|
|
29
|
+
* Find the closest inserted point to the given coordinates.
|
|
30
|
+
*
|
|
31
|
+
* @param {Vector3} x The query point
|
|
32
|
+
* @returns {Number} The id of the closest inserted point or -1 if not found
|
|
33
|
+
*/
|
|
34
|
+
findClosestInsertedPoint(x: Vector3): number;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Find the closest point to a given point.
|
|
38
|
+
*
|
|
39
|
+
* @param {Vector3} x The point coordinates
|
|
40
|
+
* @returns The id of the closest point or -1 if not found
|
|
41
|
+
*/
|
|
42
|
+
findClosestPoint(x: Vector3): number;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Find the closest point within a specified radius.
|
|
46
|
+
*
|
|
47
|
+
* @param {Number} radius The search radius
|
|
48
|
+
* @param {Vector3} x The point coordinates
|
|
49
|
+
* @param {Number} inputDataLength The length of the input data
|
|
50
|
+
* @returns {IFindClosestPointResult} The closest point result
|
|
51
|
+
*/
|
|
52
|
+
findClosestPointWithinRadius(
|
|
53
|
+
radius: number,
|
|
54
|
+
x: Vector3,
|
|
55
|
+
inputDataLength?: number
|
|
56
|
+
): IFindClosestPointResult;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Free the search structure and reset the locator.
|
|
60
|
+
*/
|
|
61
|
+
freeSearchStructure(): void;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Generate a polydata representation of the point locator.
|
|
65
|
+
*
|
|
66
|
+
* @param {vtkPolyData} polydata The polydata to generate representation for
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
generateRepresentation(polydata: vtkPolyData): boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Get the number of points per bucket.
|
|
73
|
+
*
|
|
74
|
+
* @returns {Number} The number of points per bucket.
|
|
75
|
+
*/
|
|
76
|
+
getNumberOfPointsPerBucket(): number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Get the points in the specified bucket.
|
|
80
|
+
* @param {Vector3} x The point coordinates
|
|
81
|
+
* @returns {Number[]} The points in the bucket
|
|
82
|
+
*/
|
|
83
|
+
getPointsInBucket(x: Vector3): number[];
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Get the points stored in the point locator.
|
|
87
|
+
*
|
|
88
|
+
* @returns {Nullable<vtkPoints>} The vtkPoints object containing the points.
|
|
89
|
+
*/
|
|
90
|
+
getPoints(): Nullable<vtkPoints>;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Initialize point insertion.
|
|
94
|
+
*
|
|
95
|
+
* @param {vtkPoints} points The points to insert
|
|
96
|
+
* @param {Bounds} bounds The bounds for the points
|
|
97
|
+
* @param {Number} estNumPts Estimated number of points for insertion
|
|
98
|
+
*/
|
|
99
|
+
initPointInsertion(
|
|
100
|
+
points: vtkPoints,
|
|
101
|
+
bounds: Bounds,
|
|
102
|
+
estNumPts?: number
|
|
103
|
+
): boolean;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Insert a point into the point locator.
|
|
107
|
+
* If the point is already present, it returns the existing ID.
|
|
108
|
+
* Otherwise, it inserts the point and returns a new ID.
|
|
109
|
+
*
|
|
110
|
+
* @param {Number} ptId The index of the point to insert.
|
|
111
|
+
* @param {Vector3} x The point to insert.
|
|
112
|
+
* @returns {IInsertPointResult} An object indicating if the point was inserted and its ID.
|
|
113
|
+
*/
|
|
114
|
+
insertPoint(ptId: number, x: Vector3): IInsertPointResult;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Insert a point into the point locator.
|
|
118
|
+
* If the point is already present, it returns the existing ID.
|
|
119
|
+
* Otherwise, it inserts the point and returns a new ID.
|
|
120
|
+
*
|
|
121
|
+
* @param {Vector3} x The point to insert.
|
|
122
|
+
* @returns {IInsertPointResult} An object indicating if the point was inserted and its ID.
|
|
123
|
+
*/
|
|
124
|
+
insertNextPoint(x: Vector3): IInsertPointResult;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Insert a point into the point locator.
|
|
128
|
+
* If the point is already present, it returns the existing ID.
|
|
129
|
+
* Otherwise, it inserts the point and returns a new ID.
|
|
130
|
+
*
|
|
131
|
+
* @param {Vector3} x The point to insert.
|
|
132
|
+
* @returns {IInsertPointResult} An object indicating if the point was inserted and its ID.
|
|
133
|
+
*/
|
|
134
|
+
insertUniquePoint(x: Vector3): IInsertPointResult;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Check if a point is already inserted in the point locator.
|
|
138
|
+
*
|
|
139
|
+
* @param {Vector3} x The point to check.
|
|
140
|
+
* @returns {Number} The ID of the point if it exists, otherwise -1.
|
|
141
|
+
*/
|
|
142
|
+
isInsertedPoint(x: Vector3): number;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Set the divisions of the point locator.
|
|
146
|
+
* @param {Vector3} divisions The number of divisions in each dimension.
|
|
147
|
+
* @returns {Boolean} True if the divisions were set successfully, false otherwise.
|
|
148
|
+
*/
|
|
149
|
+
setDivisions(divisions: Vector3): boolean;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Set the divisions of the point locator.
|
|
153
|
+
* @param {Number} x The number of divisions in the x dimension.
|
|
154
|
+
* @param {Number} y The number of divisions in the y dimension.
|
|
155
|
+
* @param {Number} z The number of divisions in the z dimension.
|
|
156
|
+
* @returns {Boolean} True if the divisions were set successfully, false otherwise.
|
|
157
|
+
*/
|
|
158
|
+
setDivisions(x: number, y: number, z: number): boolean;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Set the number of points per bucket.
|
|
162
|
+
*
|
|
163
|
+
* @param {Number} numberOfPointsPerBucket The number of points per bucket.
|
|
164
|
+
*/
|
|
165
|
+
setNumberOfPointsPerBucket(numberOfPointsPerBucket: number): boolean;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Set the points for this point locator.
|
|
169
|
+
* This is typically used to initialize the locator with a set of points.
|
|
170
|
+
*
|
|
171
|
+
* @param {vtkPoints} points The vtkPoints object containing the points.
|
|
172
|
+
*/
|
|
173
|
+
setPoints(points: vtkPoints): boolean;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Method use to decorate a given object (publicAPI+model) with vtkPointLocator characteristics.
|
|
178
|
+
*
|
|
179
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
180
|
+
* @param model object on which data structure will be bounds (protected)
|
|
181
|
+
* @param {object} [initialValues] (default: {})
|
|
182
|
+
*/
|
|
183
|
+
export function extend(
|
|
184
|
+
publicAPI: object,
|
|
185
|
+
model: object,
|
|
186
|
+
initialValues?: IPointLocatorInitialValues
|
|
187
|
+
): void;
|
|
188
|
+
|
|
189
|
+
// ----------------------------------------------------------------------------
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Method use to create a new instance of vtkPointLocator
|
|
193
|
+
* @param {IPointLocatorInitialValues} [initialValues] for pre-setting some of its content
|
|
194
|
+
*/
|
|
195
|
+
export function newInstance(
|
|
196
|
+
initialValues?: IPointLocatorInitialValues
|
|
197
|
+
): vtkPointLocator;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* vtkPointLocator is a spatial search object to quickly locate points in 3D.
|
|
201
|
+
*
|
|
202
|
+
* vtkPointLocator works by dividing a specified region of space into a regular
|
|
203
|
+
* array of "rectangular" buckets, and then keeping a list of points that lie in
|
|
204
|
+
* each bucket. Typical operation involves giving a position in 3D and finding
|
|
205
|
+
* the closest point.
|
|
206
|
+
*
|
|
207
|
+
* vtkPointLocator has two distinct methods of interaction. In the first method,
|
|
208
|
+
* you supply it with a dataset, and it operates on the points in the dataset.
|
|
209
|
+
* In the second method, you supply it with an array of points, and the object
|
|
210
|
+
* operates on the array.
|
|
211
|
+
*/
|
|
212
|
+
export declare const vtkPointLocator: {
|
|
213
|
+
newInstance: typeof newInstance;
|
|
214
|
+
extend: typeof extend;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export default vtkPointLocator;
|