Skip to content

Commit 0e7a80c

Browse files
authored
Merge pull request #2540 from Kitware/fix-types
docs(Rendering): fix types
2 parents 33ed2c2 + c359718 commit 0e7a80c

File tree

5 files changed

+42
-12
lines changed

5 files changed

+42
-12
lines changed

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import vtkProp, { IPropInitialValues } from '../Prop';
22
import vtkCoordinate from '../Coordinate';
33
import vtkMapper from '../Mapper';
4-
import vtkProperty from '../Property';
4+
import vtkProperty2D, { IProperty2DInitialValues } from '../Property2D';
55
import { Bounds } from '../../../types';
66

77
/**
88
*
99
*/
1010
export interface IActor2DInitialValues extends IPropInitialValues {
1111
mapper?: vtkMapper;
12-
property?: vtkProperty;
12+
property?: vtkProperty2D;
1313
layerNumber?: number;
1414
positionCoordinate?: vtkCoordinate;
1515
positionCoordinate2?: vtkCoordinate;
@@ -31,12 +31,18 @@ export interface vtkActor2D extends vtkProp {
3131

3232
/**
3333
* Return the property object that controls this actors surface
34-
* properties. This should be an instance of a vtkProperty object. Every
34+
* properties. This should be an instance of a vtkProperty2D object. Every
3535
* actor must have a property associated with it. If one isn’t specified,
3636
* then one will be generated automatically. Multiple actors can share one
3737
* property object.
3838
*/
39-
getProperty(): vtkProperty;
39+
getProperty(): vtkProperty2D;
40+
41+
/**
42+
* Create a new property suitable for use with this type of Actor.
43+
* @param {IProperty2DInitialValues} [initialValues] (default: {})
44+
*/
45+
makeProperty(initialValues?: IProperty2DInitialValues): vtkProperty2D;
4046

4147
/**
4248
*
@@ -112,8 +118,8 @@ export function newInstance(initialValues?: IActor2DInitialValues): vtkActor2D;
112118
* vtkProp. The actor also has scaling and maintains a reference to the
113119
* defining geometry (i.e., the mapper), rendering properties, and possibly a
114120
* texture map.
115-
* @see [vtkMapper](./Rendering_Core_Mapper.html)2D
116-
* @see [vtkProperty](./Rendering_Core_Property.html)2D
121+
* @see [vtkMapper2D](./Rendering_Core_Mapper2D.html)
122+
* @see [vtkProperty2D](./Rendering_Core_Property2D.html)
117123
*/
118124
export declare const vtkActor2D: {
119125
newInstance: typeof newInstance,
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* vtkColorMaps represents a global registry of preset color maps.
3+
*/
4+
5+
import { Vector3 } from '../../../types';
6+
7+
export interface IColorMapPreset {
8+
Name: string;
9+
Creator?: string;
10+
ColorSpace?: string;
11+
NanColor?: Vector3;
12+
RGBPoints: number[];
13+
IndexedColors?: number[];
14+
Annotations?: (number | string)[];
15+
}
16+
17+
export declare const vtkColorMaps: {
18+
addPreset(preset: IColorMapPreset): void;
19+
removePresetByName(name: string): void;
20+
getPresetByName(name: string): IColorMapPreset;
21+
rgbPresetNames: string[];
22+
};
23+
24+
export default vtkColorMaps;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { vtkObject } from "../../../interfaces";
22
import { RGBColor } from "../../../types";
33
import { DisplayLocation } from "./Constants";
44

5-
interface IProperty2DInitialValues{
5+
export interface IProperty2DInitialValues{
66
color?: RGBColor;
77
opacity?: number;
88
pointSize?: number;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { InterpolationType, OpacityMode } from "./Constants";
55

66
export interface IVolumePropertyInitialValues {
77
independentComponents?: boolean;
8-
shade?: number;
8+
shade?: boolean;
99
ambient?: number;
1010
diffuse?: number;
1111
specular?: number;
@@ -111,7 +111,7 @@ export interface vtkVolumeProperty extends vtkObject {
111111
/**
112112
* Get the shading of a volume.
113113
*/
114-
getShade(): number;
114+
getShade(): boolean;
115115

116116
/**
117117
*
@@ -236,9 +236,9 @@ export interface vtkVolumeProperty extends vtkObject {
236236
* turning shading off is generally the same as setting ambient=1,
237237
* diffuse=0, specular=0. Shading can be independently turned on/off per
238238
* component.
239-
* @param {Number} shade
239+
* @param {Boolean} shade
240240
*/
241-
setShade(shade: number): boolean;
241+
setShade(shade: boolean): boolean;
242242

243243
/**
244244
*

Sources/Rendering/Core/VolumeProperty/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ function vtkVolumeProperty(publicAPI, model) {
246246
const DEFAULT_VALUES = {
247247
independentComponents: true,
248248
interpolationType: InterpolationType.FAST_LINEAR,
249-
shade: 0,
249+
shade: false,
250250
ambient: 0.1,
251251
diffuse: 0.7,
252252
specular: 0.2,

0 commit comments

Comments
 (0)