@kitware/vtk.js 34.6.0 → 34.8.0
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/Math/index.js +12 -1
- package/Common/Core/Math.d.ts +24 -18
- package/Common/Core/Math.js +1 -1
- package/Common/DataModel/Polygon.d.ts +13 -0
- package/Common/DataModel/Polygon.js +29 -2
- package/Common/DataModel/Triangle.js +8 -13
- package/Filters/Core/Cutter.js +1 -0
- package/Filters/General/ShrinkPolyData.d.ts +85 -0
- package/Filters/General/ShrinkPolyData.js +317 -0
- package/Filters/General.js +2 -0
- package/Filters/Sources/ArcSource.d.ts +244 -0
- package/Filters/Sources/ArcSource.js +138 -0
- package/Filters/Sources/EllipseArcSource.d.ts +212 -0
- package/Filters/Sources/EllipseArcSource.js +159 -0
- package/Filters/Sources/PlatonicSolidSource/Constants.d.ts +12 -0
- package/Filters/Sources/PlatonicSolidSource/Constants.js +12 -0
- package/Filters/Sources/PlatonicSolidSource.d.ts +109 -0
- package/Filters/Sources/PlatonicSolidSource.js +149 -0
- package/Filters/Sources.js +6 -0
- package/IO/Misc/OBJWriter.d.ts +103 -0
- package/IO/Misc/OBJWriter.js +237 -0
- package/IO/Misc.js +2 -0
- package/Interaction/Style/InteractorStyleManipulator.js +75 -2
- package/Proxy/Representations/GlyphRepresentationProxy.js +3 -0
- package/Rendering/Core/Camera.d.ts +3 -3
- package/Rendering/Core/Camera.js +33 -3
- package/Rendering/Core/ColorTransferFunction/CssFilters.js +1 -1
- package/Rendering/Core/ColorTransferFunction.js +1 -1
- package/Rendering/Core/Coordinate.js +1 -1
- package/Rendering/Core/CubeAxesActor.js +1 -1
- package/Rendering/Core/ImageMapper.js +1 -1
- package/Rendering/Core/Renderer.js +1 -1
- package/Rendering/Core/ScalarBarActor.js +1 -1
- package/Rendering/Core/TextActor.js +1 -1
- package/Rendering/Core/VolumeProperty.js +1 -1
- package/Rendering/OpenGL/PolyDataMapper2D.js +1 -1
- package/Rendering/OpenGL/Texture.js +1 -1
- package/Widgets/Widgets3D/AngleWidget.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
- package/index.d.ts +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { m as macro } from '../../macros2.js';
|
|
2
|
+
import vtkCellArray from '../../Common/Core/CellArray.js';
|
|
3
|
+
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
4
|
+
import vtkPoints from '../../Common/Core/Points.js';
|
|
5
|
+
import vtkPolygon from '../../Common/DataModel/Polygon.js';
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
vtkErrorMacro
|
|
9
|
+
} = macro;
|
|
10
|
+
|
|
11
|
+
// ----------------------------------------------------------------------------
|
|
12
|
+
// vtkShrinkPolyData methods
|
|
13
|
+
// ----------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
function vtkShrinkPolyData(publicAPI, model) {
|
|
16
|
+
// Set our className
|
|
17
|
+
model.classHierarchy.push('vtkShrinkPolyData');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Shrink a point towards a given center by a shrink factor.
|
|
21
|
+
* @param {Vector3} point - The [x, y, z] coordinates of the point to shrink
|
|
22
|
+
* @param {Vector3} center - The [x, y, z] coordinates of the center
|
|
23
|
+
* @param {number} shrinkFactor - The shrink factor (0.0 to 1.0)
|
|
24
|
+
* @param {Vector3} [shrunkPoint] - Optional array to store the shrunk point
|
|
25
|
+
* @returns {Vector3} The shrunk point [x, y, z] coordinates
|
|
26
|
+
*/
|
|
27
|
+
function shrinkTowardsPoint(point, center, shrinkFactor) {
|
|
28
|
+
let shrunkPoint = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
29
|
+
shrunkPoint[0] = center[0] + shrinkFactor * (point[0] - center[0]);
|
|
30
|
+
shrunkPoint[1] = center[1] + shrinkFactor * (point[1] - center[1]);
|
|
31
|
+
shrunkPoint[2] = center[2] + shrinkFactor * (point[2] - center[2]);
|
|
32
|
+
return shrunkPoint;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Shrinks a cell towards its center by a shrink factor.
|
|
37
|
+
* @param {number[]} cellPointIds - Array of point indices that define the cell
|
|
38
|
+
* @param {vtkPoints} inPoints - Input points
|
|
39
|
+
* @param {number} shrinkFactor - The shrink factor (0.0 to 1.0)
|
|
40
|
+
* @param {Float32Array} newPointsData - Output array to store new point coordinates
|
|
41
|
+
* @param {number} outCount - Current index in the output points array
|
|
42
|
+
* @returns {Object} Object containing newPointIds array and updated outCount
|
|
43
|
+
*/
|
|
44
|
+
function shrinkCell(cellPointIds, inPoints, shrinkFactor, newPointsData, outCount) {
|
|
45
|
+
const inPts = inPoints.getData();
|
|
46
|
+
const center = [0, 0, 0];
|
|
47
|
+
const newPointIds = [];
|
|
48
|
+
const shrunkPoint = [0, 0, 0];
|
|
49
|
+
const currentPoint = [0, 0, 0];
|
|
50
|
+
let nextOutCount = outCount;
|
|
51
|
+
const numPoints = cellPointIds.length;
|
|
52
|
+
if (numPoints === 0) {
|
|
53
|
+
return {
|
|
54
|
+
newPointIds,
|
|
55
|
+
outCount: nextOutCount
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (numPoints === 1) {
|
|
59
|
+
// vertex - no shrinking needed, just copy the point
|
|
60
|
+
const ptId = cellPointIds[0];
|
|
61
|
+
newPointsData[nextOutCount * 3] = inPts[ptId * 3];
|
|
62
|
+
newPointsData[nextOutCount * 3 + 1] = inPts[ptId * 3 + 1];
|
|
63
|
+
newPointsData[nextOutCount * 3 + 2] = inPts[ptId * 3 + 2];
|
|
64
|
+
newPointIds.push(nextOutCount);
|
|
65
|
+
nextOutCount++;
|
|
66
|
+
} else if (numPoints === 2) {
|
|
67
|
+
// line - shrink towards midpoint
|
|
68
|
+
|
|
69
|
+
// Calculate midpoint as center
|
|
70
|
+
vtkPolygon.computeCentroid(cellPointIds, inPoints, center);
|
|
71
|
+
|
|
72
|
+
// Shrink both points towards center
|
|
73
|
+
for (let i = 0; i < 2; i++) {
|
|
74
|
+
const ptId = cellPointIds[i];
|
|
75
|
+
currentPoint[0] = inPts[ptId * 3];
|
|
76
|
+
currentPoint[1] = inPts[ptId * 3 + 1];
|
|
77
|
+
currentPoint[2] = inPts[ptId * 3 + 2];
|
|
78
|
+
shrinkTowardsPoint(currentPoint, center, shrinkFactor, shrunkPoint);
|
|
79
|
+
newPointsData[nextOutCount * 3] = shrunkPoint[0];
|
|
80
|
+
newPointsData[nextOutCount * 3 + 1] = shrunkPoint[1];
|
|
81
|
+
newPointsData[nextOutCount * 3 + 2] = shrunkPoint[2];
|
|
82
|
+
newPointIds.push(nextOutCount);
|
|
83
|
+
nextOutCount++;
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
// polygon/triangle - shrink towards centroid
|
|
87
|
+
vtkPolygon.computeCentroid(cellPointIds, inPoints, center);
|
|
88
|
+
|
|
89
|
+
// Shrink each point towards centroid
|
|
90
|
+
for (let i = 0; i < numPoints; i++) {
|
|
91
|
+
const ptId = cellPointIds[i];
|
|
92
|
+
currentPoint[0] = inPts[ptId * 3];
|
|
93
|
+
currentPoint[1] = inPts[ptId * 3 + 1];
|
|
94
|
+
currentPoint[2] = inPts[ptId * 3 + 2];
|
|
95
|
+
shrinkTowardsPoint(currentPoint, center, shrinkFactor, shrunkPoint);
|
|
96
|
+
newPointsData[nextOutCount * 3] = shrunkPoint[0];
|
|
97
|
+
newPointsData[nextOutCount * 3 + 1] = shrunkPoint[1];
|
|
98
|
+
newPointsData[nextOutCount * 3 + 2] = shrunkPoint[2];
|
|
99
|
+
newPointIds.push(nextOutCount);
|
|
100
|
+
nextOutCount++;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
newPointIds,
|
|
105
|
+
outCount: nextOutCount
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Internal method to process the shrinking
|
|
110
|
+
function shrinkData(input, output) {
|
|
111
|
+
const inPoints = input.getPoints();
|
|
112
|
+
const inVerts = input.getVerts();
|
|
113
|
+
const inLines = input.getLines();
|
|
114
|
+
const inPolys = input.getPolys();
|
|
115
|
+
const inStrips = input.getStrips();
|
|
116
|
+
const shrinkFactor = model.shrinkFactor;
|
|
117
|
+
let numNewPts = 0;
|
|
118
|
+
if (inVerts) {
|
|
119
|
+
const cellSizes = inVerts.getCellSizes();
|
|
120
|
+
for (let i = 0; i < cellSizes.length; i++) {
|
|
121
|
+
numNewPts += cellSizes[i];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (inLines) {
|
|
125
|
+
const cellSizes = inLines.getCellSizes();
|
|
126
|
+
for (let i = 0; i < cellSizes.length; i++) {
|
|
127
|
+
numNewPts += (cellSizes[i] - 1) * 2;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (inPolys) {
|
|
131
|
+
const cellSizes = inPolys.getCellSizes();
|
|
132
|
+
for (let i = 0; i < cellSizes.length; i++) {
|
|
133
|
+
numNewPts += cellSizes[i];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (inStrips) {
|
|
137
|
+
const cellSizes = inStrips.getCellSizes();
|
|
138
|
+
for (let i = 0; i < cellSizes.length; i++) {
|
|
139
|
+
numNewPts += (cellSizes[i] - 2) * 3;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const newPointsData = new Float32Array(numNewPts * 3);
|
|
143
|
+
const newPoints = vtkPoints.newInstance();
|
|
144
|
+
newPoints.setData(newPointsData, 3);
|
|
145
|
+
const newVerts = vtkCellArray.newInstance();
|
|
146
|
+
const newLines = vtkCellArray.newInstance();
|
|
147
|
+
const newPolys = vtkCellArray.newInstance();
|
|
148
|
+
let outCount = 0;
|
|
149
|
+
|
|
150
|
+
// Process vertices
|
|
151
|
+
if (inVerts) {
|
|
152
|
+
const vertData = inVerts.getData();
|
|
153
|
+
const newVertData = [];
|
|
154
|
+
const cellPointIds = [];
|
|
155
|
+
for (let i = 0; i < vertData.length;) {
|
|
156
|
+
cellPointIds.length = 0; // Clear previous point IDs
|
|
157
|
+
const npts = vertData[i];
|
|
158
|
+
for (let j = 1; j <= npts; j++) {
|
|
159
|
+
cellPointIds.push(vertData[i + j]);
|
|
160
|
+
}
|
|
161
|
+
const result = shrinkCell(cellPointIds, inPoints, shrinkFactor, newPointsData, outCount);
|
|
162
|
+
outCount = result.outCount;
|
|
163
|
+
newVertData.push(npts);
|
|
164
|
+
newVertData.push(...result.newPointIds);
|
|
165
|
+
i += npts + 1;
|
|
166
|
+
}
|
|
167
|
+
newVerts.setData(new Uint32Array(newVertData));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Process lines
|
|
171
|
+
if (inLines) {
|
|
172
|
+
const lineData = inLines.getData();
|
|
173
|
+
const newLineData = [];
|
|
174
|
+
for (let i = 0; i < lineData.length;) {
|
|
175
|
+
const npts = lineData[i];
|
|
176
|
+
|
|
177
|
+
// Process each line segment
|
|
178
|
+
for (let j = 0; j < npts - 1; j++) {
|
|
179
|
+
const cellPointIds = [lineData[i + j + 1], lineData[i + j + 2]];
|
|
180
|
+
const result = shrinkCell(cellPointIds, inPoints, shrinkFactor, newPointsData, outCount);
|
|
181
|
+
outCount = result.outCount;
|
|
182
|
+
newLineData.push(2, result.newPointIds[0], result.newPointIds[1]);
|
|
183
|
+
}
|
|
184
|
+
i += npts + 1;
|
|
185
|
+
}
|
|
186
|
+
newLines.setData(new Uint32Array(newLineData));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Process polygons
|
|
190
|
+
if (inPolys) {
|
|
191
|
+
const polyData = inPolys.getData();
|
|
192
|
+
const newPolyData = [];
|
|
193
|
+
const cellPointIds = [];
|
|
194
|
+
for (let i = 0; i < polyData.length;) {
|
|
195
|
+
cellPointIds.length = 0; // Clear previous point IDs
|
|
196
|
+
const npts = polyData[i];
|
|
197
|
+
for (let j = 1; j <= npts; j++) {
|
|
198
|
+
cellPointIds.push(polyData[i + j]);
|
|
199
|
+
}
|
|
200
|
+
const result = shrinkCell(cellPointIds, inPoints, shrinkFactor, newPointsData, outCount);
|
|
201
|
+
outCount = result.outCount;
|
|
202
|
+
newPolyData.push(npts);
|
|
203
|
+
newPolyData.push(...result.newPointIds);
|
|
204
|
+
i += npts + 1;
|
|
205
|
+
}
|
|
206
|
+
newPolys.setData(new Uint32Array(newPolyData));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Process triangle strips (convert to triangles and shrink)
|
|
210
|
+
if (inStrips) {
|
|
211
|
+
const stripData = inStrips.getData();
|
|
212
|
+
const newPolyData = [];
|
|
213
|
+
for (let i = 0; i < stripData.length;) {
|
|
214
|
+
const npts = stripData[i];
|
|
215
|
+
for (let j = 0; j < npts - 2; j++) {
|
|
216
|
+
const cellPointIds = [stripData[i + j + 1], stripData[i + j + 2], stripData[i + j + 3]];
|
|
217
|
+
const result = shrinkCell(cellPointIds, inPoints, shrinkFactor, newPointsData, outCount);
|
|
218
|
+
outCount = result.outCount;
|
|
219
|
+
|
|
220
|
+
// Triangle strips alternate the winding order of each triangle as you
|
|
221
|
+
// move along the strip. This means that the orientation
|
|
222
|
+
// (clockwise/counter-clockwise) flips for every new triangle. To
|
|
223
|
+
// ensure consistent face orientation (so normals and rendering are
|
|
224
|
+
// correct), we reverse the vertex order for every odd triangle.
|
|
225
|
+
// Example strip with vertices [0,1,2,3,4,5] produces these triangles:
|
|
226
|
+
//
|
|
227
|
+
// 0───2───4 Triangle 0: (0,1,2) [CCW]
|
|
228
|
+
// │ ╱ │ ╱ │ Triangle 1: (1,3,2) [CW -> reversed to (2,3,1) for CCW]
|
|
229
|
+
// │╱ │╱ │ Triangle 2: (2,3,4) [CCW]
|
|
230
|
+
// 1───3───5 Triangle 3: (3,5,4) [CW -> reversed to (4,5,3) for CCW]
|
|
231
|
+
const newIds = [...result.newPointIds];
|
|
232
|
+
if (j % 2) {
|
|
233
|
+
const tmp = newIds[0];
|
|
234
|
+
newIds[0] = newIds[2];
|
|
235
|
+
newIds[2] = tmp;
|
|
236
|
+
}
|
|
237
|
+
newPolyData.push(3, newIds[0], newIds[1], newIds[2]);
|
|
238
|
+
}
|
|
239
|
+
i += npts + 1;
|
|
240
|
+
}
|
|
241
|
+
if (newPolyData.length > 0) {
|
|
242
|
+
const existingPolyData = newPolys.getData();
|
|
243
|
+
const combinedPolyData = new Uint32Array(existingPolyData.length + newPolyData.length);
|
|
244
|
+
combinedPolyData.set(existingPolyData);
|
|
245
|
+
combinedPolyData.set(newPolyData, existingPolyData.length);
|
|
246
|
+
newPolys.setData(combinedPolyData);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Set output
|
|
251
|
+
output.setPoints(newPoints);
|
|
252
|
+
output.setVerts(newVerts);
|
|
253
|
+
output.setLines(newLines);
|
|
254
|
+
output.setPolys(newPolys);
|
|
255
|
+
|
|
256
|
+
// Copy cell data
|
|
257
|
+
output.getCellData().passData(input.getCellData());
|
|
258
|
+
}
|
|
259
|
+
publicAPI.requestData = (inData, outData) => {
|
|
260
|
+
const input = inData[0];
|
|
261
|
+
const output = outData[0] || vtkPolyData.newInstance();
|
|
262
|
+
if (!input) {
|
|
263
|
+
vtkErrorMacro('No input!');
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (!input.getPoints()) {
|
|
267
|
+
vtkErrorMacro('Input has no points!');
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
shrinkData(input, output);
|
|
271
|
+
outData[0] = output;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
// Set the shrink factor
|
|
275
|
+
publicAPI.setShrinkFactor = shrinkFactor => {
|
|
276
|
+
if (shrinkFactor !== model.shrinkFactor) {
|
|
277
|
+
model.shrinkFactor = Math.max(0.0, Math.min(1.0, shrinkFactor));
|
|
278
|
+
publicAPI.modified();
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// ----------------------------------------------------------------------------
|
|
284
|
+
// Object factory
|
|
285
|
+
// ----------------------------------------------------------------------------
|
|
286
|
+
|
|
287
|
+
const DEFAULT_VALUES = {
|
|
288
|
+
shrinkFactor: 0.5
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
// ----------------------------------------------------------------------------
|
|
292
|
+
|
|
293
|
+
function extend(publicAPI, model) {
|
|
294
|
+
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
295
|
+
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
296
|
+
|
|
297
|
+
// Build VTK API
|
|
298
|
+
macro.obj(publicAPI, model);
|
|
299
|
+
|
|
300
|
+
// Also make it an algorithm with one input and one output
|
|
301
|
+
macro.algo(publicAPI, model, 1, 1);
|
|
302
|
+
macro.setGet(publicAPI, model, ['shrinkFactor']);
|
|
303
|
+
vtkShrinkPolyData(publicAPI, model);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// ----------------------------------------------------------------------------
|
|
307
|
+
|
|
308
|
+
const newInstance = macro.newInstance(extend, 'vtkShrinkPolyData');
|
|
309
|
+
|
|
310
|
+
// ----------------------------------------------------------------------------
|
|
311
|
+
|
|
312
|
+
var vtkShrinkPolyData$1 = {
|
|
313
|
+
newInstance,
|
|
314
|
+
extend
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
export { vtkShrinkPolyData$1 as default, extend, newInstance };
|
package/Filters/General.js
CHANGED
|
@@ -15,6 +15,7 @@ import vtkOBBTree from './General/OBBTree.js';
|
|
|
15
15
|
import vtkOutlineFilter from './General/OutlineFilter.js';
|
|
16
16
|
import vtkPaintFilter from './General/PaintFilter.js';
|
|
17
17
|
import vtkScalarToRGBA from './General/ScalarToRGBA.js';
|
|
18
|
+
import vtkShrinkPolyData from './General/ShrinkPolyData.js';
|
|
18
19
|
import vtkTransformPolyDataFilter from './General/TransformPolyDataFilter.js';
|
|
19
20
|
import vtkTriangleFilter from './General/TriangleFilter.js';
|
|
20
21
|
import vtkTubeFilter from './General/TubeFilter.js';
|
|
@@ -39,6 +40,7 @@ var General = {
|
|
|
39
40
|
vtkOutlineFilter,
|
|
40
41
|
vtkPaintFilter,
|
|
41
42
|
vtkScalarToRGBA,
|
|
43
|
+
vtkShrinkPolyData,
|
|
42
44
|
vtkTransformPolyDataFilter,
|
|
43
45
|
vtkTriangleFilter,
|
|
44
46
|
vtkTubeFilter,
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { DesiredOutputPrecision } from './../../Common/DataModel/DataSetAttributes';
|
|
2
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
3
|
+
import { Vector3 } from './../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export interface IArcSourceInitialValues {
|
|
9
|
+
point1?: Vector3;
|
|
10
|
+
point2?: Vector3;
|
|
11
|
+
center?: Vector3;
|
|
12
|
+
normal?: Vector3;
|
|
13
|
+
polarVector?: Vector3;
|
|
14
|
+
angle?: number;
|
|
15
|
+
resolution?: number;
|
|
16
|
+
negative?: boolean;
|
|
17
|
+
useNormalAndAngle?: boolean;
|
|
18
|
+
outputPointsPrecision?: DesiredOutputPrecision;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type vtkArcSourceBase = vtkObject &
|
|
22
|
+
Omit<
|
|
23
|
+
vtkAlgorithm,
|
|
24
|
+
| 'getInputData'
|
|
25
|
+
| 'setInputData'
|
|
26
|
+
| 'setInputConnection'
|
|
27
|
+
| 'getInputConnection'
|
|
28
|
+
| 'addInputConnection'
|
|
29
|
+
| 'addInputData'
|
|
30
|
+
>;
|
|
31
|
+
|
|
32
|
+
export interface vtkArcSource extends vtkArcSourceBase {
|
|
33
|
+
/**
|
|
34
|
+
* Get the angle of the arc.
|
|
35
|
+
*/
|
|
36
|
+
getAngle(): number;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get the center of the arc.
|
|
40
|
+
*/
|
|
41
|
+
getCenter(): Vector3;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get the center of the arc by reference.
|
|
45
|
+
*/
|
|
46
|
+
getCenterByReference(): Vector3;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get the first point of the arc.
|
|
50
|
+
*/
|
|
51
|
+
getPoint1(): Vector3;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get the first point of the arc by reference.
|
|
55
|
+
*/
|
|
56
|
+
getPoint1ByReference(): Vector3;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get the second point of the arc.
|
|
60
|
+
*/
|
|
61
|
+
getPoint2(): Vector3;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Get the second point of the arc by reference.
|
|
65
|
+
*/
|
|
66
|
+
getPoint2ByReference(): Vector3;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Get the normal vector of the arc.
|
|
70
|
+
*/
|
|
71
|
+
getNormal(): Vector3;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Get the normal vector of the arc by reference.
|
|
75
|
+
*/
|
|
76
|
+
getNormalByReference(): Vector3;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Get the polar vector of the arc.
|
|
80
|
+
*/
|
|
81
|
+
getPolarVector(): Vector3;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Get the polar vector of the arc by reference.
|
|
85
|
+
*/
|
|
86
|
+
getPolarVectorByReference(): Vector3;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Get the resolution of the arc.
|
|
90
|
+
*/
|
|
91
|
+
getResolution(): number;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Get the negative flag of the arc.
|
|
95
|
+
*/
|
|
96
|
+
getNegative(): boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Get the output points precision.
|
|
100
|
+
*/
|
|
101
|
+
getOutputPointsPrecision(): DesiredOutputPrecision;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Get the use normal and angle flag.
|
|
105
|
+
*/
|
|
106
|
+
getUseNormalAndAngle(): boolean;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
* @param inData
|
|
111
|
+
* @param outData
|
|
112
|
+
*/
|
|
113
|
+
requestData(inData: any, outData: any): void;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Set the first point of the arc.
|
|
117
|
+
* @param {Vector3} point1 The first point's coordinates.
|
|
118
|
+
*/
|
|
119
|
+
setPoint1(point1: Vector3): boolean;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Set the first point of the arc by reference.
|
|
123
|
+
* @param {Vector3} point1 The first point's coordinates.
|
|
124
|
+
*/
|
|
125
|
+
setPoint1From(point1: Vector3): boolean;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Set the second point of the arc.
|
|
129
|
+
* @param {Vector3} point2 The second point's coordinates.
|
|
130
|
+
*/
|
|
131
|
+
setPoint2(point2: Vector3): boolean;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Set the second point of the arc by reference.
|
|
135
|
+
* @param {Vector3} point2 The second point's coordinates.
|
|
136
|
+
*/
|
|
137
|
+
setPoint2From(point2: Vector3): boolean;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Set the center of the arc.
|
|
141
|
+
* @param {Vector3} center The center point's coordinates.
|
|
142
|
+
*/
|
|
143
|
+
setCenter(center: Vector3): boolean;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Set the center of the arc by reference.
|
|
147
|
+
* @param {Vector3} center The center point's coordinates.
|
|
148
|
+
*/
|
|
149
|
+
setCenterFrom(center: Vector3): boolean;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Set the normal vector of the arc.
|
|
153
|
+
* @param {Vector3} normal The normal vector's coordinates.
|
|
154
|
+
*/
|
|
155
|
+
setNormal(normal: Vector3): boolean;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Set the normal vector of the arc by reference.
|
|
159
|
+
* @param {Vector3} normal The normal vector's coordinates.
|
|
160
|
+
*/
|
|
161
|
+
setNormalFrom(normal: Vector3): boolean;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Set the polar vector of the arc.
|
|
165
|
+
* @param {Vector3} polarVector The polar vector's coordinates.
|
|
166
|
+
*/
|
|
167
|
+
setPolarVector(polarVector: Vector3): boolean;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Set the polar vector of the arc by reference.
|
|
171
|
+
* @param {Vector3} polarVector The polar vector's coordinates.
|
|
172
|
+
*/
|
|
173
|
+
setPolarVectorFrom(polarVector: Vector3): boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Set the angle of the arc.
|
|
177
|
+
* @param {Number} angle The angle in radians.
|
|
178
|
+
*/
|
|
179
|
+
setAngle(angle: number): boolean;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Set the resolution of the arc.
|
|
183
|
+
* @param {Number} resolution The number of points in the arc.
|
|
184
|
+
*/
|
|
185
|
+
setResolution(resolution: number): boolean;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Set the negative flag of the arc.
|
|
189
|
+
* @param {Boolean} negative If true, the arc will be drawn in the negative direction.
|
|
190
|
+
*/
|
|
191
|
+
setNegative(negative: boolean): boolean;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Set the use normal and angle flag.
|
|
195
|
+
* @param {Boolean} useNormalAndAngle If true, the normal and angle will be used to define the arc.
|
|
196
|
+
*/
|
|
197
|
+
setUseNormalAndAngle(useNormalAndAngle: boolean): boolean;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Set the output points precision.
|
|
201
|
+
* @param {DesiredOutputPrecision} precision The desired output precision.
|
|
202
|
+
*/
|
|
203
|
+
setOutputPointsPrecision(precision: DesiredOutputPrecision): boolean;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Method used to decorate a given object (publicAPI+model) with vtkArcSource characteristics.
|
|
208
|
+
*
|
|
209
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
210
|
+
* @param model object on which data structure will be bounds (protected)
|
|
211
|
+
* @param {IArcSourceInitialValues} [initialValues] (default: {})
|
|
212
|
+
*/
|
|
213
|
+
export function extend(
|
|
214
|
+
publicAPI: object,
|
|
215
|
+
model: object,
|
|
216
|
+
initialValues?: IArcSourceInitialValues
|
|
217
|
+
): void;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Method used to create a new instance of vtkArcSource.
|
|
221
|
+
* @param {IArcSourceInitialValues} [initialValues] for pre-setting some of its content
|
|
222
|
+
*/
|
|
223
|
+
export function newInstance(
|
|
224
|
+
initialValues?: IArcSourceInitialValues
|
|
225
|
+
): vtkArcSource;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* vtkArcSource is a source object that creates an arc defined by two endpoints
|
|
229
|
+
* and a center. The number of segments composing the polyline is controlled by
|
|
230
|
+
* setting the object resolution.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```js
|
|
234
|
+
* import vtkArcSource from '@kitware/vtk.js/Filters/Sources/ArcSource';
|
|
235
|
+
*
|
|
236
|
+
* const arc = vtkArcSource.newInstance();
|
|
237
|
+
* const polydata = arc.getOutputData();
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
export declare const vtkArcSource: {
|
|
241
|
+
newInstance: typeof newInstance;
|
|
242
|
+
extend: typeof extend;
|
|
243
|
+
};
|
|
244
|
+
export default vtkArcSource;
|