@kitware/vtk.js 21.5.1 → 22.0.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/CONTRIBUTING.md +2 -2
- package/Common/Core/CellArray.js +2 -2
- package/Common/Core/DataArray.js +2 -2
- package/Common/Core/MatrixBuilder.d.ts +1 -1
- package/Common/Core/ScalarsToColors.js +12 -11
- package/Common/DataModel/BoundingBox.js +2 -2
- package/Common/DataModel/Box.js +2 -2
- package/Common/DataModel/CellTypes.js +2 -2
- package/Common/DataModel/Cylinder.js +2 -2
- package/Common/DataModel/DataSet.js +2 -2
- package/Common/DataModel/DataSetAttributes.js +2 -2
- package/Common/DataModel/ImplicitBoolean.js +2 -2
- package/Common/DataModel/Line.js +2 -2
- package/Common/DataModel/PiecewiseFunction.js +3 -3
- package/Common/DataModel/Plane.js +2 -2
- package/Common/DataModel/SelectionNode.js +2 -2
- package/Common/DataModel/Sphere.js +2 -2
- package/Common/DataModel/StructuredData.js +2 -2
- package/Common/DataModel/Triangle.js +2 -2
- package/Common/Transform/LandmarkTransform.js +2 -2
- package/Filters/Core/Cutter.js +2 -2
- package/Filters/General/Calculator.js +2 -2
- package/Filters/Sources/Arrow2DSource.js +2 -2
- package/Filters/Sources/CircleSource.js +2 -2
- package/IO/Core/DataAccessHelper/HtmlDataAccessHelper.js +6 -12
- package/IO/Core/DataAccessHelper/HttpDataAccessHelper.js +11 -19
- package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.js +8 -15
- package/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.js +11 -19
- package/IO/Core/HttpSceneLoader.js +2 -2
- package/IO/Core/ImageStream/DefaultProtocol.js +2 -6
- package/IO/Geometry/PLYWriter/Constants.js +19 -0
- package/IO/Geometry/PLYWriter.d.ts +203 -0
- package/IO/Geometry/PLYWriter.js +323 -0
- package/IO/Geometry/STLWriter.js +2 -2
- package/IO/Geometry.js +3 -1
- package/IO/XML/XMLImageDataWriter.js +2 -2
- package/IO/XML/XMLPolyDataWriter.js +2 -2
- package/Imaging/Core/AbstractImageInterpolator/InterpolationInfo.js +2 -2
- package/Imaging/Core/AbstractImageInterpolator.js +2 -2
- package/Imaging/Core/ImageInterpolator.js +12 -12
- package/Imaging/Core/ImageReslice.js +10 -10
- package/Imaging/Hybrid/SampleFunction.js +2 -2
- package/Interaction/Animations/TimeStepBasedAnimationHandler.js +2 -2
- package/Interaction/Manipulators/MouseBoxSelectorManipulator.js +2 -2
- package/Interaction/Style/InteractorStyleManipulator.js +2 -2
- package/Interaction/Style/InteractorStyleRemoteMouse.js +2 -2
- package/Interaction/UI/FPSMonitor.js +2 -2
- package/Interaction/UI/Slider.js +2 -2
- package/Interaction/Widgets/AbstractWidget.js +2 -2
- package/Interaction/Widgets/DistanceRepresentation.js +2 -2
- package/Interaction/Widgets/DistanceWidget.js +2 -2
- package/Interaction/Widgets/HandleRepresentation.js +2 -2
- package/Interaction/Widgets/HandleWidget.js +2 -2
- package/Interaction/Widgets/ImageCroppingRegionsWidget.js +2 -2
- package/Interaction/Widgets/LabelRepresentation.js +2 -2
- package/Interaction/Widgets/LabelWidget.js +2 -2
- package/Interaction/Widgets/LineRepresentation.js +2 -2
- package/Interaction/Widgets/LineWidget.js +2 -2
- package/Interaction/Widgets/OrientationMarkerWidget.js +2 -2
- package/Interaction/Widgets/PiecewiseGaussianWidget.js +2 -2
- package/Interaction/Widgets/ResliceCursor/ResliceCursor.js +2 -2
- package/Interaction/Widgets/ResliceCursor/ResliceCursorActor.js +2 -2
- package/Interaction/Widgets/ResliceCursor/ResliceCursorPolyDataAlgorithm.js +2 -2
- package/Interaction/Widgets/ResliceCursor/ResliceCursorWidget.js +2 -2
- package/Interaction/Widgets/SphereHandleRepresentation.js +2 -2
- package/Proxy/Core/PiecewiseFunctionProxy.js +2 -2
- package/Proxy/Core/ProxyManager/core.js +2 -2
- package/Proxy/Core/ProxyManager/properties.js +2 -2
- package/Proxy/Core/ProxyManager/state.js +2 -2
- package/Proxy/Representations/SliceRepresentationProxy.js +2 -2
- package/Rendering/Core/AbstractMapper.d.ts +4 -4
- package/Rendering/Core/AbstractMapper.js +18 -7
- package/Rendering/Core/Actor.js +2 -2
- package/Rendering/Core/AnnotatedCubeActor.js +2 -2
- package/Rendering/Core/AxesActor.js +2 -2
- package/Rendering/Core/CellPicker.js +2 -2
- package/Rendering/Core/ColorTransferFunction.d.ts +312 -259
- package/Rendering/Core/ColorTransferFunction.js +2 -2
- package/Rendering/Core/Coordinate.js +2 -2
- package/Rendering/Core/CubeAxesActor.js +2 -2
- package/Rendering/Core/Follower.js +2 -2
- package/Rendering/Core/Glyph3DMapper.js +2 -2
- package/Rendering/Core/ImageMapper.js +2 -2
- package/Rendering/Core/InteractorObserver.js +2 -2
- package/Rendering/Core/InteractorStyle.js +2 -2
- package/Rendering/Core/Mapper.js +2 -2
- package/Rendering/Core/Picker.js +2 -2
- package/Rendering/Core/Property.js +2 -2
- package/Rendering/Core/RenderWindowInteractor.js +9 -9
- package/Rendering/Core/ScalarBarActor.js +2 -2
- package/Rendering/Core/VolumeMapper.js +1 -4
- package/Rendering/Core/VolumeProperty.js +2 -2
- package/Rendering/Core.js +2 -2
- package/Rendering/Misc/RenderWindowWithControlBar.js +2 -2
- package/Rendering/Misc/SynchronizableRenderWindow/vtkObjectManager.js +2 -2
- package/Rendering/Misc/SynchronizableRenderWindow.js +2 -2
- package/Rendering/OpenGL/BufferObject.js +5 -5
- package/Rendering/OpenGL/CellArrayBufferObject.js +2 -1
- package/Rendering/OpenGL/Glyph3DMapper.js +2 -2
- package/Rendering/OpenGL/HardwareSelector.js +2 -2
- package/Rendering/OpenGL/RenderWindow.js +49 -5
- package/Rendering/OpenGL/SphereMapper.js +2 -2
- package/Rendering/OpenGL/StickMapper.js +2 -2
- package/Rendering/OpenGL/SurfaceLIC/SurfaceLICMapper.js +2 -2
- package/Rendering/OpenGL/Texture.js +2 -2
- package/Rendering/OpenGL/VolumeMapper.js +11 -18
- package/Rendering/WebGPU/Buffer.js +2 -2
- package/Rendering/WebGPU/BufferManager.js +2 -2
- package/Rendering/WebGPU/Glyph3DMapper.js +2 -2
- package/Rendering/WebGPU/HardwareSelector.js +1 -1
- package/Rendering/WebGPU/MapperHelper.js +2 -1
- package/Rendering/WebGPU/PolyDataMapper.js +1 -1
- package/Rendering/WebGPU/StorageBuffer.js +1 -1
- package/Rendering/WebGPU/TextureManager.js +1 -1
- package/Rendering/WebGPU/UniformBuffer.js +69 -52
- package/Rendering/WebGPU/VolumePass.js +55 -12
- package/Rendering/WebGPU/VolumePassFSQ.js +4 -1
- package/Widgets/Core/AbstractWidgetFactory.js +2 -2
- package/Widgets/Representations/ArrowHandleRepresentation.js +2 -2
- package/Widgets/Representations/ContextRepresentation.js +2 -2
- package/Widgets/Representations/HandleRepresentation.js +2 -2
- package/Widgets/Representations/PolyLineRepresentation.js +2 -2
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +2 -2
- package/Widgets/SVG/SVGLandmarkRepresentation.js +2 -2
- package/Widgets/Widgets3D/EllipseWidget/behavior.js +2 -2
- package/Widgets/Widgets3D/EllipseWidget.js +2 -2
- package/Widgets/Widgets3D/InteractiveOrientationWidget/behavior.js +2 -2
- package/Widgets/Widgets3D/LineWidget/behavior.js +2 -2
- package/Widgets/Widgets3D/RectangleWidget/behavior.js +2 -2
- package/Widgets/Widgets3D/RectangleWidget.js +2 -2
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +2 -2
- package/Widgets/Widgets3D/ShapeWidget.js +2 -2
- package/_virtual/rollup-plugin-worker-loader__module_Sources/Filters/General/PaintFilter/PaintFilter.worker.js +44 -44
- package/_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js +1 -1
- package/macros.js +2 -2
- package/package.json +52 -54
- package/vtk.js +2 -2
- package/Utilities/config/rules-linter.js +0 -13
|
@@ -115,10 +115,7 @@ function create(createOptions) {
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
return {
|
|
118
|
-
fetchArray: function fetchArray() {
|
|
119
|
-
var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
120
|
-
var baseURL = arguments.length > 1 ? arguments[1] : undefined;
|
|
121
|
-
var array = arguments.length > 2 ? arguments[2] : undefined;
|
|
118
|
+
fetchArray: function fetchArray(instance, baseURL, array) {
|
|
122
119
|
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
123
120
|
return new Promise(function (resolve, reject) {
|
|
124
121
|
if (!ready) {
|
|
@@ -127,7 +124,7 @@ function create(createOptions) {
|
|
|
127
124
|
|
|
128
125
|
var url = cleanUpPath([baseURL, array.ref.basepath, options.compression ? "".concat(array.ref.id, ".gz") : array.ref.id].join('/'));
|
|
129
126
|
|
|
130
|
-
if (++requestCount === 1 && instance.invokeBusy) {
|
|
127
|
+
if (++requestCount === 1 && instance !== null && instance !== void 0 && instance.invokeBusy) {
|
|
131
128
|
instance.invokeBusy(true);
|
|
132
129
|
}
|
|
133
130
|
|
|
@@ -135,11 +132,11 @@ function create(createOptions) {
|
|
|
135
132
|
// Done with the ref and work
|
|
136
133
|
delete array.ref;
|
|
137
134
|
|
|
138
|
-
if (--requestCount === 0 && instance.invokeBusy) {
|
|
135
|
+
if (--requestCount === 0 && instance !== null && instance !== void 0 && instance.invokeBusy) {
|
|
139
136
|
instance.invokeBusy(false);
|
|
140
137
|
}
|
|
141
138
|
|
|
142
|
-
if (instance.modified) {
|
|
139
|
+
if (instance !== null && instance !== void 0 && instance.modified) {
|
|
143
140
|
instance.modified();
|
|
144
141
|
}
|
|
145
142
|
|
|
@@ -151,8 +148,7 @@ function create(createOptions) {
|
|
|
151
148
|
zipRoot.file(url).async(asyncType).then(asyncCallback);
|
|
152
149
|
});
|
|
153
150
|
},
|
|
154
|
-
fetchJSON: function fetchJSON() {
|
|
155
|
-
var url = arguments.length > 1 ? arguments[1] : undefined;
|
|
151
|
+
fetchJSON: function fetchJSON(instance, url) {
|
|
156
152
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
157
153
|
var path = cleanUpPath(url);
|
|
158
154
|
|
|
@@ -177,8 +173,7 @@ function create(createOptions) {
|
|
|
177
173
|
return Promise.resolve(JSON.parse(str));
|
|
178
174
|
});
|
|
179
175
|
},
|
|
180
|
-
fetchText: function fetchText() {
|
|
181
|
-
var url = arguments.length > 1 ? arguments[1] : undefined;
|
|
176
|
+
fetchText: function fetchText(instance, url) {
|
|
182
177
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
183
178
|
var path = cleanUpPath(url);
|
|
184
179
|
|
|
@@ -203,8 +198,7 @@ function create(createOptions) {
|
|
|
203
198
|
return Promise.resolve(str);
|
|
204
199
|
});
|
|
205
200
|
},
|
|
206
|
-
fetchImage: function fetchImage() {
|
|
207
|
-
var url = arguments.length > 1 ? arguments[1] : undefined;
|
|
201
|
+
fetchImage: function fetchImage(instance, url) {
|
|
208
202
|
var path = cleanUpPath(url);
|
|
209
203
|
|
|
210
204
|
if (!ready) {
|
|
@@ -224,8 +218,7 @@ function create(createOptions) {
|
|
|
224
218
|
});
|
|
225
219
|
});
|
|
226
220
|
},
|
|
227
|
-
fetchBinary: function fetchBinary() {
|
|
228
|
-
var url = arguments.length > 1 ? arguments[1] : undefined;
|
|
221
|
+
fetchBinary: function fetchBinary(instance, url) {
|
|
229
222
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
230
223
|
var path = cleanUpPath(url);
|
|
231
224
|
|
|
@@ -62,10 +62,7 @@ function fetchBinary(url) {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
function fetchArray() {
|
|
66
|
-
var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
67
|
-
var baseURL = arguments.length > 1 ? arguments[1] : undefined;
|
|
68
|
-
var array = arguments.length > 2 ? arguments[2] : undefined;
|
|
65
|
+
function fetchArray(instance, baseURL, array) {
|
|
69
66
|
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
70
67
|
|
|
71
68
|
if (options && options.compression) {
|
|
@@ -81,7 +78,7 @@ function fetchArray() {
|
|
|
81
78
|
if (xhr.readyState === 1) {
|
|
82
79
|
array.ref.pending = true;
|
|
83
80
|
|
|
84
|
-
if (++requestCount === 1 && instance.invokeBusy) {
|
|
81
|
+
if (++requestCount === 1 && instance !== null && instance !== void 0 && instance.invokeBusy) {
|
|
85
82
|
instance.invokeBusy(true);
|
|
86
83
|
}
|
|
87
84
|
}
|
|
@@ -111,11 +108,11 @@ function fetchArray() {
|
|
|
111
108
|
|
|
112
109
|
delete array.ref;
|
|
113
110
|
|
|
114
|
-
if (--requestCount === 0 && instance.invokeBusy) {
|
|
111
|
+
if (--requestCount === 0 && instance !== null && instance !== void 0 && instance.invokeBusy) {
|
|
115
112
|
instance.invokeBusy(false);
|
|
116
113
|
}
|
|
117
114
|
|
|
118
|
-
if (instance.modified) {
|
|
115
|
+
if (instance !== null && instance !== void 0 && instance.modified) {
|
|
119
116
|
instance.modified();
|
|
120
117
|
}
|
|
121
118
|
|
|
@@ -139,9 +136,7 @@ function fetchArray() {
|
|
|
139
136
|
} // ----------------------------------------------------------------------------
|
|
140
137
|
|
|
141
138
|
|
|
142
|
-
function fetchJSON() {
|
|
143
|
-
var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
144
|
-
var url = arguments.length > 1 ? arguments[1] : undefined;
|
|
139
|
+
function fetchJSON(instance, url) {
|
|
145
140
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
146
141
|
|
|
147
142
|
if (options && options.compression) {
|
|
@@ -153,13 +148,13 @@ function fetchJSON() {
|
|
|
153
148
|
|
|
154
149
|
xhr.onreadystatechange = function (e) {
|
|
155
150
|
if (xhr.readyState === 1) {
|
|
156
|
-
if (++requestCount === 1 && instance.invokeBusy) {
|
|
151
|
+
if (++requestCount === 1 && instance !== null && instance !== void 0 && instance.invokeBusy) {
|
|
157
152
|
instance.invokeBusy(true);
|
|
158
153
|
}
|
|
159
154
|
}
|
|
160
155
|
|
|
161
156
|
if (xhr.readyState === 4) {
|
|
162
|
-
if (--requestCount === 0 && instance.invokeBusy) {
|
|
157
|
+
if (--requestCount === 0 && instance !== null && instance !== void 0 && instance.invokeBusy) {
|
|
163
158
|
instance.invokeBusy(false);
|
|
164
159
|
}
|
|
165
160
|
|
|
@@ -181,9 +176,7 @@ function fetchJSON() {
|
|
|
181
176
|
} // ----------------------------------------------------------------------------
|
|
182
177
|
|
|
183
178
|
|
|
184
|
-
function fetchText() {
|
|
185
|
-
var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
186
|
-
var url = arguments.length > 1 ? arguments[1] : undefined;
|
|
179
|
+
function fetchText(instance, url) {
|
|
187
180
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
188
181
|
|
|
189
182
|
if (options && options.compression) {
|
|
@@ -195,13 +188,13 @@ function fetchText() {
|
|
|
195
188
|
|
|
196
189
|
xhr.onreadystatechange = function (e) {
|
|
197
190
|
if (xhr.readyState === 1) {
|
|
198
|
-
if (++requestCount === 1 && instance.invokeBusy) {
|
|
191
|
+
if (++requestCount === 1 && instance !== null && instance !== void 0 && instance.invokeBusy) {
|
|
199
192
|
instance.invokeBusy(true);
|
|
200
193
|
}
|
|
201
194
|
}
|
|
202
195
|
|
|
203
196
|
if (xhr.readyState === 4) {
|
|
204
|
-
if (--requestCount === 0 && instance.invokeBusy) {
|
|
197
|
+
if (--requestCount === 0 && instance !== null && instance !== void 0 && instance.invokeBusy) {
|
|
205
198
|
instance.invokeBusy(false);
|
|
206
199
|
}
|
|
207
200
|
|
|
@@ -223,8 +216,7 @@ function fetchText() {
|
|
|
223
216
|
} // ----------------------------------------------------------------------------
|
|
224
217
|
|
|
225
218
|
|
|
226
|
-
function fetchImage() {
|
|
227
|
-
var url = arguments.length > 1 ? arguments[1] : undefined;
|
|
219
|
+
function fetchImage(instance, url) {
|
|
228
220
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
229
221
|
return new Promise(function (resolve, reject) {
|
|
230
222
|
var img = new Image();
|
|
@@ -16,9 +16,9 @@ import vtkTimeStepBasedAnimationHandler from '../../Interaction/Animations/TimeS
|
|
|
16
16
|
import DataAccessHelper from './DataAccessHelper.js';
|
|
17
17
|
import './DataAccessHelper/LiteHttpDataAccessHelper.js';
|
|
18
18
|
|
|
19
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
19
|
+
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; }
|
|
20
20
|
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
21
|
+
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; }
|
|
22
22
|
// import 'vtk.js/Sources/IO/Core/DataAccessHelper/HttpDataAccessHelper'; // HTTP + zip
|
|
23
23
|
// import 'vtk.js/Sources/IO/Core/DataAccessHelper/HtmlDataAccessHelper'; // html + base64 + zip
|
|
24
24
|
// import 'vtk.js/Sources/IO/Core/DataAccessHelper/JSZipDataAccessHelper'; // zip
|
|
@@ -53,13 +53,9 @@ function createMethods(session) {
|
|
|
53
53
|
var viewId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
54
54
|
return session.call('viewport.image.animation.stop', [viewId]);
|
|
55
55
|
},
|
|
56
|
-
updateCamera: function updateCamera() {
|
|
57
|
-
var viewId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
58
|
-
var focalPoint = arguments.length > 1 ? arguments[1] : undefined;
|
|
59
|
-
var viewUp = arguments.length > 2 ? arguments[2] : undefined;
|
|
60
|
-
var position = arguments.length > 3 ? arguments[3] : undefined;
|
|
56
|
+
updateCamera: function updateCamera(viewId, focalPoint, viewUp, position) {
|
|
61
57
|
var forceUpdate = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
62
|
-
return session.call('viewport.camera.update', [viewId, focalPoint, viewUp, position, forceUpdate]);
|
|
58
|
+
return session.call('viewport.camera.update', [viewId !== null && viewId !== void 0 ? viewId : -1, focalPoint, viewUp, position, forceUpdate]);
|
|
63
59
|
},
|
|
64
60
|
updateCameraParameters: function updateCameraParameters() {
|
|
65
61
|
var viewId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var FormatTypes = {
|
|
2
|
+
ASCII: 'ascii',
|
|
3
|
+
BINARY: 'binary'
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Choose the name used for the texture coordinates.
|
|
7
|
+
* (u, v) or (texture_u, texture_v)
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var TextureCoordinatesName = {
|
|
11
|
+
UV: ['u', 'v'],
|
|
12
|
+
TEXTURE_UV: ['texture_u', 'texture_v']
|
|
13
|
+
};
|
|
14
|
+
var Constants = {
|
|
15
|
+
FormatTypes: FormatTypes,
|
|
16
|
+
TextureCoordinatesName: TextureCoordinatesName
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { FormatTypes, TextureCoordinatesName, Constants as default };
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { mat4 } from "gl-matrix";
|
|
2
|
+
import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
|
|
3
|
+
import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
|
|
4
|
+
|
|
5
|
+
export enum FormatTypes {
|
|
6
|
+
ASCII,
|
|
7
|
+
BINARY
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum TextureCoordinatesName {
|
|
11
|
+
UV,
|
|
12
|
+
TEXTURE_UV
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export interface IPLYWriterInitialValues {
|
|
19
|
+
format?: FormatTypes,
|
|
20
|
+
dataByteOrder?: number,
|
|
21
|
+
comments?: string[],
|
|
22
|
+
textureFileName?: string,
|
|
23
|
+
textureCoordinatesName?: TextureCoordinatesName,
|
|
24
|
+
transform?: mat4,
|
|
25
|
+
withNormals?: boolean,
|
|
26
|
+
withUVs?: boolean,
|
|
27
|
+
withColors?: boolean,
|
|
28
|
+
withIndice?: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type vtkPLYWriterBase = vtkObject & vtkAlgorithm;
|
|
32
|
+
|
|
33
|
+
export interface vtkPLYWriter extends vtkPLYWriterBase {
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get byte order value.
|
|
37
|
+
*/
|
|
38
|
+
getDataByteOrder(): number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get file format value.
|
|
42
|
+
*/
|
|
43
|
+
getFormat(): FormatTypes;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Get header comments.
|
|
47
|
+
*/
|
|
48
|
+
getHeaderComments(): string[];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get textures mapping coordinates format.
|
|
52
|
+
*/
|
|
53
|
+
getTextureCoordinatesName(): TextureCoordinatesName;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get texture filename.
|
|
57
|
+
*/
|
|
58
|
+
getTextureFileName(): string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Get transformation matrix.
|
|
62
|
+
*/
|
|
63
|
+
getTransform(): mat4;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Get whether colors values are included.
|
|
67
|
+
*/
|
|
68
|
+
getWithColors(): boolean;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Get whether indices are included.
|
|
72
|
+
*/
|
|
73
|
+
getWithIndices(): boolean;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Get whether normals are included.
|
|
77
|
+
*/
|
|
78
|
+
getWithNormals(): boolean;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Get textures mapping coordinates.
|
|
82
|
+
*/
|
|
83
|
+
getWithUVs(): boolean;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param inData
|
|
88
|
+
* @param outData
|
|
89
|
+
*/
|
|
90
|
+
requestData(inData: any, outData: any): void;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Set byte order.
|
|
94
|
+
* @param {Number} byteOrder Byte order.
|
|
95
|
+
*/
|
|
96
|
+
setDataByteOrder(byteOrder: number): boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Set file format.
|
|
100
|
+
* @param {FormatTypes} format File format.
|
|
101
|
+
*/
|
|
102
|
+
setFormat(format: FormatTypes): boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Set header comments.
|
|
106
|
+
* @param {String[]} headerComments Header comments.
|
|
107
|
+
*/
|
|
108
|
+
setHeaderComments(headerComments: string[]): boolean;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Set textures coordinates format.
|
|
112
|
+
* @param {TextureCoordinatesName} textureCoordinatesName Textures mapping coordinates format.
|
|
113
|
+
*/
|
|
114
|
+
setTextureCoordinatesName(textureCoordinatesName: TextureCoordinatesName): boolean;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Set texture filename.
|
|
118
|
+
* @param {String} textureFileName Texture filename.
|
|
119
|
+
*/
|
|
120
|
+
setTextureFileName(textureFileName: string): boolean;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Set tranformation matrix.
|
|
124
|
+
* @param {mat4} transform Tranformation matrix.
|
|
125
|
+
*/
|
|
126
|
+
setTransform(transform: mat4): boolean;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Set colors values.
|
|
130
|
+
* @param {Boolean} withColors Include colors.
|
|
131
|
+
*/
|
|
132
|
+
setWithColors(withColors: boolean): boolean;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Set indices values.
|
|
136
|
+
* @param {Boolean} withIndices Include indices.
|
|
137
|
+
*/
|
|
138
|
+
setWithIndices(withIndices: boolean): boolean;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Set normals values.
|
|
142
|
+
* @param {Boolean} withNormals Include normals.
|
|
143
|
+
*/
|
|
144
|
+
setWithNormals(withNormals: boolean): boolean;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Set UVs values.
|
|
148
|
+
* @param {Boolean} withUVs Include textures mapping coordinates.
|
|
149
|
+
*/
|
|
150
|
+
setWithUVs(withUVs: boolean): boolean;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Method used to decorate a given object (publicAPI+model) with vtkPLYWriter characteristics.
|
|
155
|
+
*
|
|
156
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
157
|
+
* @param model object on which data structure will be bounds (protected)
|
|
158
|
+
* @param {IPLYWriterInitialValues} [initialValues] (default: {})
|
|
159
|
+
*/
|
|
160
|
+
export function extend(publicAPI: object, model: object, initialValues?: IPLYWriterInitialValues): void;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Method used to create a new instance of vtkPLYWriter
|
|
164
|
+
* @param {IPLYWriterInitialValues} [initialValues] for pre-setting some of its content
|
|
165
|
+
*/
|
|
166
|
+
export function newInstance(initialValues?: IPLYWriterInitialValues): vtkPLYWriter;
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
*
|
|
171
|
+
* @param {vktPolyData} polyData
|
|
172
|
+
* @param {FormatTypes} [format]
|
|
173
|
+
* @param {Number} [dataByteOrder]
|
|
174
|
+
* @param {String[]} [comments] Header comments.
|
|
175
|
+
* @param {String} [textureFileName] Texture file n coordinates name.
|
|
176
|
+
* @param {TextureCoordinatesName} [textureCoordinatesName] Textures mapping coordinates format.
|
|
177
|
+
* @param {mat4} [transform] Tranformation matrix.
|
|
178
|
+
* @param {Boolean} [withNormals] Include normals.
|
|
179
|
+
* @param {Boolean} [withUVs] Include textures mapping coordinates.
|
|
180
|
+
* @param {Boolean} [withColors] Include colors.
|
|
181
|
+
* @param {Boolean} [withIndice] Include indice.
|
|
182
|
+
*/
|
|
183
|
+
export function writePLY(polyData: vtkPolyData, format?: FormatTypes,
|
|
184
|
+
dataByteOrder?: number, comments?: string[], textureFileName?: string,
|
|
185
|
+
textureCoordinatesName?: TextureCoordinatesName, transform?: mat4, withNormals?: boolean,
|
|
186
|
+
withUVs?: boolean, withColors?: boolean, withIndice?: boolean): vtkPolyData;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* vtkPLYWriter writes polygonal data in Stanford University PLY format (see
|
|
190
|
+
* http://graphics.stanford.edu/data/3Dscanrep/). The data can be written in
|
|
191
|
+
* either binary (little or big endian) or ASCII representation. As for
|
|
192
|
+
* PointData and CellData, vtkPLYWriter cannot handle normals or vectors. It
|
|
193
|
+
* only handles RGB PointData and CellData. You need to set the name of the
|
|
194
|
+
* array (using SetName for the array and SetArrayName for the writer). If the
|
|
195
|
+
* array is not a vtkUnsignedCharArray with 3 or 4 components, you need to
|
|
196
|
+
* specify a vtkLookupTable to map the scalars to RGB.
|
|
197
|
+
*/
|
|
198
|
+
export declare const vtkPLYWriter: {
|
|
199
|
+
newInstance: typeof newInstance;
|
|
200
|
+
extend: typeof extend;
|
|
201
|
+
writePLY: typeof writePLY;
|
|
202
|
+
}
|
|
203
|
+
export default vtkPLYWriter;
|