Introduction
vtkProperty is an object that represents lighting and other surface
properties of a 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
addShaderVariable
Not Implemented yet
computeCompositeColor
Not Implemented yet
extend
Method use to decorate a given object (publicAPI+model) with vtkProperty 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 |
IPropertyInitialValues | No | (default: {}) |
getAmbient
Get the lighting coefficient.
getAmbientColor
Get the ambient surface color. Not all renderers support separate ambient
and diffuse colors. From a physical standpoint it really doesn’t make too
much sense to have both. For the rendering libraries that don’t support
both, the diffuse color is used.
getAmbientColorByReference
Get the ambient surface color.
getAmbientOcclusionTexture
Get the ambient occlusion texture.
getBackfaceCulling
getBaseIOR
Get the index of refraction.
getColor
Get the color of the object.the color of the object
getDiffuse
Get the diffuse lighting coefficient.
getDiffuseColor
Get the diffuse surface color.
getDiffuseColorByReference
getDiffuseTexture
Get the diffuse texture.
getEdgeColor
getEdgeColorByReference
getEdgeVisibility
getEmission
Get the emission coefficient.
getEmissionTexture
Get the emission texture.
getFrontfaceCulling
Get the fast culling of polygons based on orientation of normal
with respect to camera. If frontface culling is on, polygons facing
towards camera are not drawn.
getInterpolation
Get the shading interpolation method for an object.
getInterpolationAsString
Map the interpolation integer to the corresponding ShadingModel.
getLighting
Get lighting flag for an object.
getLineWidth
Get the width of a Line. The width is expressed in screen units.
getMetallic
Get the metallic coefficient.
getMetallicTexture
Get the metallic texture.
getNormalStrength
Get the strength of the normal map.
getNormalTexture
Get the normal texture.
getOpacity
Get the opacity of the object. Set/Get the object’s opacity.
1.0 is totally opaque and 0.0 is completely transparent.
getPointSize
Get the diameter of a point. The size is expressed in screen units.
getRepresentation
Get the surface geometry representation for the object.
getRepresentationAsString
Get the surface geometry representation for the object as string.
getRoughness
Get the roughness coefficient.
getRoughnessTexture
Get the roughness texture.
getSpecular
Get the specular lighting coefficient.
getSpecularColor
Get the specular surface color.
getSpecularColorByReference
Get the specular surface color.
getSpecularPower
Get the specular power.
newInstance
Method use to create a new instance of vtkProperty 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 |
IPropertyInitialValues | No | for pre-setting some of its content |
setAmbient
Set the ambient lighting coefficient.
Argument | Type | Required | Description |
---|---|---|---|
ambient |
Number | Yes | The ambient lighting coefficient. |
setAmbientColor
Set the ambient surface color. Not all renderers support separate
ambient and diffuse colors. From a physical standpoint it really
doesn’t make too much sense to have both. For the rendering
libraries that don’t support both, the diffuse color is used.
Argument | Type | Required | Description |
---|---|---|---|
ambientColor |
RGBColor | Yes | An Array of the RGB color. |
setAmbientColor
Set the ambient surface color. Not all renderers support separate
ambient and diffuse colors. From a physical standpoint it really
doesn’t make too much sense to have both. For the rendering
libraries that don’t support both, the diffuse color is used.
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) |
setAmbientColorFrom
Set the ambient surface color from an RGB array
Argument | Type | Required | Description |
---|---|---|---|
ambientColor |
RGBColor | Yes | An Array of the RGB color. |
setAmbientOcclusionTexture
Set the ambient occlusion texture.
Argument | Type | Required | Description |
---|---|---|---|
ambientOcclusionTexture |
vtkTexture | Yes |
setBackfaceCulling
Turn on/off fast culling of polygons based on orientation of normal
with respect to camera. If backface culling is on, polygons facing
away from camera are not drawn.
Argument | Type | Required | Description |
---|---|---|---|
backfaceCulling |
Boolean | Yes |
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 | An Array of the RGB color. |
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) |
setDiffuse
Set the diffuse lighting coefficient.
Argument | Type | Required | Description |
---|---|---|---|
diffuse |
Number | Yes | The diffuse lighting coefficient. |
setDiffuseColor
Set the diffuse surface color.
Argument | Type | Required | Description |
---|---|---|---|
diffuseColor |
RGBColor | Yes | An Array of the RGB color. |
setDiffuseColor
Set the diffuse surface color.
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) |
setDiffuseColorFrom
Set the diffuse surface color from an RGB array
Argument | Type | Required | Description |
---|---|---|---|
diffuseColor |
RGBColor | Yes | An Array of the RGB color. |
setDiffuseTexture
Set the diffuse texture.
Argument | Type | Required | Description |
---|---|---|---|
diffuseTexture |
vtkTexture | Yes |
setEdgeColor
Set the color of primitive edges (if edge visibility is enabled).
Argument | Type | Required | Description |
---|---|---|---|
edgeColor |
RGBColor | Yes | An Array of the RGB color. |
setEdgeColor
Set the color of primitive edges (if edge visibility is enabled).
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) |
setEdgeColorFrom
Set the color of primitive edges from an RGB array.
Argument | Type | Required | Description |
---|---|---|---|
edgeColor |
RGBColor | Yes | An Array of the RGB color. |
setEdgeVisibility
Turn on/off the visibility of edges. On some renderers it is
possible to render the edges of geometric primitives separately
from the interior.
Argument | Type | Required | Description |
---|---|---|---|
edgeVisibility |
Boolean | Yes |
setEmission
Set the ambient occlusion map strength.
Argument | Type | Required | Description |
---|---|---|---|
emission |
Boolean | Yes |
setEmissionTexture
Set the emission texture.
Argument | Type | Required | Description |
---|---|---|---|
emissionTexture |
vtkTexture | Yes |
setFrontfaceCulling
Turn on/off fast culling of polygons based on orientation of normal
with respect to camera. If frontface culling is on, polygons facing
towards camera are not drawn.
Argument | Type | Required | Description |
---|---|---|---|
frontfaceCulling |
Boolean | Yes |
setInterpolation
Set the shading interpolation method for an object.
Argument | Type | Required | Description |
---|---|---|---|
interpolation |
Interpolation | Yes |
setInterpolationToFlat
Set interpolation to 0 means FLAT
.
setInterpolationToGouraud
Set interpolation to 1 means GOURAUD
.
setInterpolationToPhong
Set interpolation to 2 means PHONG
.
setLighting
Set lighting flag for an object.
Argument | Type | Required | Description |
---|---|---|---|
lighting |
Boolean | Yes |
setLineWidth
Set the width of a Line. The width is expressed in screen units.
!!! note
This is only implemented for OpenGL.
Argument | Type | Required | Description |
---|---|---|---|
lineWidth |
Number | Yes |
setMetallicTexture
Set the metallic texture.
Argument | Type | Required | Description |
---|---|---|---|
metallicTexture |
vtkTexture | Yes |
setNormalStrength
Set the normal map strength.
Argument | Type | Required | Description |
---|---|---|---|
normal |
Boolean | Yes |
setNormalTexture
Set the normal texture.
Argument | Type | Required | Description |
---|---|---|---|
normalTexture |
vtkTexture | Yes |
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 of the object. |
setPointSize
Set the diameter of a point. The size is expressed in screen units.
!!! note
This is only implemented for OpenGL.
Argument | Type | Required | Description |
---|---|---|---|
pointSize |
Number | Yes |
setRepresentation
Control the surface geometry representation for the object.
Argument | Type | Required | Description |
---|---|---|---|
representation |
Representation | Yes |
setRepresentationToPoints
Set representation to 0 means POINT
‘
setRepresentationToSurface
Set representation to 2 means SURFAC
‘
setRepresentationToWireframe
Set representation to 1 means WIREFRAM
‘
setRoughnessTexture
Set the roughness texture.
Argument | Type | Required | Description |
---|---|---|---|
roughnessTexture |
vtkTexture | Yes |
setSpecular
Set the specular lighting coefficient.
Argument | Type | Required | Description |
---|---|---|---|
specular |
Boolean | Yes |
setSpecularColor
Set the specular surface color from an RGB array
Argument | Type | Required | Description |
---|---|---|---|
specularColor |
RGBColor | Yes | An Array of the RGB color. |
setSpecularColor
Set the specular surface color.
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) |
setSpecularColorFrom
Set the specular surface color from an RGB array
Argument | Type | Required | Description |
---|---|---|---|
specularColor |
RGBColor | Yes | An Array of the RGB color. |
setSpecularPower
Set the specular power.
Argument | Type | Required | Description |
---|---|---|---|
specularPower |
Number | Yes |
Source
export declare enum Shading { |
export const Shading = { |
import { vtkObject } from '../../../interfaces'; |
import macro from 'vtk.js/Sources/macros'; |