DefaultProps

Synopsis

Define the Graphics Display Kit properties

GDprops_templ

group+OPort _GDprops_templ
{
float _col[3];
float _hi1_col[3];
float__hi2_col[3]
float _material[4];
float _spec_col[3];
float _trans;
enum _draw_mode {choices = {"Copy", "XOR"}; };
int _line_width;
enum line_style { choices = {"Solid", "Dashed", "Dotted", "DashDot"}; };
int line_aa;
float dir_pt_size;
int subdiv;
int jitter;
enum cull { choices = {"Normal", "Back", "Front", "Flip Normals"}; };
enum voxel_interp { choices = {"Point", "Trilinear"}; };
enum ray_algo { choices = {"Direct Composite", "Average", "Maximum",
"Distance to Max", "SFP"}; };
enum ray_norm { choices = {"Global", "View", "Ray"}; };
int fat_ray;
float sfp_absorb;
float sfp_emit;
string font;
int _inherit;
ptr+nonotify _local_ptr;
};

GDprops

GDprops_templ+IPort2 _GDprops
{
_local_ptr+write;
method+notify_inst+notify_val upd_func = "GDprops_update";
method+notify_deinst del_func = "GDprops_delete";
};

DefaultProps

GDprops _DefaultProps
{col = {GD_DEFAULT_RED, GD_DEFAULT_GREEN,
GD_DEFAULT_BLUE};
hi1_col = {GD_DEFAULT_RED, GD_DEFAULT_GREEN,
GD_DEFAULT_BLUE};
hi2_col = {GD_DEFAULT_RED, 0.0,0.0};
material = {GD_DEFAULT_AMBIENT, GD_DEFAULT_DIFFUSE,
GD_DEFAULT_SPECULAR,GD_DEFAULT_SPEC_EXP};
spec_col = {GD_DEFAULT_RED, GD_DEFAULT_GREEN,
GD_DEFAULT_BLUE};
trans = GD_DEFAULT_TRANS;
draw_mode = GD_DEFAULT_DRAW_MODE;
line_width = GD_DEFAULT_LINE_WIDTH;
line_style = GD_DEFAULT_LINE_STYLE;
line_aa = GD_DEFAULT_LINE_AA;
dir_pt_size = GD_DEFAULT_DIR_PT_SIZE;
subdiv = GD_DEFAULT_SUBDIV;
jitter = GD_DEFAULT_JITTER;
cull = GD_DEFAULT_CULL;
voxel_interp = GD_DEFAULT_VOX_INTERP;
ray_algo = GD_DEFAULT_RAY_ALGO;
ray_norm = GD_DEFAULT_RAY_NORM;
fat_ray = GD_DEFAULT_FAT_RAY;
sfp_absorb = GD_DEFAULT_SFP_ABSORB;
sfp_emit = GD_DEFAULT_SFP_EMIT;
font = GD_DEFAULT_FONT;
inherit = 1;
};

Description

These templates define the Graphics Display Kit properties. GDprops_templ defines the elements that cause the properties methods to execute. GDprops defines an instanceable version without default values. DefaultProps defines an instanceable version with default values.

Input


Parameters

col

This parameter controls the primary color for a primitive, in terms of RGB. This color is used when no node data or cell data is supplied.

hi1_col
hi2_col

These parameters control the colors for a primitive, in terms of RGB, when rendering lines and/or points in addition to a surface.

If the object...

and...

then...

Renders a surface

Renders only lines or only points

The lines or points are rendered in the hi1 color.

Renders both lines and points

The lines are rendered in the hi1 color and the points are rendered in the hi2 color.

 

Does not render a surface

Renders only lines or only points

The lines or points are rendered in the vertex color, if any, or the primary color.

 

Renders both lines and points

The lines are rendered in the vertex color, if any, or the primary color. The points are rendered in the hi1 color.


material

This parameter is an array of values that controls various material properties of an object.

Array index

Parameter

Description

0

Ambient

Coefficient for ambient light reflectance

1

Diffuse

Coefficient for diffuse light reflectance

2

Specular

Specular reflection coefficient

3

Specular exponent

Specular exponent

Ambient light reflectance controls the proportion of the available ambient light that the object reflects. Ambient light is non-directional, affecting all parts of all surfaces equally.
Diffuse light reflectance controls the proportion of the available non-ambient light that the object reflects equally in all directions. Non-ambient light emanates from the directional and point light sources.
Specular highlights of a particular color and brightness are created when the direction of incoming light (from a directional or point light source) is "sufficiently close" to the viewing direction. The specular reflection coefficient determines the brightness of such highlights. The specular exponent determines what "sufficiently close" means. The greater the sharpness, the smaller (more focused) the size of the specular highlight.

