@kitware/vtk.js 25.4.0 → 25.7.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/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 +970 -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/IO/Core/DataAccessHelper/HtmlDataAccessHelper.js +4 -8
- package/IO/Core/DataAccessHelper/HttpDataAccessHelper.js +6 -14
- package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.js +60 -57
- package/IO/Core/ZipMultiDataSetReader.js +19 -29
- package/IO/Core/ZipMultiDataSetWriter.js +7 -23
- package/IO/Misc/SkyboxReader.js +67 -75
- package/IO/XML/XMLReader.js +2 -2
- package/IO/XML/XMLWriter.js +2 -2
- 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/Interaction/Style/InteractorStyleTrackballCamera.js +16 -0
- 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/OpenGL/RenderWindow/ContextProxy.js +65 -0
- package/Rendering/OpenGL/RenderWindow.js +3 -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/index.js +0 -2
- package/package.json +3 -4
- package/ThirdParty/index.js +0 -9
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { strFromU8, decompressSync } from 'fflate';
|
|
2
2
|
import macro from '../../../macros.js';
|
|
3
3
|
import Base64 from '../../../Common/Core/Base64.js';
|
|
4
4
|
import Endian from '../../../Common/Core/Endian.js';
|
|
@@ -59,9 +59,7 @@ function fetchArray(instance, baseURL, array) {
|
|
|
59
59
|
var bText = atob(txt);
|
|
60
60
|
|
|
61
61
|
if (options.compression) {
|
|
62
|
-
bText =
|
|
63
|
-
to: 'string'
|
|
64
|
-
});
|
|
62
|
+
bText = strFromU8(decompressSync(bText));
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
array.values = JSON.parse(bText);
|
|
@@ -74,11 +72,9 @@ function fetchArray(instance, baseURL, array) {
|
|
|
74
72
|
|
|
75
73
|
if (options.compression) {
|
|
76
74
|
if (array.dataType === 'string' || array.dataType === 'JSON') {
|
|
77
|
-
array.buffer =
|
|
78
|
-
to: 'string'
|
|
79
|
-
});
|
|
75
|
+
array.buffer = strFromU8(decompressSync(new Uint8Array(array.buffer)));
|
|
80
76
|
} else {
|
|
81
|
-
array.buffer =
|
|
77
|
+
array.buffer = decompressSync(new Uint8Array(array.buffer)).buffer;
|
|
82
78
|
}
|
|
83
79
|
}
|
|
84
80
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
|
-
import
|
|
2
|
+
import { decompressSync, strFromU8 } from 'fflate';
|
|
3
3
|
import macro from '../../../macros.js';
|
|
4
4
|
import Endian from '../../../Common/Core/Endian.js';
|
|
5
5
|
import { DataTypeByteSize } from '../../../Common/Core/DataArray/Constants.js';
|
|
@@ -48,9 +48,7 @@ function fetchBinary(url) {
|
|
|
48
48
|
if (xhr.readyState === 4) {
|
|
49
49
|
if (xhr.status === 200 || xhr.status === 0) {
|
|
50
50
|
if (options.compression) {
|
|
51
|
-
resolve(
|
|
52
|
-
to: 'arraybuffer'
|
|
53
|
-
}).buffer);
|
|
51
|
+
resolve(decompressSync(new Uint8Array(xhr.response)).buffer);
|
|
54
52
|
} else {
|
|
55
53
|
resolve(xhr.response);
|
|
56
54
|
}
|
|
@@ -101,11 +99,9 @@ function fetchArray(instance, baseURL, array) {
|
|
|
101
99
|
|
|
102
100
|
if (options.compression) {
|
|
103
101
|
if (array.dataType === 'string' || array.dataType === 'JSON') {
|
|
104
|
-
array.buffer =
|
|
105
|
-
to: 'string'
|
|
106
|
-
});
|
|
102
|
+
array.buffer = strFromU8(decompressSync(new Uint8Array(array.buffer)));
|
|
107
103
|
} else {
|
|
108
|
-
array.buffer =
|
|
104
|
+
array.buffer = decompressSync(new Uint8Array(array.buffer)).buffer;
|
|
109
105
|
}
|
|
110
106
|
}
|
|
111
107
|
|
|
@@ -175,9 +171,7 @@ function fetchJSON(instance, url) {
|
|
|
175
171
|
|
|
176
172
|
if (xhr.status === 200 || xhr.status === 0) {
|
|
177
173
|
if (options.compression) {
|
|
178
|
-
resolve(JSON.parse(
|
|
179
|
-
to: 'string'
|
|
180
|
-
})));
|
|
174
|
+
resolve(JSON.parse(strFromU8(decompressSync(new Uint8Array(xhr.response)))));
|
|
181
175
|
} else {
|
|
182
176
|
resolve(JSON.parse(xhr.responseText));
|
|
183
177
|
}
|
|
@@ -222,9 +216,7 @@ function fetchText(instance, url) {
|
|
|
222
216
|
|
|
223
217
|
if (xhr.status === 200 || xhr.status === 0) {
|
|
224
218
|
if (options.compression) {
|
|
225
|
-
resolve(
|
|
226
|
-
to: 'string'
|
|
227
|
-
}));
|
|
219
|
+
resolve(strFromU8(decompressSync(new Uint8Array(xhr.response))));
|
|
228
220
|
} else {
|
|
229
221
|
resolve(xhr.responseText);
|
|
230
222
|
}
|