Skip to content

Commit 5294bbb

Browse files
authored
Merge pull request #2704 from Julesdevops/various-typescript-fixes
Miscellaneous typescript def fixes: vtkSelectionNode, vtkMapper, vtkColorTransferFunction, vtkOpenGLRenderWindow
2 parents 7945528 + 2da9e2b commit 5294bbb

File tree

6 files changed

+121
-35
lines changed

6 files changed

+121
-35
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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;
Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,70 @@
11
import { vtkObject } from "../../../interfaces" ;
22
import { Bounds } from "../../../types";
3+
import { SelectionContent, SelectionField } from "./Constants";
4+
import vtkProp from "../../../Rendering/Core/Prop";
35

4-
export enum SelectionContent {
5-
GLOBALIDS,
6-
PEDIGREEIDS,
7-
VALUES,
8-
INDICES,
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[];
1411
}
1512

16-
export enum SelectionField {
17-
CELL,
18-
POINT,
19-
FIELD,
20-
VERTEX,
21-
EDGE,
22-
ROW,
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];
2321
}
2422

25-
export interface ISelectionNodeInitialValues {}
26-
2723
export interface vtkSelectionNode extends vtkObject {
28-
2924
/**
30-
*
25+
* Get the bounds of the selection points.
3126
*/
3227
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);
3368
}
3469

3570
/**
@@ -57,5 +92,7 @@ export function newInstance(initialValues?: ISelectionNodeInitialValues): vtkSel
5792
export declare const vtkSelectionNode: {
5893
newInstance: typeof newInstance,
5994
extend: typeof extend;
95+
SelectionContent: typeof SelectionContent;
96+
SelectionField: typeof SelectionField;
6097
};
6198
export default vtkSelectionNode;

Sources/Rendering/Core/ColorTransferFunction/index.d.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import vtkDataArray from '../../../Common/Core/DataArray';
2-
import { vtkObject } from '../../../interfaces';
2+
import vtkScalarsToColors from '../../../Common/Core/ScalarsToColors'
33
import { ColorSpace, Scale } from "./Constants";
44

55

6-
/* TODO: use VtkScalarsToColors instead of VtkObject */
7-
export interface vtkColorTransferFunction extends vtkObject {
6+
export interface vtkColorTransferFunction extends vtkScalarsToColors {
87
/**
98
* Add a point defined in RGB
109
* @param {Number} x The index of the point.
@@ -270,13 +269,6 @@ export interface vtkColorTransferFunction extends vtkObject {
270269
*/
271270
fillFromDataPointer(nb: number, ptr: any): void;
272271

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-
280272
/**
281273
* Remove all points out of the new range, and make sure there is a point at
282274
* each end of that range.

Sources/Rendering/Core/Mapper/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,10 @@ export interface vtkMapper extends vtkAbstractMapper3D {
485485
*
486486
*/
487487
setInterpolateScalarsBeforeMapping(interpolateScalarsBeforeMapping: boolean): boolean;
488+
489+
setResolveCoincidentTopologyToPolygonOffset(): boolean;
490+
491+
setResolveCoincidentTopologyToOff(): boolean;
488492
}
489493

490494
/**

Sources/Rendering/Core/Renderer/index.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,32 @@ export interface vtkRenderer extends vtkViewport {
628628
* Not Implemented yet
629629
*/
630630
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;
631657
}
632658

633659
/**

Sources/Rendering/OpenGL/RenderWindow/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export interface IOpenGLRenderWindowInitialValues {
3434
}
3535

3636
export interface ICaptureOptions {
37-
resetCamera: boolean;
38-
size: Size;
39-
scale: number
37+
resetCamera?: boolean;
38+
size?: Size;
39+
scale?: number
4040
}
4141

4242
export interface I3DContextOptions {
@@ -320,7 +320,7 @@ export interface vtkOpenGLRenderWindow extends vtkOpenGLRenderWindowBase {
320320
* @param {String} format
321321
* @param {ICaptureOptions} options
322322
*/
323-
captureNextImage(format: string, options: ICaptureOptions): Nullable<Promise<string>>;
323+
captureNextImage(format: string, options?: ICaptureOptions): Nullable<Promise<string>>;
324324

325325
/**
326326
*

0 commit comments

Comments
 (0)