@kitware/vtk.js 26.8.0 → 26.8.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/DataModel/SelectionNode/Constants.d.ts +27 -0
- package/Common/DataModel/SelectionNode.d.ts +58 -21
- package/Rendering/Core/ColorTransferFunction.d.ts +2 -10
- package/Rendering/Core/Mapper.d.ts +4 -0
- package/Rendering/Core/Renderer.d.ts +26 -0
- package/Rendering/OpenGL/OrderIndependentTranslucentPass.js +1 -1
- package/Rendering/OpenGL/RenderWindow.d.ts +4 -4
- package/Rendering/OpenGL/SurfaceLIC/SurfaceLICInterface.js +8 -5
- package/Rendering/OpenGL/SurfaceLIC/SurfaceLICMapper.js +1 -1
- package/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum SelectionContent {
|
|
2
|
+
GLOBALIDS = 0,
|
|
3
|
+
PEDIGREEIDS = 1,
|
|
4
|
+
VALUES = 2,
|
|
5
|
+
INDICES = 3,
|
|
6
|
+
FRUSTUM = 4,
|
|
7
|
+
LOCATIONS = 5,
|
|
8
|
+
THRESHOLDS = 6,
|
|
9
|
+
BLOCKS = 7,
|
|
10
|
+
QUERY = 8,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export declare enum SelectionField {
|
|
14
|
+
CELL = 0,
|
|
15
|
+
POINT = 1,
|
|
16
|
+
FIELD = 2,
|
|
17
|
+
VERTEX = 3,
|
|
18
|
+
EDGE = 4,
|
|
19
|
+
ROW = 5,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare const _default: {
|
|
23
|
+
SelectionContent: typeof SelectionContent;
|
|
24
|
+
SelectionField: typeof SelectionField;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default _default;
|
|
@@ -1,35 +1,70 @@
|
|
|
1
1
|
import { vtkObject } from './../../interfaces' ;
|
|
2
2
|
import { Bounds } from './../../types';
|
|
3
|
+
import { SelectionContent, SelectionField } from './SelectionNode/Constants';
|
|
4
|
+
import vtkProp from './../../Rendering/Core/Prop';
|
|
3
5
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
FRUSTUM,
|
|
10
|
-
LOCATIONS,
|
|
11
|
-
THRESHOLDS,
|
|
12
|
-
BLOCKS,
|
|
13
|
-
QUERY,
|
|
6
|
+
export interface ISelectionNodeInitialValues {
|
|
7
|
+
contentType?: SelectionContent;
|
|
8
|
+
fieldType?: SelectionField;
|
|
9
|
+
properties?: ISelectionNodeProperties;
|
|
10
|
+
selectionList?: number[];
|
|
14
11
|
}
|
|
15
12
|
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
export interface ISelectionNodeProperties {
|
|
14
|
+
propID?: number;
|
|
15
|
+
prop?: vtkProp;
|
|
16
|
+
compositeID?: number;
|
|
17
|
+
attributeID?: number;
|
|
18
|
+
pixelCount?: number;
|
|
19
|
+
displayPosition?: [number, number, number];
|
|
20
|
+
worldPosition?: [number, number, number];
|
|
23
21
|
}
|
|
24
22
|
|
|
25
|
-
export interface ISelectionNodeInitialValues {}
|
|
26
|
-
|
|
27
23
|
export interface vtkSelectionNode extends vtkObject {
|
|
28
|
-
|
|
29
24
|
/**
|
|
30
|
-
*
|
|
25
|
+
* Get the bounds of the selection points.
|
|
31
26
|
*/
|
|
32
27
|
getBounds(): Bounds;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns -1 if not initialized.
|
|
31
|
+
*/
|
|
32
|
+
getContentType(): SelectionContent | -1;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* This functions is called internally by VTK.js and is not intended for public use.
|
|
36
|
+
*/
|
|
37
|
+
setContentType(contentType: SelectionContent): void;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Returns -1 if not initialized.
|
|
41
|
+
*/
|
|
42
|
+
getFieldType(): SelectionField | -1;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* This functions is called internally by VTK.js and is not intended for public use.
|
|
46
|
+
*/
|
|
47
|
+
setFieldType(fieldType: SelectionField): void;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get the selection properties.
|
|
51
|
+
*/
|
|
52
|
+
getProperties(): ISelectionNodeProperties;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* This functions is called internally by VTK.js and is not intended for public use.
|
|
56
|
+
*/
|
|
57
|
+
setProperties(properties: ISelectionNodeProperties);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Get the list of the underlying selected attribute IDs.
|
|
61
|
+
*/
|
|
62
|
+
getSelectionList(): number[];
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* This functions is called internally by VTK.js and is not intended for public use.
|
|
66
|
+
*/
|
|
67
|
+
setSelectionList(selectionAttributeIDs: ISelectionNodeProperties);
|
|
33
68
|
}
|
|
34
69
|
|
|
35
70
|
/**
|
|
@@ -57,5 +92,7 @@ export function newInstance(initialValues?: ISelectionNodeInitialValues): vtkSel
|
|
|
57
92
|
export declare const vtkSelectionNode: {
|
|
58
93
|
newInstance: typeof newInstance,
|
|
59
94
|
extend: typeof extend;
|
|
95
|
+
SelectionContent: typeof SelectionContent;
|
|
96
|
+
SelectionField: typeof SelectionField;
|
|
60
97
|
};
|
|
61
98
|
export default vtkSelectionNode;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import vtkDataArray from './../../Common/Core/DataArray';
|
|
2
|
-
import
|
|
2
|
+
import vtkScalarsToColors from './../../Common/Core/ScalarsToColors'
|
|
3
3
|
import { ColorSpace, Scale } from './ColorTransferFunction/Constants';
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
export interface vtkColorTransferFunction extends vtkObject {
|
|
6
|
+
export interface vtkColorTransferFunction extends vtkScalarsToColors {
|
|
8
7
|
/**
|
|
9
8
|
* Add a point defined in RGB
|
|
10
9
|
* @param {Number} x The index of the point.
|
|
@@ -270,13 +269,6 @@ export interface vtkColorTransferFunction extends vtkObject {
|
|
|
270
269
|
*/
|
|
271
270
|
fillFromDataPointer(nb: number, ptr: any): void;
|
|
272
271
|
|
|
273
|
-
/**
|
|
274
|
-
* Set the range of scalars being mapped.
|
|
275
|
-
* @param {Number} min
|
|
276
|
-
* @param {Number} max
|
|
277
|
-
*/
|
|
278
|
-
setMappingRange(min: number, max: number): void;
|
|
279
|
-
|
|
280
272
|
/**
|
|
281
273
|
* Remove all points out of the new range, and make sure there is a point at
|
|
282
274
|
* each end of that range.
|
|
@@ -485,6 +485,10 @@ export interface vtkMapper extends vtkAbstractMapper3D {
|
|
|
485
485
|
*
|
|
486
486
|
*/
|
|
487
487
|
setInterpolateScalarsBeforeMapping(interpolateScalarsBeforeMapping: boolean): boolean;
|
|
488
|
+
|
|
489
|
+
setResolveCoincidentTopologyToPolygonOffset(): boolean;
|
|
490
|
+
|
|
491
|
+
setResolveCoincidentTopologyToOff(): boolean;
|
|
488
492
|
}
|
|
489
493
|
|
|
490
494
|
/**
|
|
@@ -628,6 +628,32 @@ export interface vtkRenderer extends vtkViewport {
|
|
|
628
628
|
* Not Implemented yet
|
|
629
629
|
*/
|
|
630
630
|
visibleVolumeCount(): any;
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Set the viewport background.
|
|
634
|
+
*
|
|
635
|
+
* @param {Number} r Defines the red component (between 0 and 1).
|
|
636
|
+
* @param {Number} g Defines the green component (between 0 and 1).
|
|
637
|
+
* @param {Number} b Defines the blue component (between 0 and 1).
|
|
638
|
+
* @param {Number} b Defines the alpha component (between 0 and 1).
|
|
639
|
+
*/
|
|
640
|
+
setBackground(r: number, g: number, b: number, a: number): boolean;
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Set the viewport background.
|
|
644
|
+
*
|
|
645
|
+
* @param {Number} r Defines the red component (between 0 and 1).
|
|
646
|
+
* @param {Number} g Defines the green component (between 0 and 1).
|
|
647
|
+
* @param {Number} b Defines the blue component (between 0 and 1).
|
|
648
|
+
*/
|
|
649
|
+
setBackground(r: number, g: number, b: number): boolean;
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Set the viewport background.
|
|
653
|
+
*
|
|
654
|
+
* @param {Number[]} background The RGB color array.
|
|
655
|
+
*/
|
|
656
|
+
setBackground(background: number[]): boolean;
|
|
631
657
|
}
|
|
632
658
|
|
|
633
659
|
/**
|
|
@@ -151,7 +151,7 @@ function vtkOpenGLOrderIndependentTranslucentPass(publicAPI, model) {
|
|
|
151
151
|
// have the forward pass use a texture backed zbuffer
|
|
152
152
|
|
|
153
153
|
if (forwardPass.getOpaqueActorCount() > 0) {
|
|
154
|
-
forwardPass.setCurrentOperation('
|
|
154
|
+
forwardPass.setCurrentOperation('opaqueZBufferPass');
|
|
155
155
|
renNode.traverse(forwardPass);
|
|
156
156
|
}
|
|
157
157
|
|
|
@@ -34,9 +34,9 @@ export interface IOpenGLRenderWindowInitialValues {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export interface ICaptureOptions {
|
|
37
|
-
resetCamera
|
|
38
|
-
size
|
|
39
|
-
scale
|
|
37
|
+
resetCamera?: boolean;
|
|
38
|
+
size?: Size;
|
|
39
|
+
scale?: number
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export interface I3DContextOptions {
|
|
@@ -320,7 +320,7 @@ export interface vtkOpenGLRenderWindow extends vtkOpenGLRenderWindowBase {
|
|
|
320
320
|
* @param {String} format
|
|
321
321
|
* @param {ICaptureOptions} options
|
|
322
322
|
*/
|
|
323
|
-
captureNextImage(format: string, options
|
|
323
|
+
captureNextImage(format: string, options?: ICaptureOptions): Nullable<Promise<string>>;
|
|
324
324
|
|
|
325
325
|
/**
|
|
326
326
|
*
|
|
@@ -376,16 +376,19 @@ function vtkOpenGLSurfaceLICInterface(publicAPI, model) {
|
|
|
376
376
|
fb.bind();
|
|
377
377
|
model.geometryImage.activate();
|
|
378
378
|
model.vectorImage.activate();
|
|
379
|
-
model.maskVectorImage.activate();
|
|
379
|
+
model.maskVectorImage.activate(); // Don't use location 1 as it can be used by order independant translucent pass
|
|
380
|
+
// Translucent pass uses location 1 because of this line:
|
|
381
|
+
// gl_FragData[1].r = weight;
|
|
382
|
+
|
|
380
383
|
fb.removeColorBuffer(0);
|
|
381
|
-
fb.removeColorBuffer(1);
|
|
382
384
|
fb.removeColorBuffer(2);
|
|
385
|
+
fb.removeColorBuffer(3);
|
|
383
386
|
fb.setColorBuffer(model.geometryImage, 0);
|
|
384
|
-
fb.setColorBuffer(model.vectorImage,
|
|
385
|
-
fb.setColorBuffer(model.maskVectorImage,
|
|
387
|
+
fb.setColorBuffer(model.vectorImage, 2);
|
|
388
|
+
fb.setColorBuffer(model.maskVectorImage, 3);
|
|
386
389
|
fb.setDepthBuffer(model.depthTexture);
|
|
387
390
|
var gl = model.context;
|
|
388
|
-
gl.drawBuffers([gl.COLOR_ATTACHMENT0, gl.
|
|
391
|
+
gl.drawBuffers([gl.COLOR_ATTACHMENT0, gl.NONE, gl.COLOR_ATTACHMENT2, gl.COLOR_ATTACHMENT3]);
|
|
389
392
|
gl.viewport.apply(gl, [0, 0].concat(_toConsumableArray(model.size)));
|
|
390
393
|
gl.scissor.apply(gl, [0, 0].concat(_toConsumableArray(model.size)));
|
|
391
394
|
gl.disable(gl.BLEND);
|
|
@@ -30,7 +30,7 @@ function vtkOpenGLSurfaceLICMapper(publicAPI, model) {
|
|
|
30
30
|
var array = model.renderable.getInputArrayToProcess(0);
|
|
31
31
|
|
|
32
32
|
if (array && model.canDrawLIC) {
|
|
33
|
-
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::Output::Dec', ['//VTK::Output::Dec', 'layout(location =
|
|
33
|
+
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::Output::Dec', ['//VTK::Output::Dec', 'layout(location = 2) out vec4 vectorTexture;', 'layout(location = 3) out vec4 maskVectorTexture;']).result;
|
|
34
34
|
var arrayName = array.getName();
|
|
35
35
|
var attributeName = "".concat(arrayName, "MC"); // We need normals even with no lighting
|
|
36
36
|
|
package/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
/// <reference path="./Common/DataModel/PolyLine.d.ts" />
|
|
44
44
|
/// <reference path="./Common/DataModel/Polygon.d.ts" />
|
|
45
45
|
/// <reference path="./Common/DataModel/Quad.d.ts" />
|
|
46
|
+
/// <reference path="./Common/DataModel/SelectionNode/Constants.d.ts" />
|
|
46
47
|
/// <reference path="./Common/DataModel/SelectionNode.d.ts" />
|
|
47
48
|
/// <reference path="./Common/DataModel/Sphere.d.ts" />
|
|
48
49
|
/// <reference path="./Common/DataModel/Spline1D.d.ts" />
|