@kitware/vtk.js 25.10.0 → 26.0.0-beta.2
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 +0 -6
- package/Common/Core/CellArray.js +21 -12
- package/Common/Core/ClassHierarchy.js +11 -6
- package/Common/Core/DataArray.d.ts +20 -0
- package/Common/Core/DataArray.js +21 -4
- package/Proxy/Core/ViewProxy.js +17 -9
- package/Rendering/Core/ColorTransferFunction.d.ts +0 -20
- package/Rendering/Core/ColorTransferFunction.js +0 -63
- package/Rendering/Core/Prop3D.js +1 -6
- package/Rendering/Core/RenderWindow.js +9 -6
- package/Rendering/Core/VolumeProperty.js +2 -3
- package/Rendering/Misc/CanvasView.js +6 -5
- package/Rendering/Misc/GenericRenderWindow.js +12 -7
- package/Rendering/OpenGL/Actor.js +4 -4
- package/Rendering/OpenGL/Actor2D.js +4 -4
- package/Rendering/OpenGL/Camera.js +7 -4
- package/Rendering/OpenGL/CubeAxesActor.js +7 -5
- package/Rendering/OpenGL/ForwardPass.js +1 -1
- package/Rendering/OpenGL/Glyph3DMapper.js +4 -4
- package/Rendering/OpenGL/ImageMapper.js +9 -5
- package/Rendering/OpenGL/ImageSlice.js +3 -3
- package/Rendering/OpenGL/PixelSpaceCallbackMapper.js +9 -5
- package/Rendering/OpenGL/PolyDataMapper.js +27 -21
- package/Rendering/OpenGL/PolyDataMapper2D.js +17 -10
- package/Rendering/OpenGL/ScalarBarActor.js +6 -4
- package/Rendering/OpenGL/Skybox.js +10 -6
- package/Rendering/OpenGL/Texture.js +6 -5
- package/Rendering/OpenGL/Volume.js +2 -2
- package/Rendering/OpenGL/VolumeMapper.js +11 -11
- package/Rendering/OpenGL/glsl/vtkVolumeFS.glsl.js +1 -1
- package/Rendering/SceneGraph/RenderPass.js +3 -2
- package/Rendering/WebGPU/ForwardPass.js +1 -1
- package/Rendering/WebGPU/HardwareSelectionPass.js +1 -1
- package/Rendering/WebGPU/HardwareSelector.js +14 -13
- package/Rendering/WebGPU/OpaquePass.js +1 -1
- package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -1
- package/Rendering/WebGPU/VolumePass.js +1 -1
- package/Utilities/config/rules-tests.js +28 -0
- package/Widgets/Core/AbstractWidgetFactory.js +1 -0
- package/Widgets/Core/StateBuilder/color3Mixin.js +22 -0
- package/Widgets/Core/StateBuilder/colorMixin.js +7 -0
- package/Widgets/Core/StateBuilder.js +2 -0
- package/Widgets/Core/WidgetManager.js +21 -256
- package/Widgets/Representations/ArrowHandleRepresentation.js +28 -110
- package/Widgets/Representations/CircleContextRepresentation.js +43 -165
- package/Widgets/Representations/ContextRepresentation.js +0 -3
- package/Widgets/Representations/ConvexFaceContextRepresentation.js +11 -11
- package/Widgets/Representations/CroppingOutlineRepresentation.js +5 -12
- package/Widgets/Representations/CubeHandleRepresentation.js +15 -104
- package/Widgets/Representations/GlyphRepresentation.js +320 -0
- package/Widgets/Representations/HandleRepresentation.js +0 -5
- package/Widgets/Representations/ImplicitPlaneRepresentation.js +68 -49
- package/Widgets/Representations/LineHandleRepresentation.js +116 -0
- package/Widgets/Representations/PolyLineRepresentation.js +52 -49
- package/Widgets/Representations/RectangleContextRepresentation.js +16 -21
- package/Widgets/Representations/SphereContextRepresentation.js +30 -109
- package/Widgets/Representations/SphereHandleRepresentation.js +13 -110
- package/Widgets/Representations/SplineContextRepresentation.js +53 -36
- package/Widgets/Representations/WidgetRepresentation.d.ts +52 -1
- package/Widgets/Representations/WidgetRepresentation.js +140 -78
- package/Widgets/Representations.js +6 -0
- package/Widgets/Widgets3D/AngleWidget.js +1 -4
- package/Widgets/Widgets3D/EllipseWidget/state.js +1 -1
- package/Widgets/Widgets3D/EllipseWidget.js +0 -7
- package/Widgets/Widgets3D/LabelWidget/behavior.js +0 -7
- package/Widgets/Widgets3D/LabelWidget.js +1 -18
- package/Widgets/Widgets3D/LineWidget/behavior.js +0 -44
- package/Widgets/Widgets3D/LineWidget.js +0 -11
- package/Widgets/Widgets3D/PolyLineWidget.js +0 -10
- package/Widgets/Widgets3D/RectangleWidget.js +0 -7
- package/Widgets/Widgets3D/ResliceCursorWidget/Constants.js +15 -3
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +93 -36
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +75 -82
- package/Widgets/Widgets3D/ResliceCursorWidget/state.js +49 -170
- package/Widgets/Widgets3D/ResliceCursorWidget.js +61 -23
- package/Widgets/Widgets3D/ShapeWidget.js +1 -1
- package/index.d.ts +0 -1
- package/macros.d.ts +3 -5
- package/macros.js +4 -35
- package/package.json +3 -2
- package/Widgets/Core/WidgetManager/vdom.js +0 -172
- package/Widgets/Representations/ResliceCursorContextRepresentation/Constants.js +0 -12
- package/Widgets/Representations/ResliceCursorContextRepresentation.d.ts +0 -54
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +0 -357
- package/Widgets/SVG/SVGLandmarkRepresentation/Constants.js +0 -28
- package/Widgets/SVG/SVGLandmarkRepresentation.js +0 -179
- package/Widgets/SVG/SVGRepresentation.js +0 -163
- package/_vendor/available-typed-arrays/index.js_commonjs-proxy.js +0 -1
- package/_vendor/call-bind/callBound.js_commonjs-proxy.js +0 -1
- package/_vendor/call-bind/index.js_commonjs-module.js +0 -3
- package/_vendor/call-bind/index.js_commonjs-proxy.js +0 -1
- package/_vendor/deep-equal/node_modules/isarray/index.js_commonjs-proxy.js +0 -1
- package/_vendor/define-properties/index.js_commonjs-proxy.js +0 -1
- package/_vendor/es-abstract/helpers/getOwnPropertyDescriptor.js_commonjs-proxy.js +0 -1
- package/_vendor/es-get-iterator/index.js_commonjs-module.js +0 -3
- package/_vendor/es-get-iterator/index.js_commonjs-proxy.js +0 -1
- package/_vendor/es-get-iterator/node_modules/isarray/index.js_commonjs-proxy.js +0 -1
- package/_vendor/foreach/index.js_commonjs-proxy.js +0 -1
- package/_vendor/function-bind/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/function-bind/index.js_commonjs-proxy.js +0 -1
- package/_vendor/get-intrinsic/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has/src/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has-bigints/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has-symbols/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has-symbols/shams.js_commonjs-proxy.js +0 -1
- package/_vendor/has-tostringtag/shams.js_commonjs-proxy.js +0 -1
- package/_vendor/is-arguments/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-bigint/index.js_commonjs-module.js +0 -3
- package/_vendor/is-bigint/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-boolean-object/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-date-object/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-map/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-number-object/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-regex/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-set/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-string/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-symbol/index.js_commonjs-module.js +0 -3
- package/_vendor/is-symbol/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-typed-array/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-weakmap/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-weakset/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-inspect/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/polyfill.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/shim.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/isArguments.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/polyfill.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/shim.js_commonjs-proxy.js +0 -2
- package/_vendor/regexp.prototype.flags/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/regexp.prototype.flags/index.js_commonjs-proxy.js +0 -1
- package/_vendor/regexp.prototype.flags/polyfill.js_commonjs-proxy.js +0 -1
- package/_vendor/regexp.prototype.flags/shim.js_commonjs-proxy.js +0 -1
- package/_vendor/side-channel/index.js_commonjs-proxy.js +0 -1
- package/_vendor/which-boxed-primitive/index.js_commonjs-proxy.js +0 -5
- package/_vendor/which-collection/index.js_commonjs-proxy.js +0 -4
- package/_vendor/which-typed-array/index.js_commonjs-proxy.js +0 -1
- package/_virtual/_node-resolve_empty.js_commonjs-proxy.js +0 -6
- package/_virtual/commonjsHelpers.js +0 -18
- package/_virtual/node-resolve_empty.js +0 -8
- package/_virtual/polyfill-node.global.js +0 -5
- package/_virtual/polyfill-node.process.js +0 -225
- package/vendor/available-typed-arrays/index.js +0 -29
- package/vendor/call-bind/callBound.js +0 -19
- package/vendor/call-bind/index.js +0 -52
- package/vendor/deep-equal/index.js +0 -379
- package/vendor/deep-equal/node_modules/isarray/index.js +0 -7
- package/vendor/define-properties/index.js +0 -60
- package/vendor/es-abstract/helpers/getOwnPropertyDescriptor.js +0 -17
- package/vendor/es-get-iterator/index.js +0 -217
- package/vendor/es-get-iterator/node_modules/isarray/index.js +0 -7
- package/vendor/foreach/index.js +0 -22
- package/vendor/function-bind/implementation.js +0 -52
- package/vendor/function-bind/index.js +0 -7
- package/vendor/get-intrinsic/index.js +0 -334
- package/vendor/has/src/index.js +0 -7
- package/vendor/has-bigints/index.js +0 -12
- package/vendor/has-symbols/index.js +0 -15
- package/vendor/has-symbols/shams.js +0 -42
- package/vendor/has-tostringtag/shams.js +0 -9
- package/vendor/is-arguments/index.js +0 -36
- package/vendor/is-bigint/index.js +0 -39
- package/vendor/is-boolean-object/index.js +0 -29
- package/vendor/is-date-object/index.js +0 -22
- package/vendor/is-map/index.js +0 -42
- package/vendor/is-number-object/index.js +0 -26
- package/vendor/is-regex/index.js +0 -61
- package/vendor/is-set/index.js +0 -42
- package/vendor/is-string/index.js +0 -26
- package/vendor/is-symbol/index.js +0 -36
- package/vendor/is-typed-array/index.js +0 -67
- package/vendor/is-weakmap/index.js +0 -42
- package/vendor/is-weakset/index.js +0 -42
- package/vendor/object-inspect/index.js +0 -515
- package/vendor/object-is/implementation.js +0 -18
- package/vendor/object-is/index.js +0 -25
- package/vendor/object-is/polyfill.js +0 -9
- package/vendor/object-is/shim.js +0 -17
- package/vendor/object-keys/implementation.js +0 -124
- package/vendor/object-keys/index.js +0 -35
- package/vendor/object-keys/isArguments.js +0 -17
- package/vendor/object.assign/implementation.js +0 -46
- package/vendor/object.assign/index.js +0 -29
- package/vendor/object.assign/polyfill.js +0 -57
- package/vendor/object.assign/shim.js +0 -17
- package/vendor/regexp.prototype.flags/implementation.js +0 -30
- package/vendor/regexp.prototype.flags/index.js +0 -25
- package/vendor/regexp.prototype.flags/polyfill.js +0 -23
- package/vendor/regexp.prototype.flags/shim.js +0 -29
- package/vendor/side-channel/index.js +0 -128
- package/vendor/which-boxed-primitive/index.js +0 -38
- package/vendor/which-collection/index.js +0 -29
- package/vendor/which-typed-array/index.js +0 -63
|
@@ -4,19 +4,14 @@ import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
|
4
4
|
import { r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import { FieldAssociations } from '../../Common/DataModel/DataSet/Constants.js';
|
|
6
6
|
import macro from '../../macros.js';
|
|
7
|
-
import vtkSelectionNode from '../../Common/DataModel/SelectionNode.js';
|
|
8
7
|
import WidgetManagerConst from './WidgetManager/Constants.js';
|
|
9
|
-
import vtkSVGRepresentation from '../SVG/SVGRepresentation.js';
|
|
10
8
|
import { WIDGET_PRIORITY } from './AbstractWidget/Constants.js';
|
|
11
|
-
import { diff } from './WidgetManager/vdom.js';
|
|
12
9
|
|
|
13
10
|
var ViewTypes = WidgetManagerConst.ViewTypes,
|
|
14
11
|
RenderingTypes = WidgetManagerConst.RenderingTypes,
|
|
15
12
|
CaptureOn = WidgetManagerConst.CaptureOn;
|
|
16
13
|
var vtkErrorMacro = macro.vtkErrorMacro,
|
|
17
14
|
vtkWarningMacro = macro.vtkWarningMacro;
|
|
18
|
-
var createSvgElement = vtkSVGRepresentation.createSvgElement,
|
|
19
|
-
createSvgDomElement = vtkSVGRepresentation.createSvgDomElement;
|
|
20
15
|
var viewIdCount = 1; // ----------------------------------------------------------------------------
|
|
21
16
|
// Helper
|
|
22
17
|
// ----------------------------------------------------------------------------
|
|
@@ -34,17 +29,9 @@ function extractRenderingComponents(renderer) {
|
|
|
34
29
|
camera: camera
|
|
35
30
|
};
|
|
36
31
|
} // ----------------------------------------------------------------------------
|
|
37
|
-
|
|
38
|
-
function createSvgRoot(id) {
|
|
39
|
-
var svgRoot = createSvgDomElement('svg');
|
|
40
|
-
svgRoot.setAttribute('version', '1.1');
|
|
41
|
-
svgRoot.setAttribute('baseProfile', 'full');
|
|
42
|
-
return svgRoot;
|
|
43
|
-
} // ----------------------------------------------------------------------------
|
|
44
32
|
// vtkWidgetManager methods
|
|
45
33
|
// ----------------------------------------------------------------------------
|
|
46
34
|
|
|
47
|
-
|
|
48
35
|
function vtkWidgetManager(publicAPI, model) {
|
|
49
36
|
if (!model.viewId) {
|
|
50
37
|
model.viewId = "view-".concat(viewIdCount++);
|
|
@@ -52,13 +39,7 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
52
39
|
|
|
53
40
|
model.classHierarchy.push('vtkWidgetManager');
|
|
54
41
|
var propsWeakMap = new WeakMap();
|
|
55
|
-
var widgetToSvgMap = new WeakMap();
|
|
56
|
-
var svgVTrees = new WeakMap();
|
|
57
42
|
var subscriptions = []; // --------------------------------------------------------------------------
|
|
58
|
-
// Internal variable
|
|
59
|
-
// --------------------------------------------------------------------------
|
|
60
|
-
|
|
61
|
-
model.svgRoot = createSvgRoot(model.viewId); // --------------------------------------------------------------------------
|
|
62
43
|
// API internal
|
|
63
44
|
// --------------------------------------------------------------------------
|
|
64
45
|
|
|
@@ -85,142 +66,6 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
85
66
|
viewId: model.viewId
|
|
86
67
|
}));
|
|
87
68
|
} // --------------------------------------------------------------------------
|
|
88
|
-
// internal SVG API
|
|
89
|
-
// --------------------------------------------------------------------------
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var pendingSvgRenders = new WeakMap();
|
|
93
|
-
|
|
94
|
-
function enableSvgLayer() {
|
|
95
|
-
var container = model._apiSpecificRenderWindow.getReferenceByName('el');
|
|
96
|
-
|
|
97
|
-
var canvas = model._apiSpecificRenderWindow.getCanvas();
|
|
98
|
-
|
|
99
|
-
container.insertBefore(model.svgRoot, canvas.nextSibling);
|
|
100
|
-
var containerStyles = window.getComputedStyle(container);
|
|
101
|
-
|
|
102
|
-
if (containerStyles.position === 'static') {
|
|
103
|
-
container.style.position = 'relative';
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function disableSvgLayer() {
|
|
108
|
-
var container = model._apiSpecificRenderWindow.getReferenceByName('el');
|
|
109
|
-
|
|
110
|
-
container.removeChild(model.svgRoot);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function removeFromSvgLayer(viewWidget) {
|
|
114
|
-
var group = widgetToSvgMap.get(viewWidget);
|
|
115
|
-
|
|
116
|
-
if (group) {
|
|
117
|
-
widgetToSvgMap.delete(viewWidget);
|
|
118
|
-
svgVTrees.delete(viewWidget);
|
|
119
|
-
model.svgRoot.removeChild(group);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function setSvgSize() {
|
|
124
|
-
var _model$_apiSpecificRe = model._apiSpecificRenderWindow.getViewportSize(model._renderer),
|
|
125
|
-
_model$_apiSpecificRe2 = _slicedToArray(_model$_apiSpecificRe, 2),
|
|
126
|
-
cwidth = _model$_apiSpecificRe2[0],
|
|
127
|
-
cheight = _model$_apiSpecificRe2[1];
|
|
128
|
-
|
|
129
|
-
var ratio = window.devicePixelRatio || 1;
|
|
130
|
-
var bwidth = String(cwidth / ratio);
|
|
131
|
-
var bheight = String(cheight / ratio);
|
|
132
|
-
var viewBox = "0 0 ".concat(cwidth, " ").concat(cheight);
|
|
133
|
-
var origWidth = model.svgRoot.getAttribute('width');
|
|
134
|
-
var origHeight = model.svgRoot.getAttribute('height');
|
|
135
|
-
var origViewBox = model.svgRoot.getAttribute('viewBox');
|
|
136
|
-
|
|
137
|
-
if (origWidth !== bwidth) {
|
|
138
|
-
model.svgRoot.setAttribute('width', bwidth);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (origHeight !== bheight) {
|
|
142
|
-
model.svgRoot.setAttribute('height', bheight);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (origViewBox !== viewBox) {
|
|
146
|
-
model.svgRoot.setAttribute('viewBox', viewBox);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function setSvgRootStyle() {
|
|
151
|
-
var viewport = model._renderer.getViewport().map(function (v) {
|
|
152
|
-
return v * 100;
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
model.svgRoot.setAttribute('style', "position: absolute; left: ".concat(viewport[0], "%; top: ").concat(100 - viewport[3], "%; width: ").concat(viewport[2] - viewport[0], "%; height: ").concat(viewport[3] - viewport[1], "%;"));
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function updateSvg() {
|
|
159
|
-
if (model.useSvgLayer) {
|
|
160
|
-
var _loop = function _loop(i) {
|
|
161
|
-
var widget = model.widgets[i];
|
|
162
|
-
var svgReps = widget.getRepresentations().filter(function (r) {
|
|
163
|
-
return r.isA('vtkSVGRepresentation');
|
|
164
|
-
});
|
|
165
|
-
var pendingContent = [];
|
|
166
|
-
|
|
167
|
-
if (widget.getVisibility()) {
|
|
168
|
-
pendingContent = svgReps.filter(function (r) {
|
|
169
|
-
return r.getVisibility();
|
|
170
|
-
}).map(function (r) {
|
|
171
|
-
return r.render();
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
var promise = Promise.all(pendingContent);
|
|
176
|
-
var renders = pendingSvgRenders.get(widget) || [];
|
|
177
|
-
renders.push(promise);
|
|
178
|
-
pendingSvgRenders.set(widget, renders);
|
|
179
|
-
promise.then(function (vnodes) {
|
|
180
|
-
var pendingRenders = pendingSvgRenders.get(widget) || [];
|
|
181
|
-
var idx = pendingRenders.indexOf(promise);
|
|
182
|
-
|
|
183
|
-
if (model.deleted || widget.isDeleted() || idx === -1) {
|
|
184
|
-
return;
|
|
185
|
-
} // throw away previous renders
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
pendingRenders = pendingRenders.slice(idx + 1);
|
|
189
|
-
pendingSvgRenders.set(widget, pendingRenders);
|
|
190
|
-
var oldVTree = svgVTrees.get(widget);
|
|
191
|
-
var newVTree = createSvgElement('g');
|
|
192
|
-
|
|
193
|
-
for (var ni = 0; ni < vnodes.length; ni++) {
|
|
194
|
-
newVTree.appendChild(vnodes[ni]);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
var widgetGroup = widgetToSvgMap.get(widget);
|
|
198
|
-
var node = widgetGroup;
|
|
199
|
-
var patchFns = diff(oldVTree, newVTree);
|
|
200
|
-
|
|
201
|
-
for (var j = 0; j < patchFns.length; j++) {
|
|
202
|
-
node = patchFns[j](node);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if (!widgetGroup && node) {
|
|
206
|
-
// add
|
|
207
|
-
model.svgRoot.appendChild(node);
|
|
208
|
-
widgetToSvgMap.set(widget, node);
|
|
209
|
-
} else if (widgetGroup && !node) {
|
|
210
|
-
// delete
|
|
211
|
-
widgetGroup.remove();
|
|
212
|
-
widgetToSvgMap.delete(widget);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
svgVTrees.set(widget, newVTree);
|
|
216
|
-
});
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
for (var i = 0; i < model.widgets.length; i++) {
|
|
220
|
-
_loop(i);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
} // --------------------------------------------------------------------------
|
|
224
69
|
// Widget scaling
|
|
225
70
|
// --------------------------------------------------------------------------
|
|
226
71
|
|
|
@@ -451,10 +296,10 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
451
296
|
|
|
452
297
|
publicAPI.renderWidgets = function () {
|
|
453
298
|
if (model.pickingEnabled && model.captureOn === CaptureOn.MOUSE_RELEASE) {
|
|
454
|
-
var _model$
|
|
455
|
-
_model$
|
|
456
|
-
w = _model$
|
|
457
|
-
h = _model$
|
|
299
|
+
var _model$_apiSpecificRe = model._apiSpecificRenderWindow.getSize(),
|
|
300
|
+
_model$_apiSpecificRe2 = _slicedToArray(_model$_apiSpecificRe, 2),
|
|
301
|
+
w = _model$_apiSpecificRe2[0],
|
|
302
|
+
h = _model$_apiSpecificRe2[1];
|
|
458
303
|
|
|
459
304
|
captureBuffers(0, 0, w, h);
|
|
460
305
|
}
|
|
@@ -480,11 +325,6 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
480
325
|
|
|
481
326
|
model._selector.setFieldAssociation(FieldAssociations.FIELD_ASSOCIATION_POINTS);
|
|
482
327
|
|
|
483
|
-
subscriptions.push(model._interactor.onRenderEvent(updateSvg));
|
|
484
|
-
subscriptions.push(renderer.onModified(setSvgRootStyle));
|
|
485
|
-
setSvgRootStyle();
|
|
486
|
-
subscriptions.push(model._apiSpecificRenderWindow.onModified(setSvgSize));
|
|
487
|
-
setSvgSize();
|
|
488
328
|
subscriptions.push(model._apiSpecificRenderWindow.onModified(updateDisplayScaleParams));
|
|
489
329
|
subscriptions.push(model._camera.onModified(updateDisplayScaleParams));
|
|
490
330
|
updateDisplayScaleParams();
|
|
@@ -515,10 +355,6 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
515
355
|
if (model.pickingEnabled) {
|
|
516
356
|
publicAPI.enablePicking();
|
|
517
357
|
}
|
|
518
|
-
|
|
519
|
-
if (model.useSvgLayer) {
|
|
520
|
-
enableSvgLayer();
|
|
521
|
-
}
|
|
522
358
|
};
|
|
523
359
|
|
|
524
360
|
function addWidgetInternal(viewWidget) {
|
|
@@ -556,7 +392,6 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
556
392
|
function removeWidgetInternal(viewWidget) {
|
|
557
393
|
model._renderer.removeActor(viewWidget);
|
|
558
394
|
|
|
559
|
-
removeFromSvgLayer(viewWidget);
|
|
560
395
|
viewWidget.delete();
|
|
561
396
|
}
|
|
562
397
|
|
|
@@ -592,7 +427,7 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
592
427
|
|
|
593
428
|
publicAPI.getSelectedDataForXY = /*#__PURE__*/function () {
|
|
594
429
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(x, y) {
|
|
595
|
-
var
|
|
430
|
+
var capturedRegion;
|
|
596
431
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
597
432
|
while (1) {
|
|
598
433
|
switch (_context2.prev = _context2.next) {
|
|
@@ -600,68 +435,37 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
600
435
|
model.selections = null;
|
|
601
436
|
|
|
602
437
|
if (!model.pickingEnabled) {
|
|
603
|
-
_context2.next =
|
|
604
|
-
break;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
i = 0;
|
|
608
|
-
|
|
609
|
-
case 3:
|
|
610
|
-
if (!(i < model.widgets.length)) {
|
|
611
|
-
_context2.next = 16;
|
|
438
|
+
_context2.next = 10;
|
|
612
439
|
break;
|
|
613
440
|
}
|
|
614
441
|
|
|
615
|
-
widget = model.widgets[i];
|
|
616
|
-
hoveredSVGReps = widget.getRepresentations().filter(function (r) {
|
|
617
|
-
return r.isA('vtkSVGRepresentation') && r.getHover() != null;
|
|
618
|
-
});
|
|
619
|
-
|
|
620
|
-
if (!hoveredSVGReps.length) {
|
|
621
|
-
_context2.next = 13;
|
|
622
|
-
break;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
selection = vtkSelectionNode.newInstance();
|
|
626
|
-
selection.getProperties().compositeID = hoveredSVGReps[0].getHover();
|
|
627
|
-
selection.getProperties().widget = widget;
|
|
628
|
-
selection.getProperties().representation = hoveredSVGReps[0];
|
|
629
|
-
model.selections = [selection];
|
|
630
|
-
return _context2.abrupt("return", publicAPI.getSelectedData());
|
|
631
|
-
|
|
632
|
-
case 13:
|
|
633
|
-
++i;
|
|
634
|
-
_context2.next = 3;
|
|
635
|
-
break;
|
|
636
|
-
|
|
637
|
-
case 16:
|
|
638
442
|
if (!(!model._capturedBuffers || model.captureOn === CaptureOn.MOUSE_MOVE)) {
|
|
639
|
-
_context2.next =
|
|
443
|
+
_context2.next = 5;
|
|
640
444
|
break;
|
|
641
445
|
}
|
|
642
446
|
|
|
643
|
-
_context2.next =
|
|
447
|
+
_context2.next = 5;
|
|
644
448
|
return captureBuffers(x, y, x, y);
|
|
645
449
|
|
|
646
|
-
case
|
|
450
|
+
case 5:
|
|
647
451
|
// or do we need a pixel that is outside the last capture?
|
|
648
452
|
capturedRegion = model._capturedBuffers.area;
|
|
649
453
|
|
|
650
454
|
if (!(x < capturedRegion[0] || x > capturedRegion[2] || y < capturedRegion[1] || y > capturedRegion[3])) {
|
|
651
|
-
_context2.next =
|
|
455
|
+
_context2.next = 9;
|
|
652
456
|
break;
|
|
653
457
|
}
|
|
654
458
|
|
|
655
|
-
_context2.next =
|
|
459
|
+
_context2.next = 9;
|
|
656
460
|
return captureBuffers(x, y, x, y);
|
|
657
461
|
|
|
658
|
-
case
|
|
462
|
+
case 9:
|
|
659
463
|
model.selections = model._capturedBuffers.generateSelection(x, y, x, y);
|
|
660
464
|
|
|
661
|
-
case
|
|
465
|
+
case 10:
|
|
662
466
|
return _context2.abrupt("return", publicAPI.getSelectedData());
|
|
663
467
|
|
|
664
|
-
case
|
|
468
|
+
case 11:
|
|
665
469
|
case "end":
|
|
666
470
|
return _context2.stop();
|
|
667
471
|
}
|
|
@@ -678,24 +482,7 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
678
482
|
vtkWarningMacro('updateSelectionFromXY is deprecated, please use getSelectedDataForXY');
|
|
679
483
|
|
|
680
484
|
if (model.pickingEnabled) {
|
|
681
|
-
//
|
|
682
|
-
for (var i = 0; i < model.widgets.length; ++i) {
|
|
683
|
-
var widget = model.widgets[i];
|
|
684
|
-
var hoveredSVGReps = widget.getRepresentations().filter(function (r) {
|
|
685
|
-
return r.isA('vtkSVGRepresentation') && r.getHover() != null;
|
|
686
|
-
});
|
|
687
|
-
|
|
688
|
-
if (hoveredSVGReps.length) {
|
|
689
|
-
var selection = vtkSelectionNode.newInstance();
|
|
690
|
-
selection.getProperties().compositeID = hoveredSVGReps[0].getHover();
|
|
691
|
-
selection.getProperties().widget = widget;
|
|
692
|
-
selection.getProperties().representation = hoveredSVGReps[0];
|
|
693
|
-
model.selections = [selection];
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
} // Then pick regular representations.
|
|
697
|
-
|
|
698
|
-
|
|
485
|
+
// Then pick regular representations.
|
|
699
486
|
if (model.captureOn === CaptureOn.MOUSE_MOVE) {
|
|
700
487
|
captureBuffers(x, y, x, y);
|
|
701
488
|
}
|
|
@@ -707,10 +494,10 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
707
494
|
var pageX = event.pageX,
|
|
708
495
|
pageY = event.pageY;
|
|
709
496
|
|
|
710
|
-
var _model$
|
|
711
|
-
top = _model$
|
|
712
|
-
left = _model$
|
|
713
|
-
height = _model$
|
|
497
|
+
var _model$_apiSpecificRe3 = model._apiSpecificRenderWindow.getCanvas().getBoundingClientRect(),
|
|
498
|
+
top = _model$_apiSpecificRe3.top,
|
|
499
|
+
left = _model$_apiSpecificRe3.left,
|
|
500
|
+
height = _model$_apiSpecificRe3.height;
|
|
714
501
|
|
|
715
502
|
var x = pageX - left;
|
|
716
503
|
var y = height - (pageY - top);
|
|
@@ -730,8 +517,7 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
730
517
|
|
|
731
518
|
var _model$selections$0$g2 = model.selections[0].getProperties(),
|
|
732
519
|
widget = _model$selections$0$g2.widget,
|
|
733
|
-
representation = _model$selections$0$g2.representation; //
|
|
734
|
-
// representation.
|
|
520
|
+
representation = _model$selections$0$g2.representation; // widget is undefined for handle representation.
|
|
735
521
|
|
|
736
522
|
|
|
737
523
|
if (model.previousSelectedData && model.previousSelectedData.prop === prop && model.previousSelectedData.widget === widget && model.previousSelectedData.compositeID === compositeID) {
|
|
@@ -781,26 +567,6 @@ function vtkWidgetManager(publicAPI, model) {
|
|
|
781
567
|
return publicAPI.grabFocus(null);
|
|
782
568
|
};
|
|
783
569
|
|
|
784
|
-
publicAPI.setUseSvgLayer = function (useSvgLayer) {
|
|
785
|
-
if (useSvgLayer !== model.useSvgLayer) {
|
|
786
|
-
model.useSvgLayer = useSvgLayer;
|
|
787
|
-
|
|
788
|
-
if (model._renderer) {
|
|
789
|
-
if (useSvgLayer) {
|
|
790
|
-
enableSvgLayer(); // force a render so svg widgets can be drawn
|
|
791
|
-
|
|
792
|
-
updateSvg();
|
|
793
|
-
} else {
|
|
794
|
-
disableSvgLayer();
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
return true;
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
return false;
|
|
802
|
-
};
|
|
803
|
-
|
|
804
570
|
var superDelete = publicAPI.delete;
|
|
805
571
|
|
|
806
572
|
publicAPI.delete = function () {
|
|
@@ -828,7 +594,6 @@ var DEFAULT_VALUES = {
|
|
|
828
594
|
selections: null,
|
|
829
595
|
previousSelectedData: null,
|
|
830
596
|
widgetInFocus: null,
|
|
831
|
-
useSvgLayer: true,
|
|
832
597
|
captureOn: CaptureOn.MOUSE_MOVE
|
|
833
598
|
}; // ----------------------------------------------------------------------------
|
|
834
599
|
|
|
@@ -841,7 +606,7 @@ function extend(publicAPI, model) {
|
|
|
841
606
|
name: 'viewType',
|
|
842
607
|
enum: ViewTypes
|
|
843
608
|
}]);
|
|
844
|
-
macro.get(publicAPI, model, ['selections', 'widgets', 'viewId', 'pickingEnabled'
|
|
609
|
+
macro.get(publicAPI, model, ['selections', 'widgets', 'viewId', 'pickingEnabled']); // Object specific methods
|
|
845
610
|
|
|
846
611
|
vtkWidgetManager(publicAPI, model);
|
|
847
612
|
} // ----------------------------------------------------------------------------
|
|
@@ -2,21 +2,19 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkActor from '../../Rendering/Core/Actor.js';
|
|
4
4
|
import vtkArrow2DSource from '../../Filters/Sources/Arrow2DSource.js';
|
|
5
|
-
import
|
|
6
|
-
import vtkGlyph3DMapper from '../../Rendering/Core/Glyph3DMapper.js';
|
|
7
|
-
import vtkHandleRepresentation from './HandleRepresentation.js';
|
|
5
|
+
import vtkGlyphRepresentation from './GlyphRepresentation.js';
|
|
8
6
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
9
7
|
import vtkPixelSpaceCallbackMapper from '../../Rendering/Core/PixelSpaceCallbackMapper.js';
|
|
10
|
-
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
11
8
|
import vtkConeSource from '../../Filters/Sources/ConeSource.js';
|
|
12
9
|
import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
|
|
13
10
|
import vtkCircleSource from '../../Filters/Sources/CircleSource.js';
|
|
14
11
|
import vtkCubeSource from '../../Filters/Sources/CubeSource.js';
|
|
15
12
|
import vtkViewFinderSource from '../../Filters/Sources/ViewFinderSource.js';
|
|
16
13
|
import Constants from '../Widgets3D/LineWidget/Constants.js';
|
|
17
|
-
import { ScalarMode } from '../../Rendering/Core/Mapper/Constants.js';
|
|
18
14
|
import { mat4, mat3, vec3 } from 'gl-matrix';
|
|
19
15
|
import { RenderingTypes } from '../Core/WidgetManager/Constants.js';
|
|
16
|
+
import { OrientationModes } from '../../Rendering/Core/Glyph3DMapper/Constants.js';
|
|
17
|
+
import { allocateArray } from './WidgetRepresentation.js';
|
|
20
18
|
|
|
21
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; }
|
|
22
20
|
|
|
@@ -35,35 +33,11 @@ function vtkArrowHandleRepresentation(publicAPI, model) {
|
|
|
35
33
|
// Internal polydata dataset
|
|
36
34
|
// --------------------------------------------------------------------------
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
model.internalPolyData = vtkPolyData.newInstance({
|
|
40
|
-
mtime: 0
|
|
41
|
-
});
|
|
42
|
-
model.internalArrays = {
|
|
43
|
-
points: model.internalPolyData.getPoints(),
|
|
44
|
-
scale: vtkDataArray.newInstance({
|
|
45
|
-
name: 'scale',
|
|
46
|
-
numberOfComponents: 1,
|
|
47
|
-
empty: true
|
|
48
|
-
}),
|
|
49
|
-
color: vtkDataArray.newInstance({
|
|
50
|
-
name: 'color',
|
|
51
|
-
numberOfComponents: 1,
|
|
52
|
-
empty: true
|
|
53
|
-
}),
|
|
54
|
-
direction: vtkDataArray.newInstance({
|
|
55
|
-
name: 'direction',
|
|
56
|
-
numberOfComponents: 9,
|
|
57
|
-
empty: true
|
|
58
|
-
})
|
|
59
|
-
};
|
|
60
|
-
model.internalPolyData.getPointData().addArray(model.internalArrays.scale);
|
|
61
|
-
model.internalPolyData.getPointData().addArray(model.internalArrays.color);
|
|
62
|
-
model.internalPolyData.getPointData().addArray(model.internalArrays.direction);
|
|
63
36
|
/**
|
|
64
37
|
* Set the shape for the glyph according to lineWidget state inputs
|
|
65
38
|
*/
|
|
66
39
|
|
|
40
|
+
|
|
67
41
|
function createGlyph(shape) {
|
|
68
42
|
var _representationToSour;
|
|
69
43
|
|
|
@@ -148,23 +122,12 @@ function vtkArrowHandleRepresentation(publicAPI, model) {
|
|
|
148
122
|
model.displayActor.setMapper(model.displayMapper);
|
|
149
123
|
model.displayMapper.setInputConnection(publicAPI.getOutputPort());
|
|
150
124
|
publicAPI.addActor(model.displayActor);
|
|
151
|
-
model.alwaysVisibleActors = [model.displayActor];
|
|
152
|
-
model.mapper = vtkGlyph3DMapper.newInstance({
|
|
153
|
-
orientationArray: 'direction',
|
|
154
|
-
scaleArray: 'scale',
|
|
155
|
-
colorByArrayName: 'color',
|
|
156
|
-
scalarMode: ScalarMode.USE_POINT_FIELD_DATA
|
|
157
|
-
});
|
|
158
|
-
model.mapper.setOrientationModeToMatrix();
|
|
159
|
-
model.mapper.setInputConnection(publicAPI.getOutputPort());
|
|
160
|
-
model.actor = vtkActor.newInstance({
|
|
161
|
-
parentProp: publicAPI
|
|
162
|
-
});
|
|
163
|
-
model.actor.setMapper(model.mapper);
|
|
164
|
-
publicAPI.addActor(model.actor); // --------------------------------------------------------------------------
|
|
125
|
+
model.alwaysVisibleActors = [model.displayActor]; // --------------------------------------------------------------------------
|
|
165
126
|
|
|
166
127
|
publicAPI.setGlyphResolution = macro.chain(publicAPI.setGlyphResolution, function (r) {
|
|
167
|
-
return model.glyph.setPhiResolution(r)
|
|
128
|
+
return model._pipeline.glyph.setPhiResolution(r);
|
|
129
|
+
}, function (r) {
|
|
130
|
+
return model._pipeline.glyph.setThetaResolution(r);
|
|
168
131
|
}); // --------------------------------------------------------------------------
|
|
169
132
|
|
|
170
133
|
function callbackProxy(coords) {
|
|
@@ -255,76 +218,32 @@ function vtkArrowHandleRepresentation(publicAPI, model) {
|
|
|
255
218
|
return orientationRotation;
|
|
256
219
|
}
|
|
257
220
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
publicAPI.getRepresentationStates = function () {
|
|
261
|
-
var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : model.inputData[0];
|
|
262
|
-
return superGetRepresentationStates(input).filter(function (state) {
|
|
263
|
-
var _state$getOrigin, _state$isVisible;
|
|
221
|
+
function applyOrientation(polyData, states) {
|
|
222
|
+
model._pipeline.mapper.setOrientationArray('orientation');
|
|
264
223
|
|
|
265
|
-
|
|
266
|
-
});
|
|
267
|
-
};
|
|
224
|
+
model._pipeline.mapper.setOrientationMode(OrientationModes.MATRIX);
|
|
268
225
|
|
|
269
|
-
|
|
270
|
-
var
|
|
271
|
-
points = _model$internalArrays.points,
|
|
272
|
-
scale = _model$internalArrays.scale,
|
|
273
|
-
color = _model$internalArrays.color,
|
|
274
|
-
direction = _model$internalArrays.direction;
|
|
275
|
-
var list = publicAPI.getRepresentationStates(inData[0]);
|
|
276
|
-
var totalCount = list.length;
|
|
277
|
-
|
|
278
|
-
if (color.getNumberOfValues() !== totalCount) {
|
|
279
|
-
// Need to resize dataset
|
|
280
|
-
points.setData(new Float32Array(3 * totalCount), 3);
|
|
281
|
-
scale.setData(new Float32Array(totalCount));
|
|
282
|
-
color.setData(new Float32Array(totalCount));
|
|
283
|
-
direction.setData(new Float32Array(9 * totalCount));
|
|
284
|
-
}
|
|
226
|
+
var orientation = allocateArray(polyData, 'orientation', states.length, 'Float32Array', 9).getData();
|
|
227
|
+
var defaultScale3 = [1, 1, 1];
|
|
285
228
|
|
|
286
|
-
var
|
|
287
|
-
|
|
288
|
-
scale: scale.getData(),
|
|
289
|
-
color: color.getData(),
|
|
290
|
-
direction: direction.getData()
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
for (var i = 0; i < totalCount; i++) {
|
|
294
|
-
var state = list[i];
|
|
295
|
-
var isActive = state.getActive();
|
|
296
|
-
var scaleFactor = isActive ? model.activeScaleFactor : 1;
|
|
297
|
-
var coord = state.getOrigin();
|
|
298
|
-
|
|
299
|
-
if (coord) {
|
|
300
|
-
typedArray.points[i * 3 + 0] = coord[0];
|
|
301
|
-
typedArray.points[i * 3 + 1] = coord[1];
|
|
302
|
-
typedArray.points[i * 3 + 2] = coord[2];
|
|
303
|
-
var scale3 = state.getScale3 ? state.getScale3() : [1, 1, 1];
|
|
304
|
-
scale3 = scale3.map(function (x) {
|
|
305
|
-
return x === 0 ? 2 * model.defaultScale : 2 * x;
|
|
306
|
-
});
|
|
307
|
-
var rotation = getGlyphRotation(scale3);
|
|
308
|
-
typedArray.direction.set(rotation, 9 * i);
|
|
309
|
-
typedArray.scale[i] = scaleFactor * (state.getScale1 ? state.getScale1() : model.defaultScale);
|
|
310
|
-
|
|
311
|
-
if (publicAPI.getScaleInPixels()) {
|
|
312
|
-
typedArray.scale[i] *= publicAPI.getPixelWorldHeightAtCoord(coord);
|
|
313
|
-
}
|
|
229
|
+
for (var i = 0; i < states.length; ++i) {
|
|
230
|
+
var _states$i$getScale, _states$i$getScale2, _states$i;
|
|
314
231
|
|
|
315
|
-
|
|
316
|
-
|
|
232
|
+
var scale3 = (_states$i$getScale = (_states$i$getScale2 = (_states$i = states[i]).getScale3) === null || _states$i$getScale2 === void 0 ? void 0 : _states$i$getScale2.call(_states$i)) !== null && _states$i$getScale !== void 0 ? _states$i$getScale : defaultScale3;
|
|
233
|
+
var rotation = getGlyphRotation(scale3);
|
|
234
|
+
orientation.set(rotation, 9 * i);
|
|
317
235
|
}
|
|
236
|
+
}
|
|
318
237
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
};
|
|
238
|
+
publicAPI.setDirection(applyOrientation);
|
|
239
|
+
publicAPI.setNoOrientation(applyOrientation);
|
|
322
240
|
|
|
323
241
|
publicAPI.requestData = function (inData, outData) {
|
|
324
242
|
var _publicAPI$getReprese;
|
|
325
243
|
|
|
244
|
+
// FIXME: shape should NOT be mixin, but a representation property.
|
|
326
245
|
var shape = (_publicAPI$getReprese = publicAPI.getRepresentationStates(inData[0])[0]) === null || _publicAPI$getReprese === void 0 ? void 0 : _publicAPI$getReprese.getShape();
|
|
327
|
-
var shouldCreateGlyph = model.glyph == null;
|
|
246
|
+
var shouldCreateGlyph = model._pipeline.glyph == null;
|
|
328
247
|
|
|
329
248
|
if (model.shape !== shape && Object.values(ShapeType).includes(shape)) {
|
|
330
249
|
model.shape = shape;
|
|
@@ -332,11 +251,12 @@ function vtkArrowHandleRepresentation(publicAPI, model) {
|
|
|
332
251
|
}
|
|
333
252
|
|
|
334
253
|
if (shouldCreateGlyph && model.shape) {
|
|
335
|
-
model.glyph = createGlyph(model.shape);
|
|
336
|
-
|
|
254
|
+
model._pipeline.glyph = createGlyph(model.shape);
|
|
255
|
+
|
|
256
|
+
model._pipeline.mapper.setInputConnection(model._pipeline.glyph.getOutputPort(), 1);
|
|
337
257
|
}
|
|
338
258
|
|
|
339
|
-
|
|
259
|
+
return superClass.requestData(inData, outData);
|
|
340
260
|
};
|
|
341
261
|
|
|
342
262
|
publicAPI.updateActorVisibility = function () {
|
|
@@ -362,7 +282,6 @@ function vtkArrowHandleRepresentation(publicAPI, model) {
|
|
|
362
282
|
|
|
363
283
|
function defaultValues(initialValues) {
|
|
364
284
|
return _objectSpread({
|
|
365
|
-
defaultScale: 1,
|
|
366
285
|
faceCamera: null,
|
|
367
286
|
orientation: [1, 0, 0],
|
|
368
287
|
shape: ShapeType.SPHERE,
|
|
@@ -374,8 +293,7 @@ function defaultValues(initialValues) {
|
|
|
374
293
|
function extend(publicAPI, model) {
|
|
375
294
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
376
295
|
Object.assign(model, defaultValues(initialValues));
|
|
377
|
-
|
|
378
|
-
macro.get(publicAPI, model, ['glyph', 'mapper', 'actor']);
|
|
296
|
+
vtkGlyphRepresentation.extend(publicAPI, model, initialValues);
|
|
379
297
|
macro.setGetArray(publicAPI, model, ['visibilityFlagArray'], 2);
|
|
380
298
|
macro.setGetArray(publicAPI, model, ['orientation'], 3);
|
|
381
299
|
macro.setGetArray(publicAPI, model, ['viewMatrix'], 16);
|