@kitware/vtk.js 32.3.2 → 32.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/Core/Math/index.js +12 -1
- package/Common/Core/Math.d.ts +5 -0
- package/Common/Core/Math.js +1 -1
- package/IO/Image/HDRReader/Utils.js +44 -0
- package/IO/Image/HDRReader.d.ts +121 -0
- package/IO/Image/HDRReader.js +373 -0
- package/IO/Image.js +7 -0
- package/IO/Misc/GCodeReader.d.ts +128 -0
- package/IO/Misc/GCodeReader.js +236 -0
- package/IO/Misc.js +3 -1
- package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
- package/Interaction/Style/InteractorStyleTrackballCamera.js +1 -1
- package/Interaction/Widgets/PiecewiseGaussianWidget.js +1 -1
- package/Proxy/Core/View2DProxy.js +1 -1
- package/Rendering/Core/AbstractImageMapper.js +1 -1
- package/Rendering/Core/AbstractMapper3D.js +1 -1
- package/Rendering/Core/ColorTransferFunction/CssFilters.js +1 -1
- package/Rendering/Core/ColorTransferFunction.js +1 -1
- package/Rendering/Core/Coordinate.js +1 -1
- package/Rendering/Core/CubeAxesActor.js +1 -1
- package/Rendering/Core/Glyph3DMapper.js +1 -1
- package/Rendering/Core/ImageArrayMapper.js +1 -1
- package/Rendering/Core/ImageMapper.js +1 -1
- package/Rendering/Core/Mapper.js +1 -1
- package/Rendering/Core/Prop3D.js +1 -1
- package/Rendering/Core/RenderWindowInteractor.js +1 -1
- package/Rendering/Core/Renderer.js +1 -1
- package/Rendering/Core/ScalarBarActor.js +1 -1
- package/Rendering/Core/VolumeMapper.js +1 -1
- package/Rendering/OpenGL/PolyDataMapper2D.js +1 -1
- package/Rendering/OpenGL/Texture.js +1 -1
- package/Widgets/Representations/PolyLineRepresentation.js +1 -1
- package/Widgets/Widgets3D/AngleWidget.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/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
2
|
+
import HtmlDataAccessHelper from './../Core/DataAccessHelper/HtmlDataAccessHelper';
|
|
3
|
+
import HttpDataAccessHelper from './../Core/DataAccessHelper/HttpDataAccessHelper';
|
|
4
|
+
import JSZipDataAccessHelper from './../Core/DataAccessHelper/JSZipDataAccessHelper';
|
|
5
|
+
import LiteHttpDataAccessHelper from './../Core/DataAccessHelper/LiteHttpDataAccessHelper';
|
|
6
|
+
|
|
7
|
+
interface IGCodeReaderOptions {
|
|
8
|
+
binary?: boolean;
|
|
9
|
+
compression?: string;
|
|
10
|
+
progressCallback?: any;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export interface IGCodeReaderInitialValues {}
|
|
17
|
+
|
|
18
|
+
type vtkGCodeReaderBase = vtkObject &
|
|
19
|
+
Omit<
|
|
20
|
+
vtkAlgorithm,
|
|
21
|
+
| 'getInputData'
|
|
22
|
+
| 'setInputData'
|
|
23
|
+
| 'setInputConnection'
|
|
24
|
+
| 'getInputConnection'
|
|
25
|
+
| 'addInputConnection'
|
|
26
|
+
| 'addInputData'
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
export interface vtkGCodeReader extends vtkGCodeReaderBase {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
getBaseURL(): string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
getDataAccessHelper():
|
|
39
|
+
| HtmlDataAccessHelper
|
|
40
|
+
| HttpDataAccessHelper
|
|
41
|
+
| JSZipDataAccessHelper
|
|
42
|
+
| LiteHttpDataAccessHelper;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get the url of the object to load.
|
|
46
|
+
*/
|
|
47
|
+
getUrl(): string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Load the object data.
|
|
51
|
+
* @param {IGCodeReaderOptions} [options]
|
|
52
|
+
*/
|
|
53
|
+
loadData(options?: IGCodeReaderOptions): Promise<any>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Parse data.
|
|
57
|
+
* @param {String | ArrayBuffer} content The content to parse.
|
|
58
|
+
*/
|
|
59
|
+
parse(content: string | ArrayBuffer): void;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Parse data as ArrayBuffer.
|
|
63
|
+
* @param {ArrayBuffer} content The content to parse.
|
|
64
|
+
*/
|
|
65
|
+
parseAsArrayBuffer(content: ArrayBuffer): void;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Parse data as text.
|
|
69
|
+
* @param {String} content The content to parse.
|
|
70
|
+
*/
|
|
71
|
+
parseAsText(content: string): void;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @param inData
|
|
76
|
+
* @param outData
|
|
77
|
+
*/
|
|
78
|
+
requestData(inData: any, outData: any): void;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @param dataAccessHelper
|
|
83
|
+
*/
|
|
84
|
+
setDataAccessHelper(
|
|
85
|
+
dataAccessHelper:
|
|
86
|
+
| HtmlDataAccessHelper
|
|
87
|
+
| HttpDataAccessHelper
|
|
88
|
+
| JSZipDataAccessHelper
|
|
89
|
+
| LiteHttpDataAccessHelper
|
|
90
|
+
): boolean;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Set the url of the object to load.
|
|
94
|
+
* @param {String} url the url of the object to load.
|
|
95
|
+
* @param {IGCodeReaderOptions} [option] The PLY reader options.
|
|
96
|
+
*/
|
|
97
|
+
setUrl(url: string, option?: IGCodeReaderOptions): Promise<string | any>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Method used to decorate a given object (publicAPI+model) with vtkGCodeReader characteristics.
|
|
102
|
+
*
|
|
103
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
104
|
+
* @param model object on which data structure will be bounds (protected)
|
|
105
|
+
* @param {IGCodeReaderInitialValues} [initialValues] (default: {})
|
|
106
|
+
*/
|
|
107
|
+
export function extend(
|
|
108
|
+
publicAPI: object,
|
|
109
|
+
model: object,
|
|
110
|
+
initialValues?: IGCodeReaderInitialValues
|
|
111
|
+
): void;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Method used to create a new instance of vtkGCodeReader
|
|
115
|
+
* @param {IGCodeReaderInitialValues} [initialValues] for pre-setting some of its content
|
|
116
|
+
*/
|
|
117
|
+
export function newInstance(
|
|
118
|
+
initialValues?: IGCodeReaderInitialValues
|
|
119
|
+
): vtkGCodeReader;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* vtkGCodeReader is a source object that reads a GCODE file.
|
|
123
|
+
*/
|
|
124
|
+
export declare const vtkGCodeReader: {
|
|
125
|
+
newInstance: typeof newInstance;
|
|
126
|
+
extend: typeof extend;
|
|
127
|
+
};
|
|
128
|
+
export default vtkGCodeReader;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { m as macro } from '../../macros2.js';
|
|
2
|
+
import BinaryHelper from '../Core/BinaryHelper.js';
|
|
3
|
+
import DataAccessHelper from '../Core/DataAccessHelper.js';
|
|
4
|
+
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
5
|
+
import vtkPoints from '../../Common/Core/Points.js';
|
|
6
|
+
import vtkCellArray from '../../Common/Core/CellArray.js';
|
|
7
|
+
import '../Core/DataAccessHelper/LiteHttpDataAccessHelper.js';
|
|
8
|
+
|
|
9
|
+
// import 'vtk.js/Sources/IO/Core/DataAccessHelper/HttpDataAccessHelper'; // HTTP + gz
|
|
10
|
+
// import 'vtk.js/Sources/IO/Core/DataAccessHelper/HtmlDataAccessHelper'; // html + base64 + zip
|
|
11
|
+
// import 'vtk.js/Sources/IO/Core/DataAccessHelper/JSZipDataAccessHelper'; // zip
|
|
12
|
+
|
|
13
|
+
// ----------------------------------------------------------------------------
|
|
14
|
+
// vtkGCodeReader methods
|
|
15
|
+
// ----------------------------------------------------------------------------
|
|
16
|
+
function vtkGCodeReader(publicAPI, model) {
|
|
17
|
+
const state = {
|
|
18
|
+
currentPosition: {
|
|
19
|
+
x: 0,
|
|
20
|
+
y: 0,
|
|
21
|
+
z: 0
|
|
22
|
+
},
|
|
23
|
+
offset: {
|
|
24
|
+
x: 0,
|
|
25
|
+
y: 0,
|
|
26
|
+
z: 0
|
|
27
|
+
},
|
|
28
|
+
currentLayer: 0,
|
|
29
|
+
layers: new Map(),
|
|
30
|
+
// Map to store layer data
|
|
31
|
+
isAbsolute: true,
|
|
32
|
+
// G90 is default
|
|
33
|
+
isMetric: true,
|
|
34
|
+
// G21 is default
|
|
35
|
+
lastZ: 0 // Track Z changes for layer detection
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
model.classHierarchy.push('vtkGCodeReader');
|
|
39
|
+
if (!model.dataAccessHelper) {
|
|
40
|
+
model.dataAccessHelper = DataAccessHelper.get('http');
|
|
41
|
+
}
|
|
42
|
+
function fetchData(url) {
|
|
43
|
+
let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
44
|
+
const {
|
|
45
|
+
compression,
|
|
46
|
+
progressCallback
|
|
47
|
+
} = model;
|
|
48
|
+
if (option.binary) {
|
|
49
|
+
return model.dataAccessHelper.fetchBinary(url, {
|
|
50
|
+
compression,
|
|
51
|
+
progressCallback
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return model.dataAccessHelper.fetchText(publicAPI, url, {
|
|
55
|
+
compression,
|
|
56
|
+
progressCallback
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function detectLayerChange(newZ) {
|
|
60
|
+
if (Math.abs(newZ - state.lastZ) > 0.001) {
|
|
61
|
+
state.currentLayer++;
|
|
62
|
+
state.lastZ = newZ;
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
function initializeLayer() {
|
|
68
|
+
if (!state.layers.has(state.currentLayer)) {
|
|
69
|
+
const points = vtkPoints.newInstance();
|
|
70
|
+
const lines = vtkCellArray.newInstance();
|
|
71
|
+
const polyData = vtkPolyData.newInstance();
|
|
72
|
+
polyData.setPoints(points);
|
|
73
|
+
polyData.setLines(lines);
|
|
74
|
+
state.layers.set(state.currentLayer, {
|
|
75
|
+
polyData,
|
|
76
|
+
points,
|
|
77
|
+
lines,
|
|
78
|
+
zHeight: state.lastZ
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function addLineToLayer(startPoint, endPoint) {
|
|
83
|
+
initializeLayer();
|
|
84
|
+
const layer = state.layers.get(state.currentLayer);
|
|
85
|
+
|
|
86
|
+
// Add points and get their indices
|
|
87
|
+
const startIndex = layer.points.insertNextPoint(startPoint[0], startPoint[1], startPoint[2]);
|
|
88
|
+
const endIndex = layer.points.insertNextPoint(endPoint[0], endPoint[1], endPoint[2]);
|
|
89
|
+
|
|
90
|
+
// Add line cell
|
|
91
|
+
layer.lines.insertNextCell([startIndex, endIndex]);
|
|
92
|
+
}
|
|
93
|
+
function processMove(params) {
|
|
94
|
+
const newPosition = {
|
|
95
|
+
...state.currentPosition
|
|
96
|
+
};
|
|
97
|
+
let positionChanged = false;
|
|
98
|
+
['X', 'Y', 'Z'].forEach(axis => {
|
|
99
|
+
if (axis in params) {
|
|
100
|
+
const value = state.isMetric ? params[axis] : params[axis] * 25.4;
|
|
101
|
+
newPosition[axis.toLowerCase()] = state.isAbsolute ? value + state.offset[axis.toLowerCase()] : state.currentPosition[axis.toLowerCase()] + value;
|
|
102
|
+
positionChanged = true;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
if (positionChanged) {
|
|
106
|
+
if ('Z' in params) {
|
|
107
|
+
detectLayerChange(newPosition.z);
|
|
108
|
+
}
|
|
109
|
+
const startPoint = [state.currentPosition.x, state.currentPosition.y, state.currentPosition.z];
|
|
110
|
+
const endPoint = [newPosition.x, newPosition.y, newPosition.z];
|
|
111
|
+
addLineToLayer(startPoint, endPoint);
|
|
112
|
+
state.currentPosition = newPosition;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function processG92(params) {
|
|
116
|
+
['X', 'Y', 'Z'].forEach(axis => {
|
|
117
|
+
if (axis in params) {
|
|
118
|
+
state.offset[axis.toLowerCase()] = state.currentPosition[axis.toLowerCase()] - (state.isMetric ? params[axis] : params[axis] * 25.4);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function processCommand(command, params) {
|
|
123
|
+
switch (command) {
|
|
124
|
+
case 'G0': // Rapid move
|
|
125
|
+
case 'G1':
|
|
126
|
+
// Linear move
|
|
127
|
+
processMove(params);
|
|
128
|
+
break;
|
|
129
|
+
case 'G20':
|
|
130
|
+
// Imperial
|
|
131
|
+
state.isMetric = false;
|
|
132
|
+
break;
|
|
133
|
+
case 'G21':
|
|
134
|
+
// Metric
|
|
135
|
+
state.isMetric = true;
|
|
136
|
+
break;
|
|
137
|
+
case 'G90':
|
|
138
|
+
// Absolute positioning
|
|
139
|
+
state.isAbsolute = true;
|
|
140
|
+
break;
|
|
141
|
+
case 'G91':
|
|
142
|
+
// Relative positioning
|
|
143
|
+
state.isAbsolute = false;
|
|
144
|
+
break;
|
|
145
|
+
case 'G92':
|
|
146
|
+
// Set position
|
|
147
|
+
processG92(params);
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function parseGCode(gcodeText) {
|
|
152
|
+
const lines = gcodeText.split('\n');
|
|
153
|
+
lines.forEach(line => {
|
|
154
|
+
const sline = line.split(';')[0].trim();
|
|
155
|
+
if (!sline) return;
|
|
156
|
+
const tokens = sline.split(' ');
|
|
157
|
+
const command = tokens[0];
|
|
158
|
+
const params = {};
|
|
159
|
+
tokens.slice(1).forEach(token => {
|
|
160
|
+
const param = token[0];
|
|
161
|
+
const value = parseFloat(token.slice(1));
|
|
162
|
+
if (!Number.isNaN(value)) {
|
|
163
|
+
params[param] = value;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
processCommand(command, params);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Public methods
|
|
171
|
+
publicAPI.setUrl = function (url) {
|
|
172
|
+
let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
173
|
+
binary: true
|
|
174
|
+
};
|
|
175
|
+
model.url = url;
|
|
176
|
+
const path = url.split('/');
|
|
177
|
+
path.pop();
|
|
178
|
+
model.baseURL = path.join('/');
|
|
179
|
+
model.compression = option.compression;
|
|
180
|
+
return publicAPI.loadData({
|
|
181
|
+
progressCallback: option.progressCallback,
|
|
182
|
+
binary: !!option.binary
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
publicAPI.loadData = function () {
|
|
186
|
+
let option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
187
|
+
const promise = fetchData(model.url, option);
|
|
188
|
+
promise.then(publicAPI.parse);
|
|
189
|
+
return promise;
|
|
190
|
+
};
|
|
191
|
+
publicAPI.parseAsText = content => {
|
|
192
|
+
parseGCode(content);
|
|
193
|
+
};
|
|
194
|
+
publicAPI.parseAsArrayBuffer = content => {
|
|
195
|
+
const data = BinaryHelper.arrayBufferToString(content);
|
|
196
|
+
parseGCode(data);
|
|
197
|
+
};
|
|
198
|
+
publicAPI.parse = content => {
|
|
199
|
+
if (typeof content === 'string') {
|
|
200
|
+
publicAPI.parseAsText(content);
|
|
201
|
+
} else {
|
|
202
|
+
publicAPI.parseAsArrayBuffer(content);
|
|
203
|
+
}
|
|
204
|
+
state.layers.forEach((layer, i) => {
|
|
205
|
+
model.output[i] = layer.polyData;
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
publicAPI.requestData = (inData, outData) => {
|
|
209
|
+
publicAPI.parse(model.parseData);
|
|
210
|
+
};
|
|
211
|
+
publicAPI.getNumberOfOutputPorts = () => state.layers.size;
|
|
212
|
+
}
|
|
213
|
+
const DEFAULT_VALUES = {
|
|
214
|
+
// baseURL: null,
|
|
215
|
+
// dataAccessHelper: null,
|
|
216
|
+
// url: null,
|
|
217
|
+
};
|
|
218
|
+
function extend(publicAPI, model) {
|
|
219
|
+
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
220
|
+
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
221
|
+
|
|
222
|
+
// Build VTK API
|
|
223
|
+
macro.obj(publicAPI, model);
|
|
224
|
+
macro.get(publicAPI, model, ['url', 'baseURL']);
|
|
225
|
+
macro.setGet(publicAPI, model, ['dataAccessHelper']);
|
|
226
|
+
macro.algo(publicAPI, model, 0, 1);
|
|
227
|
+
macro.event(publicAPI, model, 'ready');
|
|
228
|
+
vtkGCodeReader(publicAPI, model);
|
|
229
|
+
}
|
|
230
|
+
const newInstance = macro.newInstance(extend, 'vtkGCodeReader');
|
|
231
|
+
var vtkGCodeReader$1 = {
|
|
232
|
+
extend,
|
|
233
|
+
newInstance
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export { vtkGCodeReader$1 as default, extend, newInstance };
|
package/IO/Misc.js
CHANGED
|
@@ -7,6 +7,7 @@ import vtkMTLReader from './Misc/MTLReader.js';
|
|
|
7
7
|
import vtkOBJReader from './Misc/OBJReader.js';
|
|
8
8
|
import vtkPDBReader from './Misc/PDBReader.js';
|
|
9
9
|
import vtkSkyboxReader from './Misc/SkyboxReader.js';
|
|
10
|
+
import vtkGCodeReader from './Misc/GCodeReader.js';
|
|
10
11
|
|
|
11
12
|
var Misc = {
|
|
12
13
|
vtkElevationReader,
|
|
@@ -17,7 +18,8 @@ var Misc = {
|
|
|
17
18
|
vtkMTLReader,
|
|
18
19
|
vtkOBJReader,
|
|
19
20
|
vtkPDBReader,
|
|
20
|
-
vtkSkyboxReader
|
|
21
|
+
vtkSkyboxReader,
|
|
22
|
+
vtkGCodeReader
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
export { Misc as default };
|
|
@@ -2,7 +2,7 @@ import { mat4, vec3 } from 'gl-matrix';
|
|
|
2
2
|
import { m as macro } from '../../macros2.js';
|
|
3
3
|
import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
|
|
4
4
|
import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
5
|
-
import { r as radiansFromDegrees,
|
|
5
|
+
import { r as radiansFromDegrees, C as degreesFromRadians } from '../../Common/Core/Math/index.js';
|
|
6
6
|
|
|
7
7
|
// ----------------------------------------------------------------------------
|
|
8
8
|
// vtkMouseCameraTrackballRollManipulator methods
|
|
@@ -8,7 +8,7 @@ import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
|
|
|
8
8
|
import { FieldAssociations } from '../../Common/DataModel/DataSet/Constants.js';
|
|
9
9
|
import { mat4, vec3 } from 'gl-matrix';
|
|
10
10
|
import { m as macro } from '../../macros2.js';
|
|
11
|
-
import {
|
|
11
|
+
import { D as areEquals, l as normalize, d as dot, E as clampValue, s as subtract, j as cross, w as multiplyScalar, e as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
14
|
States
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkInteractorStyle from '../../Rendering/Core/InteractorStyle.js';
|
|
3
3
|
import vtkInteractorStyleConstants from '../../Rendering/Core/InteractorStyle/Constants.js';
|
|
4
|
-
import {
|
|
4
|
+
import { C as degreesFromRadians } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import { Device, Input } from '../../Rendering/Core/RenderWindowInteractor/Constants.js';
|
|
6
6
|
|
|
7
7
|
const {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import {
|
|
2
|
+
import { F as arrayRange } from '../../Common/Core/Math/index.js';
|
|
3
3
|
import WebworkerPromise from 'webworker-promise';
|
|
4
4
|
import { W as WorkerFactory } from '../../_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js';
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkMouseRangeManipulator from '../../Interaction/Manipulators/MouseRangeManipulator.js';
|
|
3
3
|
import vtkViewProxy from './ViewProxy.js';
|
|
4
|
-
import { j as cross,
|
|
4
|
+
import { j as cross, G as getMajorAxisIndex, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import { mat4, vec3 } from 'gl-matrix';
|
|
6
6
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkAbstractMapper3D from './AbstractMapper3D.js';
|
|
3
|
-
import {
|
|
3
|
+
import { H as createUninitializedBounds } from '../../Common/Core/Math/index.js';
|
|
4
4
|
|
|
5
5
|
// ----------------------------------------------------------------------------
|
|
6
6
|
// vtkAbstractImageMapper methods
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkAbstractMapper from './AbstractMapper.js';
|
|
3
3
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
4
|
-
import {
|
|
4
|
+
import { H as createUninitializedBounds } from '../../Common/Core/Math/index.js';
|
|
5
5
|
|
|
6
6
|
// ----------------------------------------------------------------------------
|
|
7
7
|
// vtkAbstractMapper methods
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import { h as hsv2rgb, i as isNan,
|
|
2
|
+
import { h as hsv2rgb, i as isNan, K as floor, L as isInf, M as rgb2hsv, N as rgb2lab, O as lab2rgb } from '../../Common/Core/Math/index.js';
|
|
3
3
|
import vtkScalarsToColors from '../../Common/Core/ScalarsToColors.js';
|
|
4
4
|
import Constants from './ColorTransferFunction/Constants.js';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import Constants from './Coordinate/Constants.js';
|
|
3
|
-
import {
|
|
3
|
+
import { P as round, K as floor } from '../../Common/Core/Math/index.js';
|
|
4
4
|
|
|
5
5
|
const {
|
|
6
6
|
Coordinate
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { vec3, mat4 } from 'gl-matrix';
|
|
2
2
|
import * as d3 from 'd3-scale';
|
|
3
|
-
import {
|
|
3
|
+
import { Q as normalize2D, R as nearestPowerOfTwo } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import { m as macro } from '../../macros2.js';
|
|
5
5
|
import vtkActor from './Actor.js';
|
|
6
6
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
@@ -2,7 +2,7 @@ import { mat4, vec3, mat3 } from 'gl-matrix';
|
|
|
2
2
|
import Constants from './Glyph3DMapper/Constants.js';
|
|
3
3
|
import { m as macro } from '../../macros2.js';
|
|
4
4
|
import vtkMapper from './Mapper.js';
|
|
5
|
-
import {
|
|
5
|
+
import { H as createUninitializedBounds, n as norm } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
7
7
|
|
|
8
8
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkAbstractImageMapper from './AbstractImageMapper.js';
|
|
3
3
|
import vtkImageMapper from './ImageMapper.js';
|
|
4
|
-
import {
|
|
4
|
+
import { H as createUninitializedBounds } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import { intersectWithLineForPointPicking, intersectWithLineForCellPicking } from './AbstractImageMapper/helper.js';
|
|
6
6
|
import CoincidentTopologyHelper from './Mapper/CoincidentTopologyHelper.js';
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@ import Constants from './ImageMapper/Constants.js';
|
|
|
2
2
|
import { m as macro } from '../../macros2.js';
|
|
3
3
|
import vtkAbstractImageMapper from './AbstractImageMapper.js';
|
|
4
4
|
import { intersectWithLineForPointPicking, intersectWithLineForCellPicking } from './AbstractImageMapper/helper.js';
|
|
5
|
-
import {
|
|
5
|
+
import { E as clampValue, S as multiply3x3_vect3, H as createUninitializedBounds, T as getSparseOrthogonalMatrix } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import CoincidentTopologyHelper from './Mapper/CoincidentTopologyHelper.js';
|
|
7
7
|
|
|
8
8
|
const {
|
package/Rendering/Core/Mapper.js
CHANGED
|
@@ -3,7 +3,7 @@ import vtkAbstractMapper3D from './AbstractMapper3D.js';
|
|
|
3
3
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
4
4
|
import vtkImageData from '../../Common/DataModel/ImageData.js';
|
|
5
5
|
import vtkLookupTable from '../../Common/Core/LookupTable.js';
|
|
6
|
-
import {
|
|
6
|
+
import { H as createUninitializedBounds, i as isNan } from '../../Common/Core/Math/index.js';
|
|
7
7
|
import vtkScalarsToColors from '../../Common/Core/ScalarsToColors/Constants.js';
|
|
8
8
|
import CoincidentTopologyHelper from './Mapper/CoincidentTopologyHelper.js';
|
|
9
9
|
import Constants from './Mapper/Constants.js';
|
package/Rendering/Core/Prop3D.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mat4, quat } from 'gl-matrix';
|
|
2
2
|
import { m as macro } from '../../macros2.js';
|
|
3
3
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
4
|
-
import {
|
|
4
|
+
import { C as degreesFromRadians, r as radiansFromDegrees, a as areMatricesEqual } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkProp from './Prop.js';
|
|
6
6
|
|
|
7
7
|
const VTK_EPSILON = 1e-6;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import {
|
|
2
|
+
import { C as degreesFromRadians } from '../../Common/Core/Math/index.js';
|
|
3
3
|
import Constants from './RenderWindowInteractor/Constants.js';
|
|
4
4
|
|
|
5
5
|
const {
|
|
@@ -2,7 +2,7 @@ import { mat4, vec3 } from 'gl-matrix';
|
|
|
2
2
|
import { n as newInstance$1, g as get, e as setGet, k as getArray, l as setGetArray, i as moveToProtected, c as macro } from '../../macros2.js';
|
|
3
3
|
import vtkCamera from './Camera.js';
|
|
4
4
|
import vtkLight from './Light.js';
|
|
5
|
-
import {
|
|
5
|
+
import { U as areBoundsInitialized, u as uninitializeBounds, r as radiansFromDegrees, d as dot, H as createUninitializedBounds } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkViewport from './Viewport.js';
|
|
7
7
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as d3 from 'd3-scale';
|
|
2
|
-
import {
|
|
2
|
+
import { R as nearestPowerOfTwo } from '../../Common/Core/Math/index.js';
|
|
3
3
|
import { m as macro } from '../../macros2.js';
|
|
4
4
|
import vtkActor from './Actor.js';
|
|
5
5
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import {
|
|
2
|
+
import { H as createUninitializedBounds, E as clampValue, K as floor } from '../../Common/Core/Math/index.js';
|
|
3
3
|
import Constants from './VolumeMapper/Constants.js';
|
|
4
4
|
import vtkAbstractMapper3D from './AbstractMapper3D.js';
|
|
5
5
|
import vtkPiecewiseFunction from '../../Common/DataModel/PiecewiseFunction.js';
|
|
@@ -8,7 +8,7 @@ import { v as vtkPolyData2DVS } from './glsl/vtkPolyData2DVS.glsl.js';
|
|
|
8
8
|
import vtkReplacementShaderMapper from './ReplacementShaderMapper.js';
|
|
9
9
|
import vtkShaderProgram from './ShaderProgram.js';
|
|
10
10
|
import vtkViewNode from '../SceneGraph/ViewNode.js';
|
|
11
|
-
import {
|
|
11
|
+
import { P as round } from '../../Common/Core/Math/index.js';
|
|
12
12
|
import { DisplayLocation } from '../Core/Property2D/Constants.js';
|
|
13
13
|
import { registerOverride } from './ViewNodeFactory.js';
|
|
14
14
|
|
|
@@ -2,7 +2,7 @@ import Constants from './Texture/Constants.js';
|
|
|
2
2
|
import HalfFloat from '../../Common/Core/HalfFloat.js';
|
|
3
3
|
import { n as newInstance$1, o as obj, s as set, e as setGet, g as get, i as moveToProtected, a as newTypedArray, c as macro } from '../../macros2.js';
|
|
4
4
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
5
|
-
import {
|
|
5
|
+
import { V as isPowerOfTwo, R as nearestPowerOfTwo } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkViewNode from '../SceneGraph/ViewNode.js';
|
|
7
7
|
import { registerOverride } from './ViewNodeFactory.js';
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkActor from '../../Rendering/Core/Actor.js';
|
|
3
3
|
import vtkMapper from '../../Rendering/Core/Mapper.js';
|
|
4
|
-
import {
|
|
4
|
+
import { D as areEquals } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
6
6
|
import vtkTubeFilter from '../../Filters/General/TubeFilter.js';
|
|
7
7
|
import { getPixelWorldHeightAtCoord } from '../Core/WidgetManager.js';
|
|
@@ -3,7 +3,7 @@ import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
|
3
3
|
import vtkPlanePointManipulator from '../Manipulators/PlaneManipulator.js';
|
|
4
4
|
import vtkPolyLineRepresentation from '../Representations/PolyLineRepresentation.js';
|
|
5
5
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
6
|
-
import { s as subtract,
|
|
6
|
+
import { s as subtract, W as angleBetweenVectors } from '../../Common/Core/Math/index.js';
|
|
7
7
|
import widgetBehavior from './AngleWidget/behavior.js';
|
|
8
8
|
import generateState from './AngleWidget/state.js';
|
|
9
9
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as subtract, w as multiplyScalar, k as add,
|
|
1
|
+
import { s as subtract, w as multiplyScalar, k as add, D as areEquals } from '../../../Common/Core/Math/index.js';
|
|
2
2
|
|
|
3
3
|
function calculateTextPosition(model) {
|
|
4
4
|
const vector = [0, 0, 0];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../../macros2.js';
|
|
2
2
|
import vtkBoundingBox from '../../../Common/DataModel/BoundingBox.js';
|
|
3
3
|
import vtkLine from '../../../Common/DataModel/Line.js';
|
|
4
|
-
import { k as add, l as normalize, s as subtract, d as dot, j as cross, m as multiplyAccumulate, w as multiplyScalar,
|
|
4
|
+
import { k as add, l as normalize, s as subtract, d as dot, j as cross, m as multiplyAccumulate, w as multiplyScalar, X as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
|
|
5
5
|
import { getLineNames, getOtherLineName, updateState, boundPointOnPlane, getLinePlaneName, getLineInPlaneName, rotateVector } from './helpers.js';
|
|
6
6
|
import { InteractionMethodsName, ScrollingMethods, planeNameToViewType } from './Constants.js';
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@ import vtkBoundingBox, { STATIC } from '../../../Common/DataModel/BoundingBox.js
|
|
|
2
2
|
import vtkCubeSource from '../../../Filters/Sources/CubeSource.js';
|
|
3
3
|
import vtkCutter from '../../../Filters/Core/Cutter.js';
|
|
4
4
|
import vtkPlane from '../../../Common/DataModel/Plane.js';
|
|
5
|
-
import { s as subtract, l as normalize, j as cross, w as multiplyScalar, m as multiplyAccumulate,
|
|
5
|
+
import { s as subtract, l as normalize, j as cross, w as multiplyScalar, m as multiplyAccumulate, X as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkMatrixBuilder from '../../../Common/Core/MatrixBuilder.js';
|
|
7
7
|
import { viewTypeToPlaneName, planeNameToViewType, planeNames } from './Constants.js';
|
|
8
8
|
|
package/index.d.ts
CHANGED
|
@@ -96,7 +96,9 @@
|
|
|
96
96
|
/// <reference path="./IO/Geometry/PLYWriter.d.ts" />
|
|
97
97
|
/// <reference path="./IO/Geometry/STLReader.d.ts" />
|
|
98
98
|
/// <reference path="./IO/Geometry/STLWriter.d.ts" />
|
|
99
|
+
/// <reference path="./IO/Image/HDRReader.d.ts" />
|
|
99
100
|
/// <reference path="./IO/Misc/ElevationReader.d.ts" />
|
|
101
|
+
/// <reference path="./IO/Misc/GCodeReader.d.ts" />
|
|
100
102
|
/// <reference path="./IO/Misc/ITKImageReader.d.ts" />
|
|
101
103
|
/// <reference path="./IO/Misc/ITKPolyDataReader.d.ts" />
|
|
102
104
|
/// <reference path="./IO/Misc/JSONNucleoReader.d.ts" />
|