GDprops_edit


Synopsis

define an editor for the Graphics Display Kit properties

GDprops_edit_notify_templ


group  GDprops_edit_notify_templ
{
float  red;
float  green;
float  blue;
float  hi1_red;
float  hi1_green;
float  hi1_blue;
float  hi2_red;
float  hi2_green;
float  hi2_blue;
float  spec_red;
float  spec_green;
float  spec_blue;
float  ambient;
float  diffuse;
float  specular;
float  spec_exp;
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;
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;
int  inherit;
};

 

GDprops_edit_templ


GDprops_edit_notify_templ  GDprops_edit
_templ{
int+IPort2 shell_vis;
int reset;
GDprops_templ+IPort2 &props;
method+notify_inst+notify_val upd_func = "GDprops_edit_update";
};

 

GDprops_edit


GDprops_edit_templ GDprops_edit;

 

Description

These templates define an editor for the Graphics Display Kit properties. GDprops_edit_notify_templ and GDprops_edit_templ define the elements that cause the properties editor's method to execute. GDprops_edit is the version you instance.

As an alternative to using GDprops_edit and having to define your own user interface for the editor, you can use PropsEditor, an application component. PropsEditor contains GDprops_edit and defines a user interface.

Input Ports

shell_vis

The parameter controls whether the editor is active: 0 means it is not; 1 means it is.

shell_vis is only checked if the properties to which the editor is attached has changed. In this case, if shell_vis is not set to 1, the editor does not update. This inhibits updates to the editor's other subobjects -- which are normally attached to UI widgets -- when the user interface is not visible. The editor always executes when the values of the other parameters change. This means that the properties to which the editor is attached is always updated even if the user interface is not visible.

Typically you connect shell_vis to the same UIcmd object that the user selects to display the editor's user interface:

shell_vis => UICmd.do;

props

The properties object controlled by the editor. props is a connection to an object that matches type GDprops_templ.

Parameters

red
green
blue

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

hi1_red
hi1_green
hi1_blue
hi2_red
hi2_green
hi2_blue

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 red/green/blue.

Renders both lines and points

The lines are rendered in the hi1 color and the points are rendered in the hi2 red/green/blue.

 

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 red/green/blue.

 

spec_red
spec_green
spec_blue

These parameters control the color for specular highlights, in terms of RGB.

ambient
diffuse
specular
spec_exp

These parameters control various material properties of an object.

Ambient light reflectance controls the proportion of the available ambient light that the object reflects. Ambient light is nondirectional, 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. Nonambient 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.

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.

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.

cull

This parameter controls backface culling.

Value

 

Meaning

 

Symbolic constant

 

0

Render in normal backface 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.

inherit

This parameter controls whether the object should inherit its parent object's properties: 0 means no; 1 means yes.

reset

This parameter when set causes the properties attached to the editor to be reset to their default values.

Example

Libraries.Graphics_Display.Editors.UI_Editors.PropsEditor

File

v/gd.v