GDlight_edit


Synopsis

define an editor for a Graphics Display Kit light

GDlight_edit_notify_templ


group  GDlight_edit_notify_templ
{
int  state;
enum  type {choices = {"Directional", "Point", "Spot", "BiDirectional"}; };
float  red;
float  green;
float  blue;
float  att1;
float  att2;
float  concen;
float  angle;
GDlight_templ+IPort2  &light;
};

 

GDlight_edit


GDlight_edit_notify_templ  GDlight_edit_templ

int+IPort2 shell_vis;
int reset;
GDlight_templ+IPort2 &light;
method+notify_inst+notify_val upd_func = "GDlight_edit_update";
};

 

GDlight_edit


GDlight_edit_templ GDlight_edit;

Description

These templates define an editor for a Graphics Display Kit light. GDlight_edit_notify_templ and GDlight_edit_templ define the elements that cause the light editor's method to execute. GDlight_edit is the version you instance.

As an alternative to using GDlight_edit and having to define your own user interface for the editor, you can use LightInfoEditor, an application component. LightInfoEditor contains GDlight_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 light that the editor is attached to 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 light that the editor is attached to 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;

light

The light controlled by the light editor. light is a connection to an object that matches type GDlight_templ.

Parameters

state

This parameter controls whether the light is turned on: 0 means it is off; 1 means it is on.

type

This parameter controls the light's type:

Value

 

Meaning

 

Symbolic constant

 

0

A directional light

GD_LIGHT_DIR

1

A point light

GD_LIGHT_PT

2

A spot light

GD_LIGHT_SPOT

3

A bidirectional light

GD_LIGHT_BIDIR

 

red
green
blue

These parameters control the light's color, in terms of RGB.

att1
att2

(Point lights and spot lights only)  These parameters control the light's attenuation coefficients, specified as two numbers.

concen

(Spot lights only)  These parameters controls the light's concentration exponent.

angle

(Spot lights only)  This parameters controls the light's spread angle, in degrees.

Example

Libraries.Graphics_Display.Editors.UI_Editors.LightInfoEditor

File

v/gd.v