Skip to content

Property2D ​

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.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIProperty2DInitialValuesNo(default: {})

getBackfaceCulling ​

Get the status of backface culling.

getColor ​

Get the color of the object.

getColorByReference ​

Get the color of the object.

getDisplayLocation ​

Get the display location of the object.

getFrontfaceCulling ​

Get the status of frontface culling.

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 culling is on and frontface culling is off.

ArgumentTypeRequiredDescription
initialValuesIProperty2DInitialValuesNofor pre-setting some of its content

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.

ArgumentTypeRequiredDescription
backfaceCullingBooleanYes

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.

ArgumentTypeRequiredDescription
colorRGBColorYesDefines 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.

ArgumentTypeRequiredDescription
rNumberYesDefines the red component (between 0 and 1).
gNumberYesDefines the green component (between 0 and 1).
bNumberYesDefines 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.

ArgumentTypeRequiredDescription
colorRGBColorYesDefines 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.

ArgumentTypeRequiredDescription
rNumberYesDefines the red component (between 0 and 1).
gNumberYesDefines the green component (between 0 and 1).
bNumberYesDefines the blue component (between 0 and 1).

setDisplayLocation ​

Set the display location of the object.

ArgumentTypeRequiredDescription
displayLocationStringYes

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.

ArgumentTypeRequiredDescription
frontfaceCullingBooleanYes

setLineWidth ​

Set the width of a Line. The width is expressed in screen units. This is only implemented for OpenGL.

ArgumentTypeRequiredDescription
lineWidthNumberYesThe width of the Line.

setOpacity ​

Set the object’s opacity. 1.0 is totally opaque and 0.0 is completely transparent.

ArgumentTypeRequiredDescription
opacityNumberYesThe opacity value.

setPointSize ​

Set the diameter of a point. The size is expressed in screen units. This is only implemented for OpenGL.

ArgumentTypeRequiredDescription
pointSizeNumberYesThe diameter of the point.