@kitware/vtk.js 25.5.0 → 25.7.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/CellArray.d.ts +20 -8
- package/Common/Core/CellArray.js +25 -6
- package/Common/Core/DataArray.d.ts +159 -15
- package/Common/Core/DataArray.js +181 -26
- package/Common/Core/Math/index.js +1 -1
- package/Common/Core/Math.js +1 -1
- package/Common/Core/Points.d.ts +6 -5
- package/Common/Core/Points.js +8 -4
- package/Common/DataModel/AbstractPointLocator.d.ts +54 -0
- package/Common/DataModel/AbstractPointLocator.js +40 -0
- package/Common/DataModel/DataSetAttributes/FieldData.d.ts +33 -22
- package/Common/DataModel/DataSetAttributes/FieldData.js +91 -9
- package/Common/DataModel/DataSetAttributes.d.ts +44 -0
- package/Common/DataModel/DataSetAttributes.js +11 -0
- package/Common/DataModel/IncrementalOctreeNode.d.ts +282 -0
- package/Common/DataModel/IncrementalOctreeNode.js +621 -0
- package/Common/DataModel/IncrementalOctreePointLocator.d.ts +61 -0
- package/Common/DataModel/IncrementalOctreePointLocator.js +342 -0
- package/Common/DataModel/Line.js +1 -1
- package/Common/DataModel/Locator.d.ts +43 -0
- package/Common/DataModel/Locator.js +37 -0
- package/Common/DataModel/Plane.js +1 -1
- package/Common/DataModel/Polygon/Constants.js +12 -0
- package/Common/DataModel/Polygon.d.ts +38 -4
- package/Common/DataModel/Polygon.js +210 -6
- package/Common/DataModel/Quad/Constants.js +9 -0
- package/Common/DataModel/Quad.d.ts +91 -0
- package/Common/DataModel/Quad.js +235 -0
- package/Common/DataModel/Triangle.d.ts +106 -81
- package/Common/DataModel/Triangle.js +1 -1
- package/Common/Transform/LandmarkTransform.js +1 -1
- package/Filters/Core/PolyDataNormals.js +1 -1
- package/Filters/General/ClipClosedSurface/Constants.js +10 -0
- package/Filters/General/ClipClosedSurface/ccsEdgeLocator.js +40 -0
- package/Filters/General/ClipClosedSurface.d.ts +95 -0
- package/Filters/General/ClipClosedSurface.js +971 -0
- package/Filters/General/ContourTriangulator/Constants.js +6 -0
- package/Filters/General/ContourTriangulator/helper.js +1951 -0
- package/Filters/General/ContourTriangulator.d.ts +122 -0
- package/Filters/General/ContourTriangulator.js +200 -0
- package/Filters/General/ImageMarchingCubes.js +1 -1
- package/Filters/General/MoleculeToRepresentation.js +1 -1
- package/Filters/General/OBBTree.js +1 -1
- package/Filters/General/TubeFilter.js +1 -1
- package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
- package/Filters/Sources/PlaneSource.js +1 -1
- package/Filters/Texture/TextureMapToPlane.js +1 -1
- package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
- package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
- package/Proxy/Core/View2DProxy.js +1 -1
- package/Rendering/Core/Actor2D.d.ts +12 -6
- package/Rendering/Core/Camera.js +1 -1
- package/Rendering/Core/CellPicker.js +3 -2
- package/Rendering/Core/ColorTransferFunction/ColorMaps.d.ts +24 -0
- package/Rendering/Core/Light.js +1 -1
- package/Rendering/Core/Picker.js +1 -1
- package/Rendering/Core/Property2D.d.ts +1 -1
- package/Rendering/Core/VolumeProperty.d.ts +4 -4
- package/Rendering/Core/VolumeProperty.js +1 -1
- package/Rendering/OpenGL/PolyDataMapper.js +1 -1
- package/Rendering/WebGPU/BufferManager.js +1 -1
- package/Rendering/WebGPU/ForwardPass.js +93 -15
- package/Rendering/WebGPU/OpaquePass.js +1 -1
- package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -1
- package/Rendering/WebGPU/RenderEncoder.js +9 -5
- package/Rendering/WebGPU/RenderWindow.js +15 -13
- package/Rendering/WebGPU/TextureView.js +15 -2
- package/Rendering/WebGPU/VolumePass.js +1 -1
- package/Widgets/Core/StateBuilder/orientationMixin.js +1 -1
- package/Widgets/Manipulators/LineManipulator.js +1 -1
- package/Widgets/Manipulators/TrackballManipulator.js +1 -1
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
- package/Widgets/Widgets3D/LineWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
- package/index.d.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
2
|
+
import { Nullable, TypedArray, Vector3 } from './../../types';
|
|
3
|
+
import vtkCellArray from './../../Common/Core/CellArray';
|
|
4
|
+
import vtkPolyData from './../../Common/DataModel/PolyData';
|
|
5
|
+
import vtkPoints from './../../Common/Core/Points';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export interface IContourTriangulatorInitialValues {
|
|
11
|
+
triangulatePolys?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type vtkContourTriangulatorBase = vtkObject & vtkAlgorithm;
|
|
15
|
+
|
|
16
|
+
export interface vtkContourTriangulator extends vtkContourTriangulatorBase {
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param {any} inData
|
|
20
|
+
* @param {any} outData
|
|
21
|
+
*/
|
|
22
|
+
requestData(inData: any, outData: any): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// ----------------------------------------------------------------------------
|
|
26
|
+
// Static API
|
|
27
|
+
// ----------------------------------------------------------------------------
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This is a complex subroutine that takes a collection of lines that
|
|
31
|
+
* were formed by cutting a polydata with a plane, and generates
|
|
32
|
+
* a face that has those lines as its edges. The lines must form one
|
|
33
|
+
* or more closed contours, but they need not be sorted.
|
|
34
|
+
*
|
|
35
|
+
* Only "numLine" lines starting from "firstLine" are used to create new
|
|
36
|
+
* polygons, and the new polygons are appended to "polys". The normal of
|
|
37
|
+
* the cut plane must be provided so that polys will be correctly oriented.
|
|
38
|
+
*
|
|
39
|
+
* Given some closed contour lines, create a triangle mesh that fills
|
|
40
|
+
* those lines. The input lines do not have to be in tail-to-tip order.
|
|
41
|
+
* Only numLines starting from firstLine will be used. Note that holes
|
|
42
|
+
* can be indicated by contour loops whose normals are in the opposite
|
|
43
|
+
* direction to the provided normal.
|
|
44
|
+
*
|
|
45
|
+
* @param {vtkPolyData} polyData
|
|
46
|
+
* @param {Number} firstLine
|
|
47
|
+
* @param {Number} numLines
|
|
48
|
+
* @param {vtkCellArray} polys
|
|
49
|
+
* @param {Nullable<Vector3>} normal If null, the function will compute
|
|
50
|
+
* the normal of the polys.
|
|
51
|
+
* @param {Boolean} [triangulatePolys] (default: true) If set to true
|
|
52
|
+
* the resulting polygons will be triangulated, otherwise the polygons
|
|
53
|
+
* themselves will be added to the output.
|
|
54
|
+
* @param {Boolean} [diagnoseOnTriangulationError] (default: false)
|
|
55
|
+
* If this option is set to true and there was a triangulation error
|
|
56
|
+
* this will add the polys as outlines to the output.
|
|
57
|
+
* @returns {Boolean} Returns true if triangulation was successful,
|
|
58
|
+
* false otherwise.
|
|
59
|
+
*/
|
|
60
|
+
export function triangulateContours(
|
|
61
|
+
polyData: vtkPolyData,
|
|
62
|
+
firstLine: number,
|
|
63
|
+
numLines: number,
|
|
64
|
+
polys: vtkCellArray,
|
|
65
|
+
normal: Nullable<Vector3>,
|
|
66
|
+
triangulatePolys?: boolean,
|
|
67
|
+
diagnoseOnTriangulationError?: boolean
|
|
68
|
+
): boolean;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A robust method for triangulating a polygon. It cleans up the polygon
|
|
72
|
+
* and then applies the ear-cut triangulation. A zero return value
|
|
73
|
+
* indicates that triangulation failed.
|
|
74
|
+
*
|
|
75
|
+
* @param {Array<Number>|TypedArray} polygon Array of point indices defining the polygon
|
|
76
|
+
* @param {vtkPoints} points The point coordinates of the polygon
|
|
77
|
+
* @param {vtkCellArray} triangles The cell array that is going to be
|
|
78
|
+
* filled with the triangulation
|
|
79
|
+
* @returns {Boolean} Returns true if triangulation was successful,
|
|
80
|
+
* false otherwise.
|
|
81
|
+
*/
|
|
82
|
+
export function triangulatePolygon(
|
|
83
|
+
polygon: Array<number> | TypedArray,
|
|
84
|
+
points: vtkPoints,
|
|
85
|
+
triangles: vtkCellArray
|
|
86
|
+
): boolean;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Method use to decorate a given object (publicAPI+model) with vtkContourTriangulator characteristics.
|
|
90
|
+
*
|
|
91
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
92
|
+
* @param model object on which data structure will be bounds (protected)
|
|
93
|
+
* @param {IContourTriangulatorInitialValues} [initialValues] (default: {})
|
|
94
|
+
*/
|
|
95
|
+
export function extend(
|
|
96
|
+
publicAPI: object,
|
|
97
|
+
model: object,
|
|
98
|
+
initialValues?: IContourTriangulatorInitialValues
|
|
99
|
+
): void;
|
|
100
|
+
|
|
101
|
+
// ----------------------------------------------------------------------------
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Method use to create a new instance of vtkContourTriangulator
|
|
105
|
+
* @param {IContourTriangulatorInitialValues} [initialValues] for pre-setting some of its content
|
|
106
|
+
*/
|
|
107
|
+
export function newInstance(
|
|
108
|
+
initialValues?: IContourTriangulatorInitialValues
|
|
109
|
+
): vtkContourTriangulator;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* vtkContourTriangulator
|
|
113
|
+
*/
|
|
114
|
+
export declare const vtkContourTriangulator: {
|
|
115
|
+
newInstance: typeof newInstance;
|
|
116
|
+
extend: typeof extend;
|
|
117
|
+
// static
|
|
118
|
+
triangulateContours: typeof triangulateContours;
|
|
119
|
+
triangulatePolygon: typeof triangulatePolygon;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export default vtkContourTriangulator;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
|
+
import macro from '../../macros.js';
|
|
4
|
+
import vtkCellArray from '../../Common/Core/CellArray.js';
|
|
5
|
+
import vtkPolygon from '../../Common/DataModel/Polygon.js';
|
|
6
|
+
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
7
|
+
import { VtkDataTypes } from '../../Common/Core/DataArray/Constants.js';
|
|
8
|
+
import { vtkCCSMakePolysFromLines, vtkCCSJoinLooseEnds, vtkCCSFindTrueEdges, vtkCCSMakeHoleyPolys, vtkCCSCutHoleyPolys, vtkCCSSplitAtPinchPoints, vtkCCSTriangulate } from './ContourTriangulator/helper.js';
|
|
9
|
+
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
+
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
+
var vtkErrorMacro = macro.vtkErrorMacro;
|
|
14
|
+
var TRIANGULATION_ERROR_DISPLAY = false;
|
|
15
|
+
|
|
16
|
+
function triangulateContours(polyData, firstLine, numLines, polys, normal) {
|
|
17
|
+
var triangulatePolys = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
18
|
+
var triangulationFailure = false; // If no cut lines were generated, there's nothing to do
|
|
19
|
+
|
|
20
|
+
if (numLines <= 0) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var points = polyData.getPoints(); // Join all the new lines into connected groups, i.e. polygons.
|
|
25
|
+
// If we are lucky these will be simple, convex polygons. But
|
|
26
|
+
// we can't count on that.
|
|
27
|
+
|
|
28
|
+
var newPolys = [];
|
|
29
|
+
var incompletePolys = [];
|
|
30
|
+
var oriented = normal != null;
|
|
31
|
+
vtkCCSMakePolysFromLines(polyData, firstLine, firstLine + numLines, oriented, newPolys, incompletePolys); // if no normal specified, then compute one from largest contour
|
|
32
|
+
|
|
33
|
+
var computedNormal = normal;
|
|
34
|
+
|
|
35
|
+
if (normal == null) {
|
|
36
|
+
var maxnorm = 0;
|
|
37
|
+
var n = [];
|
|
38
|
+
|
|
39
|
+
for (var i = 0; i < newPolys.length; i++) {
|
|
40
|
+
var norm = vtkPolygon.getNormal(newPolys[i], points, n);
|
|
41
|
+
|
|
42
|
+
if (norm > maxnorm) {
|
|
43
|
+
maxnorm = norm;
|
|
44
|
+
computedNormal[0] = n[0];
|
|
45
|
+
computedNormal[1] = n[1];
|
|
46
|
+
computedNormal[2] = n[2];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
} // Join any loose ends. If the input was a closed surface then there
|
|
50
|
+
// will not be any loose ends, so this is provided as a service to users
|
|
51
|
+
// who want to clip a non-closed surface.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
vtkCCSJoinLooseEnds(newPolys, incompletePolys, points, computedNormal); // Some points might be in the middle of straight line segments.
|
|
55
|
+
// These points can be removed without changing the shape of the
|
|
56
|
+
// polys, and removing them makes triangulation more stable.
|
|
57
|
+
// Unfortunately removing these points also means that the polys
|
|
58
|
+
// will no longer form a watertight cap over the cut.
|
|
59
|
+
|
|
60
|
+
var polyEdges = [];
|
|
61
|
+
var originalEdges = [];
|
|
62
|
+
vtkCCSFindTrueEdges(newPolys, points, polyEdges, originalEdges); // Next we have to check for polygons with holes, i.e. polygons that
|
|
63
|
+
// have other polygons inside. Each polygon is "grouped" with the
|
|
64
|
+
// polygons that make up its holes.
|
|
65
|
+
// Initialize each group to hold just one polygon.
|
|
66
|
+
|
|
67
|
+
var numNewPolys = newPolys.length;
|
|
68
|
+
var polyGroups = [];
|
|
69
|
+
|
|
70
|
+
for (var _i = 0; _i < numNewPolys; _i++) {
|
|
71
|
+
polyGroups[_i] = [_i];
|
|
72
|
+
} // Find out which polys are holes in larger polys. Create a group
|
|
73
|
+
// for each poly where the first member of the group is the larger
|
|
74
|
+
// poly, and all other members are the holes. The number of polyGroups
|
|
75
|
+
// will be the same as the number of polys, and any polys that are
|
|
76
|
+
// holes will have a matching empty group.
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
vtkCCSMakeHoleyPolys(newPolys, points, polyGroups, polyEdges, originalEdges, computedNormal, oriented); // Make cuts to create simple polygons out of the holey polys.
|
|
80
|
+
// After this is done, each polyGroup will have exactly 1 polygon,
|
|
81
|
+
// and no polys will be holes. This is currently the most computationally
|
|
82
|
+
// expensive part of the process.
|
|
83
|
+
|
|
84
|
+
if (!vtkCCSCutHoleyPolys(newPolys, points, polyGroups, polyEdges, computedNormal)) {
|
|
85
|
+
triangulationFailure = true;
|
|
86
|
+
} // Some polys might be self-intersecting. Split the polys at each intersection point.
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
vtkCCSSplitAtPinchPoints(newPolys, points, polyGroups, polyEdges, computedNormal, oriented); // ------ Triangulation code ------
|
|
90
|
+
// Go through all polys and triangulate them
|
|
91
|
+
|
|
92
|
+
for (var polyId = 0; polyId < polyGroups.length; polyId++) {
|
|
93
|
+
// If group is empty, then poly was a hole without a containing poly
|
|
94
|
+
if (polyGroups[polyId].length === 0) {
|
|
95
|
+
// eslint-disable-next-line no-continue
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (!triangulatePolys) {
|
|
100
|
+
polys.insertNextCell(originalEdges.slice(1, originalEdges.length));
|
|
101
|
+
} else if (!vtkCCSTriangulate(newPolys[polyId], points, polyEdges[polyId], originalEdges, polys, computedNormal)) {
|
|
102
|
+
triangulationFailure = false; // Diagnostic code: show the polys as outlines
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return !triangulationFailure;
|
|
107
|
+
} // ---------------------------------------------------
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
function triangulatePolygon(polygon, points, triangles) {
|
|
111
|
+
var poly = _toConsumableArray(polygon);
|
|
112
|
+
|
|
113
|
+
var polys = [poly];
|
|
114
|
+
var originalEdges = [];
|
|
115
|
+
var polyEdges = [];
|
|
116
|
+
vtkCCSFindTrueEdges(polys, points, polyEdges, originalEdges);
|
|
117
|
+
var edges = polyEdges[0];
|
|
118
|
+
var success = true;
|
|
119
|
+
var normal = [];
|
|
120
|
+
var norm = vtkPolygon.getNormal(poly, points, normal);
|
|
121
|
+
|
|
122
|
+
if (norm !== 0) {
|
|
123
|
+
success = vtkCCSTriangulate(poly, points, edges, originalEdges, triangles, normal);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return success;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
var STATIC = {
|
|
130
|
+
triangulateContours: triangulateContours,
|
|
131
|
+
triangulatePolygon: triangulatePolygon
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
function vtkContourTriangulator(publicAPI, model) {
|
|
135
|
+
// Set our className
|
|
136
|
+
model.classHierarchy.push('vtkContourTriangulator');
|
|
137
|
+
|
|
138
|
+
publicAPI.requestData = function (inData, outData) {
|
|
139
|
+
// implement requestData
|
|
140
|
+
var input = inData[0];
|
|
141
|
+
var output = vtkPolyData.newInstance();
|
|
142
|
+
outData[0] = output;
|
|
143
|
+
|
|
144
|
+
if (!input) {
|
|
145
|
+
vtkErrorMacro('Invalid or missing input');
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
var triangulationError = false;
|
|
150
|
+
var lines = input.getLines();
|
|
151
|
+
|
|
152
|
+
if (lines == null || lines.getNumberOfCells() === 0) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
input.buildCells();
|
|
157
|
+
var polysArray = vtkCellArray.newInstance({
|
|
158
|
+
dataType: VtkDataTypes.DOUBLE,
|
|
159
|
+
empty: true
|
|
160
|
+
});
|
|
161
|
+
output.setPolys(polysArray);
|
|
162
|
+
output.setPoints(input.getPoints());
|
|
163
|
+
output.getPointData().passData(input.getPointData());
|
|
164
|
+
triangulationError = !triangulateContours(input, input.getNumberOfVerts(), lines.getNumberOfCells(), polysArray, [], model.triangulatePolys);
|
|
165
|
+
|
|
166
|
+
if (triangulationError && TRIANGULATION_ERROR_DISPLAY) {
|
|
167
|
+
vtkErrorMacro('Triangulation failed, output might have holes.');
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return true;
|
|
171
|
+
};
|
|
172
|
+
} // ----------------------------------------------------------------------------
|
|
173
|
+
// Object factory
|
|
174
|
+
// ----------------------------------------------------------------------------
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
var DEFAULT_VALUES = {
|
|
178
|
+
triangulatePolys: true
|
|
179
|
+
}; // ----------------------------------------------------------------------------
|
|
180
|
+
|
|
181
|
+
function extend(publicAPI, model) {
|
|
182
|
+
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
183
|
+
Object.assign(model, DEFAULT_VALUES, initialValues); // Make this a VTK object
|
|
184
|
+
|
|
185
|
+
macro.obj(publicAPI, model); // Also make it an algorithm with one input and one output
|
|
186
|
+
|
|
187
|
+
macro.algo(publicAPI, model, 1, 1);
|
|
188
|
+
macro.setGet(publicAPI, model, ['triangulate']); // Object specific methods
|
|
189
|
+
|
|
190
|
+
vtkContourTriangulator(publicAPI, model);
|
|
191
|
+
} // ----------------------------------------------------------------------------
|
|
192
|
+
|
|
193
|
+
var newInstance = macro.newInstance(extend, 'vtkContourTriangulator'); // ----------------------------------------------------------------------------
|
|
194
|
+
|
|
195
|
+
var vtkContourTriangulator$1 = _objectSpread({
|
|
196
|
+
newInstance: newInstance,
|
|
197
|
+
extend: extend
|
|
198
|
+
}, STATIC);
|
|
199
|
+
|
|
200
|
+
export { STATIC, vtkContourTriangulator$1 as default, extend, newInstance };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
3
3
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
4
|
-
import {
|
|
4
|
+
import { m as normalize } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkCaseTable from './ImageMarchingCubes/caseTable.js';
|
|
6
6
|
|
|
7
7
|
var vtkErrorMacro = macro.vtkErrorMacro,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
3
3
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
4
|
-
import {
|
|
4
|
+
import { m as normalize } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import { a as atomElem } from '../../Utilities/XMLConverter/chemistry/elements.json.js';
|
|
6
6
|
|
|
7
7
|
var vtkErrorMacro = macro.vtkErrorMacro,
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkCellArray from '../../Common/Core/CellArray.js';
|
|
4
4
|
import vtkLine from '../../Common/DataModel/Line.js';
|
|
5
|
-
import { d as dot,
|
|
5
|
+
import { d as dot, k as cross, n as norm, w as jacobi, m as normalize, l as add } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
7
7
|
import vtkOBBNode from './OBBTree/OBBNode.js';
|
|
8
8
|
import vtkPoints from '../../Common/Core/Points.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkCellArray from '../../Common/Core/CellArray.js';
|
|
3
3
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
4
|
-
import {
|
|
4
|
+
import { m as normalize, k as cross, n as norm, d as dot, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkPoints from '../../Common/Core/Points.js';
|
|
6
6
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
7
7
|
import { DesiredOutputPrecision } from '../../Common/DataModel/DataSetAttributes/Constants.js';
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
4
4
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
5
|
-
import {
|
|
5
|
+
import { g as vtkMath } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import { AttributeTypes } from '../../Common/DataModel/DataSetAttributes/Constants.js';
|
|
7
7
|
import vtkPoints from '../../Common/Core/Points.js';
|
|
8
8
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
2
2
|
import { mat4, vec3 } from 'gl-matrix';
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
4
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
5
|
-
import { s as subtract,
|
|
5
|
+
import { s as subtract, m as normalize, d as dot, k as cross, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
7
7
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
3
|
-
import {
|
|
3
|
+
import { m as normalize, d as dot, k as cross, f as distance2BetweenPoints, z as determinant3x3, A as rowsToMat3 } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
5
5
|
|
|
6
6
|
var vtkErrorMacro = macro.vtkErrorMacro; // ----------------------------------------------------------------------------
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
3
3
|
import vtkCompositeKeyboardManipulator from './CompositeKeyboardManipulator.js';
|
|
4
|
-
import {
|
|
4
|
+
import { l as add, m as normalize, k as cross } from '../../Common/Core/Math/index.js';
|
|
5
5
|
|
|
6
6
|
var vtkErrorMacro = macro.vtkErrorMacro;
|
|
7
7
|
var ANIMATION_REQUESTER = 'vtkKeyboardCameraManipulator'; // ----------------------------------------------------------------------------
|
|
@@ -3,7 +3,7 @@ import { mat4, vec3 } from 'gl-matrix';
|
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
4
|
import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
|
|
5
5
|
import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
6
|
-
import { r as radiansFromDegrees,
|
|
6
|
+
import { r as radiansFromDegrees, k as cross } from '../../Common/Core/Math/index.js';
|
|
7
7
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
8
8
|
|
|
9
9
|
// vtkMouseCameraAxisRotateManipulator methods
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
|
|
3
3
|
import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
4
|
-
import {
|
|
4
|
+
import { k as cross } from '../../Common/Core/Math/index.js';
|
|
5
5
|
|
|
6
6
|
// vtkMouseCameraTrackballPanManipulator methods
|
|
7
7
|
// ----------------------------------------------------------------------------
|
|
@@ -2,7 +2,7 @@ import { mat4, vec3 } from 'gl-matrix';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
|
|
4
4
|
import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
5
|
-
import { x as multiplyScalar, d as dot,
|
|
5
|
+
import { x as multiplyScalar, d as dot, l as add, r as radiansFromDegrees, k as cross } from '../../Common/Core/Math/index.js';
|
|
6
6
|
|
|
7
7
|
// vtkMouseCameraTrackballRotateManipulator methods
|
|
8
8
|
// ----------------------------------------------------------------------------
|
|
@@ -5,7 +5,7 @@ import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
|
5
5
|
import vtkInteractorStyleConstants from '../../Rendering/Core/InteractorStyle/Constants.js';
|
|
6
6
|
import vtkMouseCameraUnicamRotateManipulator from './MouseCameraUnicamRotateManipulator.js';
|
|
7
7
|
import macro from '../../macros.js';
|
|
8
|
-
import { s as subtract, x as multiplyScalar,
|
|
8
|
+
import { s as subtract, x as multiplyScalar, m as normalize, d as dot, r as radiansFromDegrees, k as cross } from '../../Common/Core/Math/index.js';
|
|
9
9
|
|
|
10
10
|
var States = vtkInteractorStyleConstants.States; // ----------------------------------------------------------------------------
|
|
11
11
|
// vtkMouseCameraUnicamManipulator methods
|
|
@@ -10,7 +10,7 @@ import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
|
|
|
10
10
|
import { FieldAssociations } from '../../Common/DataModel/DataSet/Constants.js';
|
|
11
11
|
import { mat4, vec3 } from 'gl-matrix';
|
|
12
12
|
import macro from '../../macros.js';
|
|
13
|
-
import { C as areEquals,
|
|
13
|
+
import { C as areEquals, m as normalize, d as dot, D as clampValue, s as subtract, k as cross, x as multiplyScalar, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
14
14
|
|
|
15
15
|
var States = vtkInteractorStyleConstants.States; // ----------------------------------------------------------------------------
|
|
16
16
|
// vtkMouseCameraUnicamRotateManipulator methods
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
|
-
import {
|
|
3
|
+
import { m as normalize, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
5
5
|
import vtkInteractorStyleManipulator from './InteractorStyleManipulator.js';
|
|
6
6
|
import vtkMouseCameraTrackballRotateManipulator from '../Manipulators/MouseCameraTrackballRotateManipulator.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkMouseRangeManipulator from '../../Interaction/Manipulators/MouseRangeManipulator.js';
|
|
3
3
|
import vtkViewProxy from './ViewProxy.js';
|
|
4
|
-
import {
|
|
4
|
+
import { k as cross, F as getMajorAxisIndex } from '../../Common/Core/Math/index.js';
|
|
5
5
|
|
|
6
6
|
var DEFAULT_STEP_WIDTH = 512;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import vtkProp, { IPropInitialValues } from './Prop';
|
|
2
2
|
import vtkCoordinate from './Coordinate';
|
|
3
3
|
import vtkMapper from './Mapper';
|
|
4
|
-
import
|
|
4
|
+
import vtkProperty2D, { IProperty2DInitialValues } from './Property2D';
|
|
5
5
|
import { Bounds } from './../../types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -9,7 +9,7 @@ import { Bounds } from './../../types';
|
|
|
9
9
|
*/
|
|
10
10
|
export interface IActor2DInitialValues extends IPropInitialValues {
|
|
11
11
|
mapper?: vtkMapper;
|
|
12
|
-
property?:
|
|
12
|
+
property?: vtkProperty2D;
|
|
13
13
|
layerNumber?: number;
|
|
14
14
|
positionCoordinate?: vtkCoordinate;
|
|
15
15
|
positionCoordinate2?: vtkCoordinate;
|
|
@@ -31,12 +31,18 @@ export interface vtkActor2D extends vtkProp {
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Return the property object that controls this actors surface
|
|
34
|
-
* properties. This should be an instance of a
|
|
34
|
+
* properties. This should be an instance of a vtkProperty2D object. Every
|
|
35
35
|
* actor must have a property associated with it. If one isn’t specified,
|
|
36
36
|
* then one will be generated automatically. Multiple actors can share one
|
|
37
37
|
* property object.
|
|
38
38
|
*/
|
|
39
|
-
getProperty():
|
|
39
|
+
getProperty(): vtkProperty2D;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Create a new property suitable for use with this type of Actor.
|
|
43
|
+
* @param {IProperty2DInitialValues} [initialValues] (default: {})
|
|
44
|
+
*/
|
|
45
|
+
makeProperty(initialValues?: IProperty2DInitialValues): vtkProperty2D;
|
|
40
46
|
|
|
41
47
|
/**
|
|
42
48
|
*
|
|
@@ -112,8 +118,8 @@ export function newInstance(initialValues?: IActor2DInitialValues): vtkActor2D;
|
|
|
112
118
|
* vtkProp. The actor also has scaling and maintains a reference to the
|
|
113
119
|
* defining geometry (i.e., the mapper), rendering properties, and possibly a
|
|
114
120
|
* texture map.
|
|
115
|
-
* @see [
|
|
116
|
-
* @see [
|
|
121
|
+
* @see [vtkMapper2D](./Rendering_Core_Mapper2D.html)
|
|
122
|
+
* @see [vtkProperty2D](./Rendering_Core_Property2D.html)
|
|
117
123
|
*/
|
|
118
124
|
export declare const vtkActor2D: {
|
|
119
125
|
newInstance: typeof newInstance,
|
package/Rendering/Core/Camera.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import { mat4, vec4, vec3, quat } from 'gl-matrix';
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
|
-
import { r as radiansFromDegrees,
|
|
4
|
+
import { r as radiansFromDegrees, l as add, k as cross } from '../../Common/Core/Math/index.js';
|
|
5
5
|
|
|
6
6
|
var vtkDebugMacro = macro.vtkDebugMacro;
|
|
7
7
|
/* eslint-disable new-cap */
|
|
@@ -5,7 +5,8 @@ import vtkLine from '../../Common/DataModel/Line.js';
|
|
|
5
5
|
import vtkPicker from './Picker.js';
|
|
6
6
|
import vtkPolyLine from '../../Common/DataModel/PolyLine.js';
|
|
7
7
|
import vtkTriangle from '../../Common/DataModel/Triangle.js';
|
|
8
|
-
import
|
|
8
|
+
import vtkQuad from '../../Common/DataModel/Quad.js';
|
|
9
|
+
import { m as normalize } from '../../Common/Core/Math/index.js';
|
|
9
10
|
import { CellType } from '../../Common/DataModel/CellTypes/Constants.js';
|
|
10
11
|
import { vec3 } from 'gl-matrix';
|
|
11
12
|
|
|
@@ -18,7 +19,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
18
19
|
function createCellMap() {
|
|
19
20
|
var _ref;
|
|
20
21
|
|
|
21
|
-
return _ref = {}, _defineProperty(_ref, CellType.VTK_LINE, vtkLine.newInstance()), _defineProperty(_ref, CellType.VTK_POLY_LINE, vtkPolyLine.newInstance()), _defineProperty(_ref, CellType.VTK_TRIANGLE, vtkTriangle.newInstance()), _ref;
|
|
22
|
+
return _ref = {}, _defineProperty(_ref, CellType.VTK_LINE, vtkLine.newInstance()), _defineProperty(_ref, CellType.VTK_POLY_LINE, vtkPolyLine.newInstance()), _defineProperty(_ref, CellType.VTK_TRIANGLE, vtkTriangle.newInstance()), _defineProperty(_ref, CellType.VTK_QUAD, vtkQuad.newInstance()), _ref;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
function clipLineWithPlane(mapper, matrix, p1, p2) {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vtkColorMaps represents a global registry of preset color maps.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Vector3 } from '../../../types';
|
|
6
|
+
|
|
7
|
+
export interface IColorMapPreset {
|
|
8
|
+
Name: string;
|
|
9
|
+
Creator?: string;
|
|
10
|
+
ColorSpace?: string;
|
|
11
|
+
NanColor?: Vector3;
|
|
12
|
+
RGBPoints: number[];
|
|
13
|
+
IndexedColors?: number[];
|
|
14
|
+
Annotations?: (number | string)[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare const vtkColorMaps: {
|
|
18
|
+
addPreset(preset: IColorMapPreset): void;
|
|
19
|
+
removePresetByName(name: string): void;
|
|
20
|
+
getPresetByName(name: string): IColorMapPreset;
|
|
21
|
+
rgbPresetNames: string[];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default vtkColorMaps;
|
package/Rendering/Core/Light.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
|
-
import {
|
|
2
|
+
import { m as normalize, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
|
|
3
3
|
import { vec3 } from 'gl-matrix';
|
|
4
4
|
|
|
5
5
|
var LIGHT_TYPES = ['HeadLight', 'CameraLight', 'SceneLight']; // ----------------------------------------------------------------------------
|
package/Rendering/Core/Picker.js
CHANGED
|
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkAbstractPicker from './AbstractPicker.js';
|
|
4
4
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
5
|
-
import { d as dot,
|
|
5
|
+
import { d as dot, m as normalize, n as norm, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import { mat4, vec4 } from 'gl-matrix';
|
|
7
7
|
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -2,7 +2,7 @@ import { vtkObject } from './../../interfaces';
|
|
|
2
2
|
import { RGBColor } from './../../types';
|
|
3
3
|
import { DisplayLocation } from './Property2D/Constants';
|
|
4
4
|
|
|
5
|
-
interface IProperty2DInitialValues{
|
|
5
|
+
export interface IProperty2DInitialValues{
|
|
6
6
|
color?: RGBColor;
|
|
7
7
|
opacity?: number;
|
|
8
8
|
pointSize?: number;
|
|
@@ -5,7 +5,7 @@ import { InterpolationType, OpacityMode } from './VolumeProperty/Constants';
|
|
|
5
5
|
|
|
6
6
|
export interface IVolumePropertyInitialValues {
|
|
7
7
|
independentComponents?: boolean;
|
|
8
|
-
shade?:
|
|
8
|
+
shade?: boolean;
|
|
9
9
|
ambient?: number;
|
|
10
10
|
diffuse?: number;
|
|
11
11
|
specular?: number;
|
|
@@ -111,7 +111,7 @@ export interface vtkVolumeProperty extends vtkObject {
|
|
|
111
111
|
/**
|
|
112
112
|
* Get the shading of a volume.
|
|
113
113
|
*/
|
|
114
|
-
getShade():
|
|
114
|
+
getShade(): boolean;
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
*
|
|
@@ -236,9 +236,9 @@ export interface vtkVolumeProperty extends vtkObject {
|
|
|
236
236
|
* turning shading off is generally the same as setting ambient=1,
|
|
237
237
|
* diffuse=0, specular=0. Shading can be independently turned on/off per
|
|
238
238
|
* component.
|
|
239
|
-
* @param {
|
|
239
|
+
* @param {Boolean} shade
|
|
240
240
|
*/
|
|
241
|
-
setShade(shade:
|
|
241
|
+
setShade(shade: boolean): boolean;
|
|
242
242
|
|
|
243
243
|
/**
|
|
244
244
|
*
|