@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
|
@@ -21,7 +21,7 @@ function vtkOpenGLImageSlice(publicAPI, model) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
model._openGLRenderWindow = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow');
|
|
24
|
-
model.
|
|
24
|
+
model._openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');
|
|
25
25
|
model.context = model._openGLRenderWindow.getContext();
|
|
26
26
|
publicAPI.prepareNodes();
|
|
27
27
|
publicAPI.addMissingNode(model.renderable.getMapper());
|
|
@@ -35,7 +35,7 @@ function vtkOpenGLImageSlice(publicAPI, model) {
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
publicAPI.traverseOpaquePass = function (renderPass) {
|
|
38
|
-
if (!model.renderable || !model.renderable.getNestedVisibility() || !model.renderable.getIsOpaque() || model.
|
|
38
|
+
if (!model.renderable || !model.renderable.getNestedVisibility() || !model.renderable.getIsOpaque() || model._openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -48,7 +48,7 @@ function vtkOpenGLImageSlice(publicAPI, model) {
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
publicAPI.traverseTranslucentPass = function (renderPass) {
|
|
51
|
-
if (!model.renderable || !model.renderable.getNestedVisibility() || model.renderable.getIsOpaque() || model.
|
|
51
|
+
if (!model.renderable || !model.renderable.getNestedVisibility() || model.renderable.getIsOpaque() || model._openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -11,11 +11,15 @@ function vtkOpenGLPixelSpaceCallbackMapper(publicAPI, model) {
|
|
|
11
11
|
model.classHierarchy.push('vtkOpenGLPixelSpaceCallbackMapper');
|
|
12
12
|
|
|
13
13
|
publicAPI.opaquePass = function (prepass, renderPass) {
|
|
14
|
-
model.
|
|
15
|
-
model._openGLRenderWindow = model.
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
14
|
+
model._openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');
|
|
15
|
+
model._openGLRenderWindow = model._openGLRenderer.getParent();
|
|
16
|
+
|
|
17
|
+
var aspectRatio = model._openGLRenderer.getAspectRatio();
|
|
18
|
+
|
|
19
|
+
var camera = model._openGLRenderer ? model._openGLRenderer.getRenderable().getActiveCamera() : null;
|
|
20
|
+
|
|
21
|
+
var tsize = model._openGLRenderer.getTiledSizeAndOrigin();
|
|
22
|
+
|
|
19
23
|
var texels = null;
|
|
20
24
|
|
|
21
25
|
if (model.renderable.getUseZValues()) {
|
|
@@ -54,9 +54,9 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
54
54
|
if (prepass) {
|
|
55
55
|
model.currentRenderPass = null;
|
|
56
56
|
model.openGLActor = publicAPI.getFirstAncestorOfType('vtkOpenGLActor');
|
|
57
|
-
model.
|
|
58
|
-
model._openGLRenderWindow = model.
|
|
59
|
-
model.openGLCamera = model.
|
|
57
|
+
model._openGLRenderer = model.openGLActor.getFirstAncestorOfType('vtkOpenGLRenderer');
|
|
58
|
+
model._openGLRenderWindow = model._openGLRenderer.getParent();
|
|
59
|
+
model.openGLCamera = model._openGLRenderer.getViewNodeFor(model._openGLRenderer.getRenderable().getActiveCamera());
|
|
60
60
|
}
|
|
61
61
|
}; // Renders myself
|
|
62
62
|
|
|
@@ -95,7 +95,9 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
var actor = model.openGLActor.getRenderable();
|
|
98
|
-
|
|
98
|
+
|
|
99
|
+
var ren = model._openGLRenderer.getRenderable();
|
|
100
|
+
|
|
99
101
|
publicAPI.renderPiece(ren, actor);
|
|
100
102
|
};
|
|
101
103
|
|
|
@@ -516,7 +518,7 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
516
518
|
// This gets you above the saved surface depth buffer.
|
|
517
519
|
|
|
518
520
|
|
|
519
|
-
var selector = model.
|
|
521
|
+
var selector = model._openGLRenderer.getSelector();
|
|
520
522
|
|
|
521
523
|
if (selector && selector.getFieldAssociation() === FieldAssociations.FIELD_ASSOCIATION_POINTS) {
|
|
522
524
|
cp.offset -= 2.0;
|
|
@@ -530,7 +532,7 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
530
532
|
var VSSource = shaders.Vertex;
|
|
531
533
|
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::Picking::Dec', ['uniform int picking;', '//VTK::Picking::Dec']).result;
|
|
532
534
|
|
|
533
|
-
if (!model.
|
|
535
|
+
if (!model._openGLRenderer.getSelector()) {
|
|
534
536
|
return;
|
|
535
537
|
}
|
|
536
538
|
|
|
@@ -793,8 +795,10 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
793
795
|
} // handle wide lines
|
|
794
796
|
|
|
795
797
|
|
|
796
|
-
cellBO.setMapperShaderParameters(ren, actor, model.
|
|
797
|
-
|
|
798
|
+
cellBO.setMapperShaderParameters(ren, actor, model._openGLRenderer.getTiledSizeAndOrigin());
|
|
799
|
+
|
|
800
|
+
var selector = model._openGLRenderer.getSelector();
|
|
801
|
+
|
|
798
802
|
cellBO.getProgram().setUniform3fArray('mapperIndex', selector ? selector.getPropColorValue() : [0.0, 0.0, 0.0]);
|
|
799
803
|
cellBO.getProgram().setUniformi('picking', selector ? selector.getCurrentPass() + 1 : 0);
|
|
800
804
|
};
|
|
@@ -908,7 +912,8 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
908
912
|
} : model.openGLActor.getKeyMatrices();
|
|
909
913
|
|
|
910
914
|
if (actor.getCoordinateSystem() === CoordinateSystem.DISPLAY) {
|
|
911
|
-
var size = model.
|
|
915
|
+
var size = model._openGLRenderer.getTiledSizeAndOrigin();
|
|
916
|
+
|
|
912
917
|
mat4.identity(model.tmpMat4);
|
|
913
918
|
model.tmpMat4[0] = 2.0 / size.usize;
|
|
914
919
|
model.tmpMat4[12] = -1.0;
|
|
@@ -997,7 +1002,7 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
997
1002
|
publicAPI.updateMaximumPointCellIds = function (ren, actor) {
|
|
998
1003
|
var _model$selectionWebGL, _model$selectionWebGL2, _model$selectionWebGL3, _model$selectionWebGL4;
|
|
999
1004
|
|
|
1000
|
-
var selector = model.
|
|
1005
|
+
var selector = model._openGLRenderer.getSelector();
|
|
1001
1006
|
|
|
1002
1007
|
if (!selector) {
|
|
1003
1008
|
return;
|
|
@@ -1023,17 +1028,18 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
1023
1028
|
publicAPI.renderPieceStart = function (ren, actor) {
|
|
1024
1029
|
model.primitiveIDOffset = 0;
|
|
1025
1030
|
model.vertexIDOffset = 0;
|
|
1026
|
-
var picking = getPickState(model.
|
|
1031
|
+
var picking = getPickState(model._openGLRenderer);
|
|
1027
1032
|
|
|
1028
1033
|
if (model.lastSelectionState !== picking) {
|
|
1029
1034
|
model.selectionStateChanged.modified();
|
|
1030
1035
|
model.lastSelectionState = picking;
|
|
1031
1036
|
}
|
|
1032
1037
|
|
|
1033
|
-
if (model.
|
|
1038
|
+
if (model._openGLRenderer.getSelector()) {
|
|
1034
1039
|
switch (picking) {
|
|
1035
1040
|
default:
|
|
1036
|
-
model.
|
|
1041
|
+
model._openGLRenderer.getSelector().renderProp(actor);
|
|
1042
|
+
|
|
1037
1043
|
}
|
|
1038
1044
|
} // make sure the BOs are up to date
|
|
1039
1045
|
|
|
@@ -1052,7 +1058,9 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
1052
1058
|
publicAPI.renderPieceDraw = function (ren, actor) {
|
|
1053
1059
|
var representation = actor.getProperty().getRepresentation();
|
|
1054
1060
|
var drawSurfaceWithEdges = actor.getProperty().getEdgeVisibility() && representation === Representation.SURFACE;
|
|
1055
|
-
|
|
1061
|
+
|
|
1062
|
+
var selector = model._openGLRenderer.getSelector(); // If we are picking points, we need to tell it to the helper
|
|
1063
|
+
|
|
1056
1064
|
|
|
1057
1065
|
var pointPicking = selector && selector.getFieldAssociation() === FieldAssociations.FIELD_ASSOCIATION_POINTS && (model.lastSelectionState === PassTypes.ID_LOW24 || model.lastSelectionState === PassTypes.ID_HIGH24); // for every primitive type
|
|
1058
1066
|
|
|
@@ -32,9 +32,9 @@ function vtkOpenGLPolyDataMapper2D(publicAPI, model) {
|
|
|
32
32
|
publicAPI.buildPass = function (prepass) {
|
|
33
33
|
if (prepass) {
|
|
34
34
|
model.openGLActor2D = publicAPI.getFirstAncestorOfType('vtkOpenGLActor2D');
|
|
35
|
-
model.
|
|
36
|
-
model._openGLRenderWindow = model.
|
|
37
|
-
model.openGLCamera = model.
|
|
35
|
+
model._openGLRenderer = model.openGLActor2D.getFirstAncestorOfType('vtkOpenGLRenderer');
|
|
36
|
+
model._openGLRenderWindow = model._openGLRenderer.getParent();
|
|
37
|
+
model.openGLCamera = model._openGLRenderer.getViewNodeFor(model._openGLRenderer.getRenderable().getActiveCamera());
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -93,7 +93,9 @@ function vtkOpenGLPolyDataMapper2D(publicAPI, model) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
var actor = model.openGLActor2D.getRenderable();
|
|
96
|
-
|
|
96
|
+
|
|
97
|
+
var ren = model._openGLRenderer.getRenderable();
|
|
98
|
+
|
|
97
99
|
publicAPI.renderPiece(ren, actor);
|
|
98
100
|
};
|
|
99
101
|
|
|
@@ -125,10 +127,11 @@ function vtkOpenGLPolyDataMapper2D(publicAPI, model) {
|
|
|
125
127
|
publicAPI.renderPieceStart = function (ren, actor) {
|
|
126
128
|
model.primitiveIDOffset = 0;
|
|
127
129
|
|
|
128
|
-
if (model.
|
|
129
|
-
switch (model.
|
|
130
|
+
if (model._openGLRenderer.getSelector()) {
|
|
131
|
+
switch (model._openGLRenderer.getSelector().getCurrentPass()) {
|
|
130
132
|
default:
|
|
131
|
-
model.
|
|
133
|
+
model._openGLRenderer.getSelector().renderProp(actor);
|
|
134
|
+
|
|
132
135
|
}
|
|
133
136
|
} // make sure the BOs are up to date
|
|
134
137
|
|
|
@@ -440,8 +443,10 @@ function vtkOpenGLPolyDataMapper2D(publicAPI, model) {
|
|
|
440
443
|
} // handle wide lines
|
|
441
444
|
|
|
442
445
|
|
|
443
|
-
cellBO.setMapperShaderParameters(ren, actor, model.
|
|
444
|
-
|
|
446
|
+
cellBO.setMapperShaderParameters(ren, actor, model._openGLRenderer.getTiledSizeAndOrigin());
|
|
447
|
+
|
|
448
|
+
var selector = model._openGLRenderer.getSelector();
|
|
449
|
+
|
|
445
450
|
cellBO.getProgram().setUniform3fArray('mapperIndex', selector ? selector.getPropColorValue() : [0.0, 0.0, 0.0]);
|
|
446
451
|
cellBO.getProgram().setUniformi('picking', selector ? selector.getCurrentPass() + 1 : 0);
|
|
447
452
|
}
|
|
@@ -502,7 +507,9 @@ function vtkOpenGLPolyDataMapper2D(publicAPI, model) {
|
|
|
502
507
|
|
|
503
508
|
size[0] = round(size[0] * (visVP[2] - visVP[0]) / (vport[2] - vport[0]));
|
|
504
509
|
size[1] = round(size[1] * (visVP[3] - visVP[1]) / (vport[3] - vport[1]));
|
|
505
|
-
|
|
510
|
+
|
|
511
|
+
var winSize = model._openGLRenderer.getParent().getSize();
|
|
512
|
+
|
|
506
513
|
var xoff = round(actorPos[0] - (visVP[0] - vport[0]) * winSize[0]);
|
|
507
514
|
var yoff = round(actorPos[1] - (visVP[1] - vport[1]) * winSize[1]); // set ortho projection
|
|
508
515
|
|
|
@@ -11,8 +11,8 @@ function vtkOpenGLScalarBarActor(publicAPI, model) {
|
|
|
11
11
|
|
|
12
12
|
publicAPI.buildPass = function (prepass) {
|
|
13
13
|
if (prepass) {
|
|
14
|
-
model.
|
|
15
|
-
model._openGLRenderWindow = model.
|
|
14
|
+
model._openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');
|
|
15
|
+
model._openGLRenderWindow = model._openGLRenderer.getParent();
|
|
16
16
|
|
|
17
17
|
if (!model.scalarBarActorHelper.getRenderable()) {
|
|
18
18
|
model.scalarBarActorHelper.setRenderable(model.renderable);
|
|
@@ -27,8 +27,10 @@ function vtkOpenGLScalarBarActor(publicAPI, model) {
|
|
|
27
27
|
|
|
28
28
|
publicAPI.opaquePass = function (prepass, renderPass) {
|
|
29
29
|
if (prepass) {
|
|
30
|
-
var camera = model.
|
|
31
|
-
|
|
30
|
+
var camera = model._openGLRenderer ? model._openGLRenderer.getRenderable().getActiveCamera() : null;
|
|
31
|
+
|
|
32
|
+
var tsize = model._openGLRenderer.getTiledSizeAndOrigin();
|
|
33
|
+
|
|
32
34
|
model.scalarBarActorHelper.updateAPISpecificData([tsize.usize, tsize.vsize], camera, model._openGLRenderWindow.getRenderable());
|
|
33
35
|
}
|
|
34
36
|
};
|
|
@@ -17,13 +17,15 @@ function vtkOpenGLSkybox(publicAPI, model) {
|
|
|
17
17
|
|
|
18
18
|
publicAPI.buildPass = function (prepass) {
|
|
19
19
|
if (prepass) {
|
|
20
|
-
model.
|
|
21
|
-
model._openGLRenderWindow = model.
|
|
20
|
+
model._openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');
|
|
21
|
+
model._openGLRenderWindow = model._openGLRenderer.getParent();
|
|
22
22
|
model.context = model._openGLRenderWindow.getContext();
|
|
23
23
|
model.tris.setOpenGLRenderWindow(model._openGLRenderWindow);
|
|
24
24
|
model.openGLTexture.setOpenGLRenderWindow(model._openGLRenderWindow);
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
|
|
26
|
+
var ren = model._openGLRenderer.getRenderable();
|
|
27
|
+
|
|
28
|
+
model.openGLCamera = model._openGLRenderer.getViewNodeFor(ren.getActiveCamera());
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
31
|
|
|
@@ -38,7 +40,7 @@ function vtkOpenGLSkybox(publicAPI, model) {
|
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
publicAPI.opaquePass = function (prepass, renderPass) {
|
|
41
|
-
if (prepass && !model.
|
|
43
|
+
if (prepass && !model._openGLRenderer.getSelector()) {
|
|
42
44
|
publicAPI.updateBufferObjects();
|
|
43
45
|
model.context.depthMask(true);
|
|
44
46
|
|
|
@@ -47,7 +49,9 @@ function vtkOpenGLSkybox(publicAPI, model) {
|
|
|
47
49
|
model.openGLTexture.render(model._openGLRenderWindow);
|
|
48
50
|
var texUnit = model.openGLTexture.getTextureUnit();
|
|
49
51
|
model.tris.getProgram().setUniformi('sbtexture', texUnit);
|
|
50
|
-
|
|
52
|
+
|
|
53
|
+
var ren = model._openGLRenderer.getRenderable();
|
|
54
|
+
|
|
51
55
|
var keyMats = model.openGLCamera.getKeyMatrices(ren);
|
|
52
56
|
var imat = new Float64Array(16);
|
|
53
57
|
mat4.invert(imat, keyMats.wcpc);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import Constants from './Texture/Constants.js';
|
|
3
3
|
import HalfFloat from '../../Common/Core/HalfFloat.js';
|
|
4
|
-
import { newInstance as newInstance$1, obj, set, setGet, get, newTypedArray, vtkDebugMacro as vtkDebugMacro$1, vtkErrorMacro as vtkErrorMacro$1, vtkWarningMacro as vtkWarningMacro$1 } from '../../macros.js';
|
|
4
|
+
import { newInstance as newInstance$1, obj, set, setGet, get, moveToProtected, newTypedArray, vtkDebugMacro as vtkDebugMacro$1, vtkErrorMacro as vtkErrorMacro$1, vtkWarningMacro as vtkWarningMacro$1 } from '../../macros.js';
|
|
5
5
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
6
6
|
import { R as isPowerOfTwo, N as nearestPowerOfTwo } from '../../Common/Core/Math/index.js';
|
|
7
7
|
import vtkViewNode from '../SceneGraph/ViewNode.js';
|
|
@@ -31,9 +31,9 @@ function vtkOpenGLTexture(publicAPI, model) {
|
|
|
31
31
|
if (renWin) {
|
|
32
32
|
model._openGLRenderWindow = renWin;
|
|
33
33
|
} else {
|
|
34
|
-
model.
|
|
34
|
+
model._openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer'); // sync renderable properties
|
|
35
35
|
|
|
36
|
-
model._openGLRenderWindow = model.
|
|
36
|
+
model._openGLRenderWindow = model._openGLRenderer.getParent();
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
model.context = model._openGLRenderWindow.getContext();
|
|
@@ -1287,7 +1287,7 @@ function vtkOpenGLTexture(publicAPI, model) {
|
|
|
1287
1287
|
|
|
1288
1288
|
|
|
1289
1289
|
var DEFAULT_VALUES = {
|
|
1290
|
-
_openGLRenderWindow: null,
|
|
1290
|
+
// _openGLRenderWindow: null,
|
|
1291
1291
|
context: null,
|
|
1292
1292
|
handle: 0,
|
|
1293
1293
|
sendParametersTime: null,
|
|
@@ -1329,7 +1329,8 @@ function extend(publicAPI, model) {
|
|
|
1329
1329
|
|
|
1330
1330
|
set(publicAPI, model, ['format', 'openGLDataType']);
|
|
1331
1331
|
setGet(publicAPI, model, ['keyMatrixTime', 'minificationFilter', 'magnificationFilter', 'wrapS', 'wrapT', 'wrapR', 'generateMipmap']);
|
|
1332
|
-
get(publicAPI, model, ['width', 'height', 'volumeInfo', 'components', 'handle', 'target']);
|
|
1332
|
+
get(publicAPI, model, ['width', 'height', 'volumeInfo', 'components', 'handle', 'target']);
|
|
1333
|
+
moveToProtected(publicAPI, model, ['openGLRenderWindow']); // Object methods
|
|
1333
1334
|
|
|
1334
1335
|
vtkOpenGLTexture(publicAPI, model);
|
|
1335
1336
|
} // ----------------------------------------------------------------------------
|
|
@@ -17,7 +17,7 @@ function vtkOpenGLVolume(publicAPI, model) {
|
|
|
17
17
|
|
|
18
18
|
if (prepass) {
|
|
19
19
|
model._openGLRenderWindow = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow');
|
|
20
|
-
model.
|
|
20
|
+
model._openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');
|
|
21
21
|
model.context = model._openGLRenderWindow.getContext();
|
|
22
22
|
publicAPI.prepareNodes();
|
|
23
23
|
publicAPI.addMissingNode(model.renderable.getMapper());
|
|
@@ -36,7 +36,7 @@ function vtkOpenGLVolume(publicAPI, model) {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
publicAPI.traverseVolumePass = function (renderPass) {
|
|
39
|
-
if (!model.renderable || !model.renderable.getNestedVisibility() || model.
|
|
39
|
+
if (!model.renderable || !model.renderable.getNestedVisibility() || model._openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -75,9 +75,11 @@ function vtkOpenGLVolumeMapper(publicAPI, model) {
|
|
|
75
75
|
model.opacityTexture.setOpenGLRenderWindow(model._openGLRenderWindow);
|
|
76
76
|
model.openGLVolume = publicAPI.getFirstAncestorOfType('vtkOpenGLVolume');
|
|
77
77
|
var actor = model.openGLVolume.getRenderable();
|
|
78
|
-
model.
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
model._openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');
|
|
79
|
+
|
|
80
|
+
var ren = model._openGLRenderer.getRenderable();
|
|
81
|
+
|
|
82
|
+
model.openGLCamera = model._openGLRenderer.getViewNodeFor(ren.getActiveCamera());
|
|
81
83
|
publicAPI.renderPiece(ren, actor);
|
|
82
84
|
}
|
|
83
85
|
};
|
|
@@ -715,9 +717,7 @@ function vtkOpenGLVolumeMapper(publicAPI, model) {
|
|
|
715
717
|
|
|
716
718
|
if (vtkImageLabelOutline === true) {
|
|
717
719
|
var labelOutlineThickness = actor.getProperty().getLabelOutlineThickness();
|
|
718
|
-
var labelOutlineOpacity = actor.getProperty().getLabelOutlineOpacity();
|
|
719
720
|
program.setUniformi('outlineThickness', labelOutlineThickness);
|
|
720
|
-
program.setUniformf('outlineOpacity', labelOutlineOpacity);
|
|
721
721
|
}
|
|
722
722
|
|
|
723
723
|
if (model.lastLightComplexity > 0) {
|
|
@@ -768,17 +768,17 @@ function vtkOpenGLVolumeMapper(publicAPI, model) {
|
|
|
768
768
|
return [model._smallViewportWidth, model._smallViewportHeight];
|
|
769
769
|
}
|
|
770
770
|
|
|
771
|
-
var _model$
|
|
772
|
-
usize = _model$
|
|
773
|
-
vsize = _model$
|
|
771
|
+
var _model$_openGLRendere = model._openGLRenderer.getTiledSizeAndOrigin(),
|
|
772
|
+
usize = _model$_openGLRendere.usize,
|
|
773
|
+
vsize = _model$_openGLRendere.vsize;
|
|
774
774
|
|
|
775
775
|
return [usize, vsize];
|
|
776
776
|
};
|
|
777
777
|
|
|
778
778
|
publicAPI.getRenderTargetOffset = function () {
|
|
779
|
-
var _model$
|
|
780
|
-
lowerLeftU = _model$
|
|
781
|
-
lowerLeftV = _model$
|
|
779
|
+
var _model$_openGLRendere2 = model._openGLRenderer.getTiledSizeAndOrigin(),
|
|
780
|
+
lowerLeftU = _model$_openGLRendere2.lowerLeftU,
|
|
781
|
+
lowerLeftV = _model$_openGLRendere2.lowerLeftV;
|
|
782
782
|
|
|
783
783
|
return [lowerLeftU, lowerLeftV];
|
|
784
784
|
};
|