spec_col

This parameter controls the color for specular highlights, in terms of RGB.

trans

This parameter controls the transparency value, between 0 and 1. As trans approaches 0, the object's surface gets more transparent. As trans approaches 1, the object's surface gets more opaque.

draw_mode

The drawing mode for the object.

Value

Meaning

Symbolic contant

0

Use copy mode. This means that the object is drawn over the background. Anything under the object must be rerendered when line is moved.

GD_PROPS_DRAW_COPY

1

Use xor mode. This means that the object is drawn by performing, at each point, an xor operation on the background color. You typically use this for interactive objects, line drawing.

GD_PROPS_DRAW_XOR


line_width

This parameter controls the width of lines. It is specified as an integer pixel width.

line_style

This parameter controls the style of the lines drawn:

Value

Meaning

Symbolic contant

0

Draw solid lines

GD_PROPS_LINE_SOLID

1

Draw dashed lines

GD_PROPS_LINE_DASHED

2

Draw dotted lines

GD_PROPS_LINE_DOTTED

3

Draw dashed-dotted lines

GD_PROPS_LINE_DASHDOT


line_aa

This parameter controls the anti-aliasing of lines. 0 disables anti-aliasing; 1 enables anti-aliasing. This option is supported in the OpenGL and XGL renderers.

dir_pt_size

This parameter controls the length of the normal lines rendered in Directed Points mode, but can also affect the length and radius of tubes, cones, and arrows in special modes within the OpenGL renderer.

subdiv

This parameter controls the sphere subdivision or tesselation level.

jitter

This parameter controls the number of units that the object is offset. A positive value moves the object forward jitter units in the camera. A negative value moves the object backward jitter units in the camera. Offsetting an object is useful when multiple objects are rendered at the same depth. Note that when an object is locked, its coordinates are not transformed, thus they are not jittered.

cull

The parameter controls backface culling.

Value

Meaning

Symbolic constant

0

Render in normal ackface mode for the specific renderer

GD_BACKFACE_NORMAL

1

Cull back faces

GD_BACKFACE_CULL_BACK

2

Cull front faces

GD_BACKFACE_CULL_FRONT

3

Flip the normals and light back faces like front faces

GD_BACKFACE_CULL_FLIP


voxel_interp

The parameter controls the volume rendering interpolation method; that is, how voxel values are mapped to rays or pixels.

Value

Meaning

Symbolic constant

0

The value of the nearest voxel is used.

GD_VOX_POINT

1

Values are linearly interpolated fro the two nearest voxels in each of the 3 principal directions.

GD_VOX_TRILINEAR


ray_algo

The parameter controls how data or spatial values are mapped to the ray and how the ray values are mapped to the final color for the pixel.

Value

Meaning

Symbolic constant

0

At each step along the ray, the interpolated value is composited with the current value using standard alpha blending equations.

GD_ALGO_DIRECT

1

The ray maintains a moving average of the voxel values along its length.

GD_ALGO_AVERAGE

2

The ray maintains the maximum value encountered along its length.

GD_ALGO_MAXVALUE

3

The ray maintains a distance measure and the maximum value. The distance is updated only when a new maximum value is found.

GD_ALGO_DISTMAX

4

Simulated Fluorescence Process algorithm

GD_ALGO_SFP


ray_norm

The parameter controls how the ray ranges are normalized when the ray algorithm is Distance to Max:

Value

Meaning

Symbolic constant

0

The ray ranges are normalized to the diameter of a sphere enclosing the entire volume.

GD_DIST_GLOBAL

1

The ray ranges are normalized to the depth of the current view. This depth is the maximum extent of the data volume projected onto the viewing direction.

GD_DIST_VIEW

2

The ray range is individually normalized to the length of the ray.

GD_DIST_RAY

3

The ray maintains a distance measure and the maximum value. The distance is updated only when a new maximum value is found.

GD_ALGO_DISTMAX

4

Simulated Fluorescence Process algorithm

GD_ALGO_SFP


fat_ray

This parameter enables a super-sampling method that traces a single ray through a 4x4 block of pixels. The resulting image is faster to render, but of lower resolution.

sfp_absorb

This parameter controls the absorption of the exciting radiation when the ray algorithm is GD_ALGO_SFP.

sfp_emit

This parameter controls the emmittance of fluorescence radiation in the direction of the observer when the ray algorithm is GD_ALGO_SFP.

font

This string parameter is used to specify the font to be used when text is rendered.

inherit

Whether the object should inherit its parent object's properties: 0 means no; 1 means yes.

Output Port


Example

Libraries.Graphics_Display.Objects.DataObject

File

v/gdif.v

See also related modules

Not Applicable.