@kitware/vtk.js 25.9.1 → 26.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/Core/CellArray.d.ts +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/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 +22 -14
- 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/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/SVG/SVGLandmarkRepresentation.js +1 -13
- package/Widgets/Widgets3D/AngleWidget.js +1 -4
- package/Widgets/Widgets3D/EllipseWidget/state.js +1 -1
- 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/index.d.ts +0 -1
- package/macros.d.ts +3 -5
- package/macros.js +4 -35
- package/package.json +2 -2
- package/Widgets/Representations/ResliceCursorContextRepresentation/Constants.js +0 -12
- package/Widgets/Representations/ResliceCursorContextRepresentation.d.ts +0 -54
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +0 -357
- 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
|
@@ -11,7 +11,7 @@ import vtkPlane from '../../Common/DataModel/Plane.js';
|
|
|
11
11
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
12
12
|
import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
|
|
13
13
|
import vtkStateBuilder from '../Core/StateBuilder.js';
|
|
14
|
-
import vtkWidgetRepresentation from './WidgetRepresentation.js';
|
|
14
|
+
import vtkWidgetRepresentation, { getPixelWorldHeightAtCoord } from './WidgetRepresentation.js';
|
|
15
15
|
import WidgetManagerConst from '../Core/WidgetManager/Constants.js';
|
|
16
16
|
import PropertyConst from '../../Rendering/Core/Property/Constants.js';
|
|
17
17
|
|
|
@@ -92,8 +92,8 @@ function vtkImplicitPlaneRepresentation(publicAPI, model) {
|
|
|
92
92
|
|
|
93
93
|
model.plane = vtkPlane.newInstance();
|
|
94
94
|
model.matrix = vtkMatrixBuilder.buildFromDegree();
|
|
95
|
-
model.
|
|
96
|
-
model.
|
|
95
|
+
model._pipelines = {};
|
|
96
|
+
model._pipelines.outline = {
|
|
97
97
|
source: vtkCubeSource.newInstance(),
|
|
98
98
|
mapper: vtkMapper.newInstance(),
|
|
99
99
|
actor: vtkActor.newInstance({
|
|
@@ -101,15 +101,18 @@ function vtkImplicitPlaneRepresentation(publicAPI, model) {
|
|
|
101
101
|
_parentProp: publicAPI
|
|
102
102
|
})
|
|
103
103
|
};
|
|
104
|
-
model.
|
|
105
|
-
source:
|
|
104
|
+
model._pipelines.plane = {
|
|
105
|
+
source: vtkCutter.newInstance({
|
|
106
|
+
cutFunction: model.plane
|
|
107
|
+
}),
|
|
108
|
+
filter: vtkClosedPolyLineToSurfaceFilter.newInstance(),
|
|
106
109
|
mapper: vtkMapper.newInstance(),
|
|
107
110
|
actor: vtkActor.newInstance({
|
|
108
111
|
pickable: true,
|
|
109
112
|
_parentProp: publicAPI
|
|
110
113
|
})
|
|
111
114
|
};
|
|
112
|
-
model.
|
|
115
|
+
model._pipelines.origin = {
|
|
113
116
|
source: vtkSphereSource.newInstance(),
|
|
114
117
|
mapper: vtkMapper.newInstance(),
|
|
115
118
|
actor: vtkActor.newInstance({
|
|
@@ -117,7 +120,7 @@ function vtkImplicitPlaneRepresentation(publicAPI, model) {
|
|
|
117
120
|
_parentProp: publicAPI
|
|
118
121
|
})
|
|
119
122
|
};
|
|
120
|
-
model.
|
|
123
|
+
model._pipelines.normal = {
|
|
121
124
|
source: vtkCylinderSource.newInstance(),
|
|
122
125
|
mapper: vtkMapper.newInstance(),
|
|
123
126
|
actor: vtkActor.newInstance({
|
|
@@ -125,7 +128,7 @@ function vtkImplicitPlaneRepresentation(publicAPI, model) {
|
|
|
125
128
|
_parentProp: publicAPI
|
|
126
129
|
})
|
|
127
130
|
};
|
|
128
|
-
model.
|
|
131
|
+
model._pipelines.display2D = {
|
|
129
132
|
source: publicAPI,
|
|
130
133
|
mapper: vtkPixelSpaceCallbackMapper.newInstance(),
|
|
131
134
|
actor: vtkActor.newInstance({
|
|
@@ -134,21 +137,18 @@ function vtkImplicitPlaneRepresentation(publicAPI, model) {
|
|
|
134
137
|
})
|
|
135
138
|
}; // Plane generation pipeline
|
|
136
139
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
model.
|
|
142
|
-
vtkWidgetRepresentation.connectPipeline(model.
|
|
143
|
-
vtkWidgetRepresentation.connectPipeline(model.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
publicAPI.addActor(model.
|
|
148
|
-
publicAPI.addActor(model.
|
|
149
|
-
publicAPI.addActor(model.pipelines.origin.actor);
|
|
150
|
-
publicAPI.addActor(model.pipelines.normal.actor);
|
|
151
|
-
publicAPI.addActor(model.pipelines.display2D.actor); // --------------------------------------------------------------------------
|
|
140
|
+
model._pipelines.plane.source.setInputConnection(model._pipelines.outline.source.getOutputPort());
|
|
141
|
+
|
|
142
|
+
vtkWidgetRepresentation.connectPipeline(model._pipelines.outline);
|
|
143
|
+
vtkWidgetRepresentation.connectPipeline(model._pipelines.plane);
|
|
144
|
+
vtkWidgetRepresentation.connectPipeline(model._pipelines.origin);
|
|
145
|
+
vtkWidgetRepresentation.connectPipeline(model._pipelines.normal);
|
|
146
|
+
vtkWidgetRepresentation.connectPipeline(model._pipelines.display2D);
|
|
147
|
+
publicAPI.addActor(model._pipelines.outline.actor);
|
|
148
|
+
publicAPI.addActor(model._pipelines.plane.actor);
|
|
149
|
+
publicAPI.addActor(model._pipelines.origin.actor);
|
|
150
|
+
publicAPI.addActor(model._pipelines.normal.actor);
|
|
151
|
+
publicAPI.addActor(model._pipelines.display2D.actor); // --------------------------------------------------------------------------
|
|
152
152
|
|
|
153
153
|
publicAPI.requestData = function (inData, outData) {
|
|
154
154
|
var state = inData[0];
|
|
@@ -165,46 +165,58 @@ function vtkImplicitPlaneRepresentation(publicAPI, model) {
|
|
|
165
165
|
// Update cube parameters
|
|
166
166
|
// --------------------------------
|
|
167
167
|
|
|
168
|
-
model.
|
|
168
|
+
model._pipelines.outline.source.setCenter((bounds[0] + bounds[1]) * 0.5, (bounds[2] + bounds[3]) * 0.5, (bounds[4] + bounds[5]) * 0.5);
|
|
169
|
+
|
|
169
170
|
var xRange = bounds[1] - bounds[0];
|
|
170
171
|
var yRange = bounds[3] - bounds[2];
|
|
171
172
|
var zRange = bounds[5] - bounds[4];
|
|
172
|
-
|
|
173
|
-
model.
|
|
174
|
-
|
|
173
|
+
|
|
174
|
+
model._pipelines.outline.source.setXLength(xRange);
|
|
175
|
+
|
|
176
|
+
model._pipelines.outline.source.setYLength(yRange);
|
|
177
|
+
|
|
178
|
+
model._pipelines.outline.source.setZLength(zRange); // --------------------------------
|
|
175
179
|
// Update normal parameters
|
|
176
180
|
// --------------------------------
|
|
177
181
|
|
|
182
|
+
|
|
178
183
|
var pixelScale = 1;
|
|
179
184
|
|
|
180
185
|
if (model.scaleInPixels) {
|
|
181
|
-
pixelScale =
|
|
186
|
+
pixelScale = getPixelWorldHeightAtCoord(origin, model.displayScaleParams);
|
|
182
187
|
}
|
|
183
188
|
|
|
184
|
-
model.
|
|
189
|
+
model._pipelines.normal.source.set({
|
|
185
190
|
height: Math.max(xRange, yRange, zRange),
|
|
186
191
|
radius: model.handleSizeRatio * Math.min(xRange, yRange, zRange) * model.axisScale * pixelScale,
|
|
187
192
|
resolution: model.sphereResolution
|
|
188
193
|
});
|
|
189
|
-
|
|
194
|
+
|
|
195
|
+
var yAxis = model._pipelines.normal.source.getOutputData();
|
|
196
|
+
|
|
190
197
|
var newAxis = vtkPolyData.newInstance();
|
|
191
198
|
newAxis.shallowCopy(yAxis);
|
|
192
199
|
newAxis.getPoints().setData(Float32Array.from(yAxis.getPoints().getData()), 3);
|
|
193
200
|
newAxis.getPointData().removeAllArrays();
|
|
194
201
|
model.matrix.identity().translate(origin[0], origin[1], origin[2]).rotateFromDirections([0, 1, 0], normal).apply(newAxis.getPoints().getData());
|
|
195
|
-
|
|
202
|
+
|
|
203
|
+
model._pipelines.normal.mapper.setInputData(newAxis); // --------------------------------
|
|
196
204
|
// Update origin parameters
|
|
197
205
|
// --------------------------------
|
|
198
206
|
|
|
199
|
-
|
|
207
|
+
|
|
208
|
+
model._pipelines.origin.actor.setPosition(origin);
|
|
209
|
+
|
|
200
210
|
var handleScale = model.handleSizeRatio * Math.min(xRange, yRange, zRange) * pixelScale;
|
|
201
|
-
|
|
211
|
+
|
|
212
|
+
model._pipelines.origin.actor.setScale(handleScale, handleScale, handleScale); // --------------------------------
|
|
202
213
|
// Update style since state changed
|
|
203
214
|
// --------------------------------
|
|
204
215
|
|
|
205
|
-
|
|
216
|
+
|
|
217
|
+
vtkWidgetRepresentation.applyStyles(model._pipelines, model.representationStyle, state.getActive() && state.getActiveHandle());
|
|
206
218
|
var output = vtkPolyData.newInstance();
|
|
207
|
-
output.shallowCopy(model.
|
|
219
|
+
output.shallowCopy(model._pipelines.plane.filter.getOutputData());
|
|
208
220
|
outData[0] = output;
|
|
209
221
|
}; // --------------------------------------------------------------------------
|
|
210
222
|
// Set/Get Forwarding
|
|
@@ -213,13 +225,13 @@ function vtkImplicitPlaneRepresentation(publicAPI, model) {
|
|
|
213
225
|
|
|
214
226
|
publicAPI.setSphereResolution = function (res) {
|
|
215
227
|
model.sphereResolution = res;
|
|
216
|
-
return model.
|
|
228
|
+
return model._pipelines.origin.source.setPhiResolution(res) && model._pipelines.origin.source.setThetaResolution(res);
|
|
217
229
|
};
|
|
218
230
|
|
|
219
231
|
publicAPI.setRepresentationStyle = function (style) {
|
|
220
232
|
model.representationStyle = vtkWidgetRepresentation.mergeStyles(STYLE_PIPELINE_NAMES, model.representationStyle, style); // Apply static and inactive
|
|
221
233
|
|
|
222
|
-
vtkWidgetRepresentation.applyStyles(model.
|
|
234
|
+
vtkWidgetRepresentation.applyStyles(model._pipelines, model.representationStyle); // Force requestData to execute
|
|
223
235
|
|
|
224
236
|
publicAPI.modified();
|
|
225
237
|
}; // --------------------------------------------------------------------------
|
|
@@ -234,21 +246,28 @@ function vtkImplicitPlaneRepresentation(publicAPI, model) {
|
|
|
234
246
|
outlineVisible = model.outlineVisible;
|
|
235
247
|
|
|
236
248
|
if (renderingType === RenderingTypes.PICKING_BUFFER) {
|
|
237
|
-
model.
|
|
238
|
-
|
|
239
|
-
model.
|
|
249
|
+
model._pipelines.plane.actor.setVisibility(planeVisible);
|
|
250
|
+
|
|
251
|
+
model._pipelines.origin.actor.setVisibility(originVisible);
|
|
252
|
+
|
|
253
|
+
model._pipelines.normal.actor.setVisibility(normalVisible); //
|
|
240
254
|
|
|
241
|
-
|
|
255
|
+
|
|
256
|
+
model._pipelines.plane.actor.getProperty().setOpacity(1);
|
|
242
257
|
} else {
|
|
243
|
-
model.
|
|
244
|
-
|
|
245
|
-
model.
|
|
246
|
-
|
|
258
|
+
model._pipelines.outline.actor.setVisibility(outlineVisible && ctxVisible);
|
|
259
|
+
|
|
260
|
+
model._pipelines.plane.actor.setVisibility(planeVisible && hVisible);
|
|
261
|
+
|
|
262
|
+
model._pipelines.origin.actor.setVisibility(originVisible && hVisible);
|
|
263
|
+
|
|
264
|
+
model._pipelines.normal.actor.setVisibility(normalVisible && hVisible); //
|
|
265
|
+
|
|
247
266
|
|
|
248
267
|
var state = model.inputData[0];
|
|
249
268
|
|
|
250
269
|
if (state) {
|
|
251
|
-
vtkWidgetRepresentation.applyStyles(model.
|
|
270
|
+
vtkWidgetRepresentation.applyStyles(model._pipelines, model.representationStyle, state.getActive() && state.getActiveHandle());
|
|
252
271
|
}
|
|
253
272
|
}
|
|
254
273
|
}; // --------------------------------------------------------------------------
|
|
@@ -262,15 +281,15 @@ function vtkImplicitPlaneRepresentation(publicAPI, model) {
|
|
|
262
281
|
state.setActiveHandle(prop);
|
|
263
282
|
|
|
264
283
|
switch (prop) {
|
|
265
|
-
case model.
|
|
284
|
+
case model._pipelines.plane.actor:
|
|
266
285
|
state.setUpdateMethodName('updateFromPlane');
|
|
267
286
|
break;
|
|
268
287
|
|
|
269
|
-
case model.
|
|
288
|
+
case model._pipelines.origin.actor:
|
|
270
289
|
state.setUpdateMethodName('updateFromOrigin');
|
|
271
290
|
break;
|
|
272
291
|
|
|
273
|
-
case model.
|
|
292
|
+
case model._pipelines.normal.actor:
|
|
274
293
|
state.setUpdateMethodName('updateFromNormal');
|
|
275
294
|
break;
|
|
276
295
|
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import macro from '../../macros.js';
|
|
3
|
+
import vtkActor from '../../Rendering/Core/Actor.js';
|
|
4
|
+
import vtkGlyphRepresentation from './GlyphRepresentation.js';
|
|
5
|
+
import vtkPixelSpaceCallbackMapper from '../../Rendering/Core/PixelSpaceCallbackMapper.js';
|
|
6
|
+
import vtkCylinderSource from '../../Filters/Sources/CylinderSource.js';
|
|
7
|
+
import { allocateArray } from './WidgetRepresentation.js';
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
var INFINITE_RATIO = 100000; // ----------------------------------------------------------------------------
|
|
13
|
+
// vtkLineHandleRepresentation methods
|
|
14
|
+
// ----------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
function vtkLineHandleRepresentation(publicAPI, model) {
|
|
17
|
+
// Set our className
|
|
18
|
+
model.classHierarchy.push('vtkLineHandleRepresentation'); // --------------------------------------------------------------------------
|
|
19
|
+
// Generic rendering pipeline
|
|
20
|
+
// --------------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
* displayActors and displayMappers are used to render objects in HTML, allowing objects
|
|
24
|
+
* to be 'rendered' internally in a VTK scene without being visible on the final output
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
model.displayMapper = vtkPixelSpaceCallbackMapper.newInstance();
|
|
28
|
+
model.displayActor = vtkActor.newInstance({
|
|
29
|
+
parentProp: publicAPI
|
|
30
|
+
}); // model.displayActor.getProperty().setOpacity(0); // don't show in 3D
|
|
31
|
+
|
|
32
|
+
model.displayActor.setMapper(model.displayMapper);
|
|
33
|
+
model.displayMapper.setInputConnection(publicAPI.getOutputPort());
|
|
34
|
+
publicAPI.addActor(model.displayActor);
|
|
35
|
+
model.alwaysVisibleActors = [model.displayActor]; // --------------------------------------------------------------------------
|
|
36
|
+
|
|
37
|
+
publicAPI.setGlyphResolution = macro.chain(publicAPI.setGlyphResolution, model._pipeline.glyph.setThetaResolution, model._pipeline.glyph.setPhiResolution); // --------------------------------------------------------------------------
|
|
38
|
+
|
|
39
|
+
function callbackProxy(coords) {
|
|
40
|
+
if (model.displayCallback) {
|
|
41
|
+
var filteredList = [];
|
|
42
|
+
var states = publicAPI.getRepresentationStates();
|
|
43
|
+
|
|
44
|
+
for (var i = 0; i < states.length; i++) {
|
|
45
|
+
if (states[i].getActive()) {
|
|
46
|
+
filteredList.push(coords[i]);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (filteredList.length) {
|
|
51
|
+
model.displayCallback(filteredList);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
model.displayCallback();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
publicAPI.setDisplayCallback = function (callback) {
|
|
60
|
+
model.displayCallback = callback;
|
|
61
|
+
model.displayMapper.setCallback(callback ? callbackProxy : null);
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Overwrite scale3 to optionally make lines infinite
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
var superScale3 = publicAPI.getScale3();
|
|
69
|
+
publicAPI.setScale3(function (polyData, states) {
|
|
70
|
+
superScale3(polyData, states);
|
|
71
|
+
|
|
72
|
+
if (model.infiniteLine) {
|
|
73
|
+
var scales = allocateArray(polyData, 'scale', states.length, 'Float32Array', 3).getData();
|
|
74
|
+
|
|
75
|
+
for (var i = 0; i < states.length; ++i) {
|
|
76
|
+
scales[3 * i + 2] = INFINITE_RATIO;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
} // ----------------------------------------------------------------------------
|
|
81
|
+
// Object factory
|
|
82
|
+
// ----------------------------------------------------------------------------
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
function defaultValues(initialValues) {
|
|
86
|
+
var _initialValues$glyphR;
|
|
87
|
+
|
|
88
|
+
return _objectSpread({
|
|
89
|
+
infiniteLine: true,
|
|
90
|
+
glyphResolution: 4,
|
|
91
|
+
_pipeline: {
|
|
92
|
+
glyph: vtkCylinderSource.newInstance({
|
|
93
|
+
resolution: (_initialValues$glyphR = initialValues.glyphResolution) !== null && _initialValues$glyphR !== void 0 ? _initialValues$glyphR : 4,
|
|
94
|
+
direction: [0, 0, 1]
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
}, initialValues);
|
|
98
|
+
} // ----------------------------------------------------------------------------
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
function extend(publicAPI, model) {
|
|
102
|
+
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
103
|
+
vtkGlyphRepresentation.extend(publicAPI, model, defaultValues(initialValues));
|
|
104
|
+
macro.setGet(publicAPI, model, ['infiniteLine', 'glyphResolution']); // Object specific methods
|
|
105
|
+
|
|
106
|
+
vtkLineHandleRepresentation(publicAPI, model);
|
|
107
|
+
} // ----------------------------------------------------------------------------
|
|
108
|
+
|
|
109
|
+
var newInstance = macro.newInstance(extend, 'vtkLineHandleRepresentation'); // ----------------------------------------------------------------------------
|
|
110
|
+
|
|
111
|
+
var vtkLineHandleRepresentation$1 = {
|
|
112
|
+
newInstance: newInstance,
|
|
113
|
+
extend: extend
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export { vtkLineHandleRepresentation$1 as default, extend, newInstance };
|
|
@@ -4,10 +4,10 @@ import vtkActor from '../../Rendering/Core/Actor.js';
|
|
|
4
4
|
import vtkMapper from '../../Rendering/Core/Mapper.js';
|
|
5
5
|
import { C as areEquals } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
7
|
-
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
8
7
|
import vtkTubeFilter from '../../Filters/General/TubeFilter.js';
|
|
9
|
-
import vtkWidgetRepresentation from './WidgetRepresentation.js';
|
|
8
|
+
import vtkWidgetRepresentation, { allocateArray, getPixelWorldHeightAtCoord } from './WidgetRepresentation.js';
|
|
10
9
|
import { RenderingTypes } from '../Core/WidgetManager/Constants.js';
|
|
10
|
+
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
11
11
|
|
|
12
12
|
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; }
|
|
13
13
|
|
|
@@ -24,36 +24,35 @@ function vtkPolyLineRepresentation(publicAPI, model) {
|
|
|
24
24
|
// --------------------------------------------------------------------------
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
var internalPolyData = vtkPolyData.newInstance({
|
|
28
28
|
mtime: 0
|
|
29
29
|
});
|
|
30
|
-
model.cells = [];
|
|
31
30
|
|
|
32
|
-
function allocateSize(size) {
|
|
33
|
-
var closePolyLine = arguments.length >
|
|
31
|
+
function allocateSize(polyData, size) {
|
|
32
|
+
var closePolyLine = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
33
|
+
var points = null;
|
|
34
34
|
|
|
35
35
|
if (size < 2) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
// FIXME: Why 1 point and not 0 ?
|
|
37
|
+
points = allocateArray(polyData, 'points', 1).getData();
|
|
38
|
+
points.set([0, 0, 0]);
|
|
39
|
+
allocateArray(polyData, 'lines', 0).getData();
|
|
40
|
+
} else if (!polyData.getPoints() || polyData.getPoints().length !== size * 3) {
|
|
41
|
+
points = allocateArray(polyData, 'points', size).getData();
|
|
42
|
+
var cellSize = size + 1 + (closePolyLine ? 1 : 0);
|
|
43
|
+
var cells = allocateArray(polyData, 'lines', cellSize).getData();
|
|
44
|
+
cells[0] = cells.length - 1;
|
|
45
|
+
|
|
46
|
+
for (var i = 1; i < cells.length; i++) {
|
|
47
|
+
cells[i] = i - 1;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
if (closePolyLine) {
|
|
48
|
-
|
|
49
|
-
console.log('closePolyLine', closePolyLine, model.cells);
|
|
51
|
+
cells[cells.length - 1] = 0;
|
|
50
52
|
}
|
|
51
|
-
|
|
52
|
-
model.internalPolyData.getPoints().setData(model.points, 3);
|
|
53
|
-
model.internalPolyData.getLines().setData(model.cells);
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
return
|
|
55
|
+
return points;
|
|
57
56
|
}
|
|
58
57
|
/**
|
|
59
58
|
* Change the line/tube thickness.
|
|
@@ -64,34 +63,39 @@ function vtkPolyLineRepresentation(publicAPI, model) {
|
|
|
64
63
|
function applyLineThickness(lineThickness) {
|
|
65
64
|
var scaledLineThickness = lineThickness;
|
|
66
65
|
|
|
67
|
-
if (publicAPI.getScaleInPixels()) {
|
|
68
|
-
var center = vtkBoundingBox.getCenter(
|
|
69
|
-
scaledLineThickness *=
|
|
66
|
+
if (publicAPI.getScaleInPixels() && internalPolyData) {
|
|
67
|
+
var center = vtkBoundingBox.getCenter(internalPolyData.getBounds());
|
|
68
|
+
scaledLineThickness *= getPixelWorldHeightAtCoord(center, model.displayScaleParams);
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
model.tubes.setRadius(scaledLineThickness);
|
|
71
|
+
model._pipelines.tubes.filter.setRadius(scaledLineThickness);
|
|
73
72
|
} // --------------------------------------------------------------------------
|
|
74
73
|
// Generic rendering pipeline
|
|
75
74
|
// --------------------------------------------------------------------------
|
|
76
75
|
|
|
77
76
|
|
|
78
|
-
model.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
77
|
+
model._pipelines = {
|
|
78
|
+
tubes: {
|
|
79
|
+
source: publicAPI,
|
|
80
|
+
filter: vtkTubeFilter.newInstance({
|
|
81
|
+
radius: model.lineThickness,
|
|
82
|
+
numberOfSides: 12,
|
|
83
|
+
capping: false
|
|
84
|
+
}),
|
|
85
|
+
mapper: vtkMapper.newInstance(),
|
|
86
|
+
actor: vtkActor.newInstance({
|
|
87
|
+
parentProp: publicAPI
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
vtkWidgetRepresentation.connectPipeline(model._pipelines.tubes);
|
|
92
|
+
publicAPI.addActor(model._pipelines.tubes.actor); // --------------------------------------------------------------------------
|
|
92
93
|
|
|
93
94
|
publicAPI.requestData = function (inData, outData) {
|
|
94
|
-
var
|
|
95
|
+
var _state$getLineThickne, _state$getLineThickne2;
|
|
96
|
+
|
|
97
|
+
var state = inData[0];
|
|
98
|
+
outData[0] = internalPolyData; // Remove invalid and coincident points for tube filter.
|
|
95
99
|
|
|
96
100
|
var list = publicAPI.getRepresentationStates(state).reduce(function (subStates, subState) {
|
|
97
101
|
var subStateOrigin = subState.getOrigin && subState.getOrigin() ? subState.getOrigin() : null;
|
|
@@ -105,7 +109,7 @@ function vtkPolyLineRepresentation(publicAPI, model) {
|
|
|
105
109
|
return subStates;
|
|
106
110
|
}, []);
|
|
107
111
|
var size = list.length;
|
|
108
|
-
var points = allocateSize(size, model.closePolyLine && size > 2);
|
|
112
|
+
var points = allocateSize(outData[0], size, model.closePolyLine && size > 2);
|
|
109
113
|
|
|
110
114
|
if (points) {
|
|
111
115
|
for (var i = 0; i < size; i++) {
|
|
@@ -116,10 +120,9 @@ function vtkPolyLineRepresentation(publicAPI, model) {
|
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
|
|
119
|
-
|
|
120
|
-
var lineThickness = state.getLineThickness ?
|
|
121
|
-
applyLineThickness(lineThickness
|
|
122
|
-
outData[0] = model.internalPolyData;
|
|
123
|
+
outData[0].modified();
|
|
124
|
+
var lineThickness = (_state$getLineThickne = (_state$getLineThickne2 = state.getLineThickness) === null || _state$getLineThickne2 === void 0 ? void 0 : _state$getLineThickne2.call(state)) !== null && _state$getLineThickne !== void 0 ? _state$getLineThickne : model.lineThickness;
|
|
125
|
+
applyLineThickness(lineThickness);
|
|
123
126
|
};
|
|
124
127
|
/**
|
|
125
128
|
* When mousing over the line, if behavior != CONTEXT,
|
|
@@ -135,18 +138,18 @@ function vtkPolyLineRepresentation(publicAPI, model) {
|
|
|
135
138
|
};
|
|
136
139
|
|
|
137
140
|
publicAPI.updateActorVisibility = function (renderingType, ctxVisible, hVisible) {
|
|
141
|
+
var _state$getLineThickne3, _state$getLineThickne4;
|
|
142
|
+
|
|
138
143
|
var state = model.inputData[0]; // Make lines/tubes thicker for picking
|
|
139
144
|
|
|
140
|
-
var lineThickness = state.getLineThickness ?
|
|
141
|
-
lineThickness = lineThickness || model.lineThickness;
|
|
145
|
+
var lineThickness = (_state$getLineThickne3 = (_state$getLineThickne4 = state.getLineThickness) === null || _state$getLineThickne4 === void 0 ? void 0 : _state$getLineThickne4.call(state)) !== null && _state$getLineThickne3 !== void 0 ? _state$getLineThickne3 : model.lineThickness;
|
|
142
146
|
|
|
143
147
|
if (renderingType === RenderingTypes.PICKING_BUFFER) {
|
|
144
148
|
lineThickness = Math.max(4, lineThickness);
|
|
145
149
|
}
|
|
146
150
|
|
|
147
151
|
applyLineThickness(lineThickness);
|
|
148
|
-
|
|
149
|
-
return superClass.updateActorVisibility(renderingType, ctxVisible && isValid, hVisible && isValid);
|
|
152
|
+
return superClass.updateActorVisibility(renderingType, ctxVisible, hVisible);
|
|
150
153
|
};
|
|
151
154
|
} // ----------------------------------------------------------------------------
|
|
152
155
|
// Object factory
|
|
@@ -3,6 +3,7 @@ import vtkActor from '../../Rendering/Core/Actor.js';
|
|
|
3
3
|
import vtkContextRepresentation from './ContextRepresentation.js';
|
|
4
4
|
import vtkMapper from '../../Rendering/Core/Mapper.js';
|
|
5
5
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
6
|
+
import { allocateArray } from './WidgetRepresentation.js';
|
|
6
7
|
import { vec3 } from 'gl-matrix';
|
|
7
8
|
|
|
8
9
|
// vtkRectangleContextRepresentation methods
|
|
@@ -14,6 +15,9 @@ function vtkRectangleContextRepresentation(publicAPI, model) {
|
|
|
14
15
|
// Generic rendering pipeline
|
|
15
16
|
// --------------------------------------------------------------------------
|
|
16
17
|
|
|
18
|
+
model.internalPolyData = vtkPolyData.newInstance({
|
|
19
|
+
mtime: 0
|
|
20
|
+
});
|
|
17
21
|
model.mapper = vtkMapper.newInstance();
|
|
18
22
|
model.actor = vtkActor.newInstance({
|
|
19
23
|
parentProp: publicAPI
|
|
@@ -24,16 +28,6 @@ function vtkRectangleContextRepresentation(publicAPI, model) {
|
|
|
24
28
|
model.actor.getProperty().setColor(0, 1, 0);
|
|
25
29
|
publicAPI.addActor(model.actor); // --------------------------------------------------------------------------
|
|
26
30
|
|
|
27
|
-
publicAPI.setDrawBorder = function (draw) {
|
|
28
|
-
model.drawBorder = draw;
|
|
29
|
-
}; // --------------------------------------------------------------------------
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
publicAPI.setDrawFace = function (draw) {
|
|
33
|
-
model.drawFace = draw;
|
|
34
|
-
}; // --------------------------------------------------------------------------
|
|
35
|
-
|
|
36
|
-
|
|
37
31
|
publicAPI.setOpacity = function (opacity) {
|
|
38
32
|
model.actor.getProperty().setOpacity(opacity);
|
|
39
33
|
}; // --------------------------------------------------------------------------
|
|
@@ -44,18 +38,18 @@ function vtkRectangleContextRepresentation(publicAPI, model) {
|
|
|
44
38
|
return;
|
|
45
39
|
}
|
|
46
40
|
|
|
47
|
-
var list = publicAPI.getRepresentationStates(inData[0]);
|
|
41
|
+
var list = publicAPI.getRepresentationStates(inData[0]); // FIXME: support list > 1.
|
|
42
|
+
|
|
48
43
|
var state = list[0];
|
|
49
|
-
var dataset = vtkPolyData.newInstance();
|
|
50
44
|
|
|
51
|
-
if (state.getVisible() && state.getOrigin()) {
|
|
45
|
+
if (state !== null && state !== void 0 && state.getVisible() && state !== null && state !== void 0 && state.getOrigin()) {
|
|
52
46
|
var point1 = state.getOrigin();
|
|
53
47
|
var point2 = state.getCorner();
|
|
54
48
|
var diagonal = [0, 0, 0];
|
|
55
49
|
vec3.subtract(diagonal, point2, point1);
|
|
56
50
|
var up = state.getUp();
|
|
57
51
|
var upComponent = vec3.dot(diagonal, up);
|
|
58
|
-
var points =
|
|
52
|
+
var points = allocateArray(model.internalPolyData, 'points', 4).getData();
|
|
59
53
|
points[0] = point1[0];
|
|
60
54
|
points[1] = point1[1];
|
|
61
55
|
points[2] = point1[2];
|
|
@@ -68,24 +62,24 @@ function vtkRectangleContextRepresentation(publicAPI, model) {
|
|
|
68
62
|
points[9] = point2[0] - upComponent * up[0];
|
|
69
63
|
points[10] = point2[1] - upComponent * up[1];
|
|
70
64
|
points[11] = point2[2] - upComponent * up[2];
|
|
71
|
-
dataset.getPoints().setData(points, 3);
|
|
72
65
|
|
|
73
66
|
if (model.drawFace) {
|
|
74
67
|
var polys = new Uint32Array([4, 0, 1, 2, 3]);
|
|
75
|
-
|
|
68
|
+
model.internalPolyData.getPolys().setData(polys, 1);
|
|
76
69
|
}
|
|
77
70
|
|
|
78
71
|
if (model.drawBorder) {
|
|
79
72
|
var line = new Uint32Array([5, 0, 1, 2, 3, 0]);
|
|
80
|
-
|
|
73
|
+
model.internalPolyData.getLines().setData(line, 1);
|
|
81
74
|
}
|
|
82
75
|
} else {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
model.internalPolyData.getPoints().setData([], 0);
|
|
77
|
+
model.internalPolyData.getPolys().setData([], 0);
|
|
78
|
+
model.internalPolyData.getLines().setData([], 0);
|
|
86
79
|
}
|
|
87
80
|
|
|
88
|
-
|
|
81
|
+
model.internalPolyData.modified();
|
|
82
|
+
outData[0] = model.internalPolyData;
|
|
89
83
|
};
|
|
90
84
|
|
|
91
85
|
publicAPI.getSelectedState = function (prop, compositeID) {
|
|
@@ -106,6 +100,7 @@ function extend(publicAPI, model) {
|
|
|
106
100
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
107
101
|
vtkContextRepresentation.extend(publicAPI, model, initialValues);
|
|
108
102
|
macro.setGetArray(publicAPI, model, ['color'], 1);
|
|
103
|
+
macro.setGet(publicAPI, model, ['drawBorder', 'drawFace']);
|
|
109
104
|
macro.get(publicAPI, model, ['mapper', 'actor']); // Object specific methods
|
|
110
105
|
|
|
111
106
|
vtkRectangleContextRepresentation(publicAPI, model);
|