Introduction
vtkProperty2D is an object that represents lighting and other surface
properties of a 2D geometric object. The primary properties that can be
set are colors (overall, ambient, diffuse, specular, and edge color);
specular power; opacity of the object; the representation of the
object (points, wireframe, or surface); and the shading method to be
used (flat, Gouraud, and Phong). Also, some special graphics features
like backface properties can be set and manipulated with this object.
Methods
extend
Method use to decorate a given object (publicAPI+model) with vtkProperty2D characteristics.
Argument | Type | Required | Description |
---|---|---|---|
publicAPI |
Yes | object on which methods will be bounds (public) | |
model |
Yes | object on which data structure will be bounds (protected) | |
initialValues |
IProperty2DInitialValues | No | (default: {}) |
getColor
Get the color of the object.
getColorByReference
Get the color of the object.
getDisplayLocation
Get the display location of the object.
getLineWidth
Get the width of a Line.
The width is expressed in screen units.
getOpacity
Get the opacity of the object.
getPointSize
Get the diameter of a point.
The size is expressed in screen units.
newInstance
Method use to create a new instance of vtkProperty2D with object color, ambient color, diffuse color,
specular color, and edge color white; ambient coefficient=0; diffuse
coefficient=0; specular coefficient=0; specular power=1; Gouraud shading;
and surface representation. Backface and frontface culling are off.
Argument | Type | Required | Description |
---|---|---|---|
initialValues |
IProperty2DInitialValues | No | for pre-setting some of its content |
setColor
Set the color of the object. Has the side effect of setting the
ambient diffuse and specular colors as well. This is basically
a quick overall color setting method.
Argument | Type | Required | Description |
---|---|---|---|
color |
RGBColor | Yes | Defines the RGB color array.. |
setColor
Set the color of the object. Has the side effect of setting the
ambient diffuse and specular colors as well. This is basically
a quick overall color setting method.
Argument | Type | Required | Description |
---|---|---|---|
r |
Number | Yes | Defines the red component (between 0 and 1). |
g |
Number | Yes | Defines the green component (between 0 and 1). |
b |
Number | Yes | Defines the blue component (between 0 and 1). |
setColorFrom
Set the color of the object. Has the side effect of setting the
ambient diffuse and specular colors as well. This is basically
a quick overall color setting method.
Argument | Type | Required | Description |
---|---|---|---|
color |
RGBColor | Yes | Defines the RGB color array.. |
setColorFrom
Set the color of the object. Has the side effect of setting the
ambient diffuse and specular colors as well. This is basically
a quick overall color setting method.
Argument | Type | Required | Description |
---|---|---|---|
r |
Number | Yes | Defines the red component (between 0 and 1). |
g |
Number | Yes | Defines the green component (between 0 and 1). |
b |
Number | Yes | Defines the blue component (between 0 and 1). |
setDisplayLocation
Set the display location of the object.
Argument | Type | Required | Description |
---|---|---|---|
displayLocation |
String | Yes |
setLineWidth
Set the width of a Line. The width is expressed in screen units.
This is only implemented for OpenGL.
Argument | Type | Required | Description |
---|---|---|---|
lineWidth |
Number | Yes | The width of the Line. |
setOpacity
Set the object’s opacity. 1.0 is totally opaque and 0.0 is
completely transparent.
Argument | Type | Required | Description |
---|---|---|---|
opacity |
Number | Yes | The opacity value. |
setPointSize
Set the diameter of a point. The size is expressed in screen units.
This is only implemented for OpenGL.
Argument | Type | Required | Description |
---|---|---|---|
pointSize |
Number | Yes | The diameter of the point. |
Source
export declare enum DisplayLocation { |
export const DisplayLocation = { |
import { vtkObject } from '../../../interfaces'; |
import macro from 'vtk.js/Sources/macros'; |