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;
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.
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:
The light controlled by the light editor. light is a connection to an object that matches type GDlight_templ.
This parameter controls whether the light is turned on: 0 means it is off; 1 means it is on.
This parameter controls the light's type:
|
|
|
These parameters control the light's color, in terms of RGB.
(Point lights and spot lights only) These parameters control the light's attenuation coefficients, specified as two numbers.
(Spot lights only) These parameters controls the light's concentration exponent.
(Spot lights only) This parameters controls the light's spread angle, in degrees.
Libraries.Graphics_Display.Editors.UI_Editors.LightInfoEditor