![]() |
![]() |
![]() |
![]() |
This chapter provides reference material for Graphics Display Kit objects that are still valid but whose use has been made obsolete by the Uviewer architecture now provided by AVS/Express.
The objects and these reference pages are included in order to maintain backwards compatibility.
edit a Graphics Display Kit camera
macro CameraEditor {
GDview_templ+IMPort &view_in {
GDcamera_templ+OPort2 &picked_camera;
};
ilink vis;
GDcamera_edit GDcamera_edit {
shell_vis => vis;
camera => view_in.picked_camera;
};
macro CameraEditorUI {
UIshell camera_shell {
title = "Camera Editor";
visible => vis;
width = 575;
height = 550;
};
...
};
};
CameraEditor defines a dialog box to edit the picked camera subobject of the input view. It contains both a camera edit object (GDcamera_edit) and a user interface (CameraEditorUI).
A view. The CameraEditor edits the view's picked camera.
An integer indicating whether CameraEditor's user interface should appear: 0 means no; 1 means yes. Typically, you want the user interface to appear when the user selects a pulldown menu choice (a UIcmd object). To accomplish this, you connect vis to the UIcmd object's do element.
Libraries.Templates.VIEW.Components.ViewEditors
create a 2D drawing with successive mouse clicks
macro ClickSketch {
ilink rv;
GDview_templ &view<NEportLevels={2,1}>;
UImod_panel UImod_panel {
title = "Click Sketch";
message = "Select click sketch control panel.";
height => <-.UIpanel.y + <-.UIpanel.height;
};
...
GDroi2d_click GDroi2d_click {
view_in => view;
add => AddPoint.state;
erase => ErasePoint.state;
close => ClosePoint.state;
redraw => view.trigger;
x => AddPoint.x;
y => AddPoint.y;
};
GDmap2d_ss GDmap2d_ss {
view_in => view;
cam_in => view.picked_camera;
obj_in+IPort3;
in_buf => GDroi2d_click.out_buf;
out_mesh+OPort3;
};
DataObject DataObject {
in => GDmap2d_ss.out_mesh;
obj+OPort3;
};
};
ClickSketch enables you to create a 2D drawing with individual clicks of the mouse. It combines the following:
- one-point interactors for adding a point, erasing a region point, and closing a region
- GDroi2d_click for handling the drawing operation
- GDmap2d_ss for converting the output buffer created by GDroi2d_click to a field
- auser interface, which the user accesses through the Module Panel provided by the DataViewer or ModuleStack (as appropriate)
The UIrenderView panel where the drawing is to occur. This is typically connected to one of the Graphics Display Kit's viewer macros output render view (for example, SimpleViewer2D.rv).
A view. This is typically connected to one of the Graphics Display Kit's viewer macros output view (for example, SimpleViewer2D.view).
An optional connection to an object. Without an object, ClickSketch converts the drawing to a field in the camera's world space. With an object, ClickSketch converts the drawing to a field in the object's world space.
UIradioBox. A set of radio buttons to pick which type of primitive to draw. Possible primitives are point, line. box, polyline, and polygon.
UItoggle. This parameter controls whether the output buffer is immediately written to upon completion of a primitive. 1 means yes.; 0 means no. When the value is 0, you must press the Done button to cause the output buffer to be written.
UIsliders. Float sliders to set the red/green/blue build color while initially constructing the primitive. Values are in the range 0-1.
UItoggle. The mode to use when building the primitive: 0 means clear; 1 means append. If the mode selected is clear, each time a primitive is built it overwrites any previous primitive. If the mode selected is append, each time a primitive is built, it is appended to a previous primitive(s). By using append mode, you can build multiple primitives before mapping them to a field.
UIbutton. When pressed, this button causes the build buffer to be cleared of all primitives.
UIbutton. When pressed, this button causes all existing primitives to be written to the build output buffer. This buffer is then converted into a field.
UIsliders. Float sliders to set the red/green/blue map color while mapping the primitives from screen space to some world space coordinate system. Values are in the range 0-1. These colors are only used if the map color has a value of 1.
UItoggle. Enable/disable the use of the map red/green/blue colors. If the value is 0, no color information is written to the field. If the value is 1, color information is written to the output field as cell data. This gives you the ability to specify color on a per primitive basis.
UItoggle. The mode to use when mapping the primitives to world space: 0 means clear; 1 means append. If the mode selected is clear, each time primitives are mapped, any previous field is overwritten. If the mode selected is append, each time primitives are mapped, they are appended to the field. By using append mode, you can incrementally build the field.
UIbutton. When pressed, this button causes the output field to be cleared.
UItext. A name that, if specified, is written to the cell set as the cell name.
A field mesh plus optional cell data.
The field mesh as a Graphics Display Kit object.
Libraries.Examples.Graphics_Display.ClickSketch
Libraries.Examples.Graphics_Display.EditMesh
Libraries.Examples.Graphics_Display.ImageAnno
Libraries.Examples.Graphics_Display.ROIdrawcreate a 2D drawing with one continuous mouse gesture
macro ContinousSketch {
ilink rv;
GDview_templ &view<NEportLevels={2,1}>;
UImod_panel UImod_panel {
title = "Continuous Sketch";
message = "Select continuous sketch control panel.";
height => <-.UIpanel.y + <-.UIpanel.height;
};
...
GDroi2d_cont GDroi2d_cont {
view_in => view;
redraw => view.trigger;
x => UItwoPoint.x;
y => UItwoPoint.y;
state => UItwoPoint.state;
};
GDmap2d_ss GDmap2d_ss {
view_in => view;
cam_in => view.picked_camera;
obj_in+IPort3;
in_buf => GDroi2d_cont.out_buf;
out_mesh+OPort3;
};
DataObject DataObject {
in => GDmap2d_ss.out_mesh;
obj+OPort3;
};
};
ContinuousSketch enables you to create a 2D drawing with one continuous motion of the mouse. It combines the following:
- a two-point interactor for drawing
- GDroi2d_cont for handling the drawing operation
- GDmap2d_ss for converting the output buffer created by GDroi2d_cont to a field
- a user interface, which the user accesses through the Module Panel provided by the DataViewer or ModuleStack (as appropriate)
The UIrenderView panel where the drawing is to occur. This is typically connected to one of the Graphics Display Kit's viewer macros output render view (for example, SimpleViewer2D.rv).
A view. This is typically connected to one of the Graphics Display Kit's viewer macros output view (for example, SimpleViewer2D.view).
An optional connection to an object. Without an object, ContinuousSketch converts the drawing to a field in the camera's world space. With an object, ContinuousSketch converts the drawing to a field in the object's world space.
UIradioBox. A set of radio buttons to pick which type of primitive to draw. Possible primitives are point, line, box, polyline, and polygon.
UIradioBox. A set of radio buttons to pick the drawing mode to be used to draw the primitive while it is being built. Possible values are copy and exclusive or (that is, XOR).
UItoggle. This parameter controls whether the output buffer is immediately written to upon completion of a primitive: 1 means yes.; 0 means no. When the value is 0, you must press the Done button to cause the output buffer to be written.
UIsliders. Float sliders to set the red/green/blue build color while initially constructing the primitive. Values are in the range 0-1.
UItoggle. The mode to use when building the primitive: 0 means clear; 1 means append. If the mode selected is clear, each time a primitive is built it overwrites any previous primitive. If the mode selected is append, each time a primitive is built, it is appended to a previous primitive(s). By using append mode, you can build multiple primitives before mapping them to a field.
UIbutton. When pressed, this button causes the build buffer to be cleared of all primitives.
UIbutton. When pressed, this button causes all existing primitives to be written to the build output buffer. This buffer is then converted into a field.
UIsliders. Float sliders to set the red/green/blue map color while mapping the primitives from screen space to some world space coordinate system. Values are in the range 0-1. These colors are only used if the map color has a value of 1.
UItoggle. Enable/disable the use of the map red/green/blue colors. If the value is 0, no color information is written to the field. If the value is 1, color information is written to the output field as cell data. This gives you the ability to specify color on a per primitive basis.
UItoggle. The mode to use when mapping the primitives to world space: 0 means clear; 1 means append. If the mode selected is clear, each time primitives are mapped, any previous field is overwritten. If the mode selected is append, each time primitives are mapped, they are appended to the field. By using append mode, you can incrementally build the field.
UIbutton. When pressed, this button causes the output field to be cleared.
UItext. A name that if specified is written to the cell set as the cell name.
A field mesh plus optional cell data.
The field mesh as a graphics-display object.
Libraries.Examples.Graphics_Display.RegionCrop3D
Libraries.Examples.Graphics_Display.RegionCrop2DFor a discussion of continuous-sketch drawing, see Section 5.2, Constructing the drawing [page 5-3].
A datamap converts scalar node data or cell data values to RGB colors.
There are several higher-level datamap components that are composed of the objects described in the previous section. These higher-level objects are described in the sections below.
define a default linear data range
DefaultLinearRange provides an example for defining a linear data range. It is not used.
define a default step data range
DefaultStepRange provides an example for defining a step data range. It is not used.
DefaultLinear defines the default datamap that is used by other Graphics Display Kit objects (for example, DataObject and GroupObject).
DefaultLinear is defined with an HSV color model. It contains a single data range of size 256 with two control points that run from blue to red, going through green.
The minimum and maximum values of the scalar input data, typically obtained through connections to the object GDminmax.
Libraries.Templates.DMAP.DataObject
Libraries.Template.DMAP.GroupObjectGreyScale is defined with an HSV color model. It contains a single data range of size 256 with two control points that run from black to white.
The minimum and maximum values of the scalar input data, typically obtained through connections to the object GDminmax.
Libraries.Examples.Graphics_Display.ReplaceDatamap
define a datamap for use when volume rendering
VolumeRender is defined with an HSV color model. It contains two data ranges with a combined size of 256. It contains three control points that run from blue to red through green - in the same manner as DefaultLinear.
VolumeRender is configured so that only the first and last control points are allowed to be edited. The middle control point color (that is, v2, v3, v4) components are not editable; instead they are computed from the first and last control point. The values of the middle control point are kept such that the datamap always has a linear ramp from blue to red. The alpha (that is, v1) component of the middle control point is editable. This is allowed so reasonable control over the alpha component of the datamap is obtained.
The minimum and maximum values of the scalar input data, typically obtained through connections to the object GDminmax.
Libraries.Examples.Graphics_Display.ReplaceDatamap
HotMetal is defined with an RGB color model. It contains three data ranges with a combined size of 256. It contains four control points that run from black to red to orange to white. Each data range has two control points. The middle data range shares control points with the ranges on either side.
HotMetal is configured so that all control points are allowed to be edited. The size of the ranges is not editable as it is computed based on the placement of the ranges within the total data range.
The minimum and maximum values of the scalar input data, typically obtained through connections to the object GDminmax.
Libraries.Examples.Graphics_Display.ReplaceDatamap
define a cyan-yellow-red datamap
CyanYellowRed is defined with an RGB color model. It contains two data ranges with a combined size of 256. It contains three control points that run from cyan to yellow to red. Each data range has two control points. The middle control point is shared between the two data ranges.
CyanYellowRed is configured so that all control points are allowed to be edited. The size of the ranges is not editable as it is computed based on the placement of the ranges within the total data range.
The minimum and maximum values of the scalar input data, typically obtained through connections to the object GDminmax.
Libraries.Examples.Graphics_Display.ReplaceDatamap
display an interactive cross-hair cursor
DrawCursor2D displays a 2D cross-hair cursor and translates the cursor's screen coordinates to a field. DrawCursor2D is a macro that combines the following:
- a UItwoPoint interactor
- GDdraw2d_cursor
- a user interface, which the user accesses through the Module Panel provided by the DataViewer or ModuleStack (as appropriate)
The UIrenderView panel where the drawing is to occur. rv is typically connected to the same window as the view.
An optional connection to an object. Without an object, DrawCursor2D converts the selected point to a field in the camera's coordinate system. With an object, DrawCursor2D converts the selected point to a field in the object's coordinate system.
UItoggle. This parameter when set to 1 indicates that immediate mode is on. In immediate mode, DrawCursor2D translates the cursor's position to a field continually during the UItwoPoint interaction. When immed is set to 0, DrawCursor2D translates the cursor's position to a field only at the end of the UItwoPoint interaction.
A mesh representing the point in the appropriate coordinate system.
Libraries.Examples.Graphics_Display.DrawCursor2D
Libraries.Examples.Graphics_Display.ImageProbeDrawLine2D displays a 2D line and translates the line's screen space coordinates into a field. DrawLine2D is a macro that combines the following:
- aUItwoPoint interactor
- GDroi2d_cont
- GDmap2d_ss
- a user interface, which the user accesses through the Module Panel provided by the DataViewer or ModuleStack (as appropriate)
The UIrenderView panel where the drawing is to occur. rv is typically connected to the same window as the view.
An optional connection to an object. Without an object, DrawLine2D converts the line to a field in the camera's coordinate system. With an object, DrawLine2D converts the line to a field in the object's coordinate system.
UIradioBox. This parameter indicates whether to draw in copy mode (0) or XORmode (1). In copy mode, the rendering window is refreshed as necessary with a pre-drawing copy of the window's contents, if possible. In XOR mode, the drawing is created (and subsequently refreshed) by performing an XOR operation on the background. XOR mode is generally faster.
UItoggle. This parameter controls whether the line is immediately converted to a mesh: 1 means yes; 0 means no. When the value is 0, you must press the measure button to cause the line to be converted to a mesh.
UIbutton. This parameter when set causes the line to be converted to a field.
A mesh representing the point in the appropriate coordinate system.
Libraries.Examples.Graphics_Display.DrawLine2D
Libraries.Examples.Graphics_Display.ImageMeasureEditMesh edits the coordinates in 2D unstructured meshes. Typically, the mesh is the output from the ClickSketch or ContinuousSketch modules, but any mesh of the proper type can be edited. EditMesh is a macro that combines the following:
- a reference to a UItwoPoint interactor for providing the XY screen space coordinates to control the edit operation
- GDedit_mesh to actually perform the highlight of the selected primitive, the edit itself and the update of the mesh
- a user interface, which you access through the Module Panel provided by the DataViewer or ModuleStack (as appropriate)
A reference to the UItwoPoint interactor that provides the XY positions and the events that control the edit process. UItwoPoint is typically connected to the two_point output from one of the viewer modules.
UIradioBox. This parameter controls if the point, primitive, or cell is edited when the mesh is selected: 0 means point; 1 means primitive;, and 2 means cell.
UIsliders. Float sliders to set the red/green/blue color while editing the mesh. Values are in the range 0-1.
UIbutton. This parameter when set causes the currently selected point, primitive, or cell to be deleted.
UItoggle. This parameter controls whether the edit causes the mesh to be immediately updated: 1 means yes; 0 means no. When the value is 0, you must press the Done button to cause the edit to update the mesh.
UIbutton. This parameter when set causes the mesh to be updated to reflect the edit. This is used when the immed parameter has a value of 0.
Libraries.Examples.Graphics_Display.EditMesh
Libraries.Examples.Graphics_Display.RegionCrop2D
Libraries.Examples.Graphics_Display.ROIdrawedit the geometry attributes of the Graphics Display Kit properties
GeomAttribPopup defines a dialog box for editing geometry attributes. Geometry attributes are part of the Graphics Display Kit properties.
An integer indicating whether GeomAttribPopup's dialog box should appear: 0 means it should not appear; 1 means it should. Typical ways to make the dialog box appear are to connect the vis subobject to UIcmd.do or UIbutton.do. When the command or button is then pressed, the dialog box becomes visible.
Subobjects indicating geometry attributes. When the dialog box first appears, these objects determine the initial settings of the dialog box's widgets. When you change the widget's settings, GeomAttribPopup in turn updates the subobjects connected to dir_pt_size, subdiv, and cull.
Libraries.Graphics_Display.Editors.UI_Editors.PropsEditor
edit the image attributes of the Graphics Display Kit object
ImageAttrPopup defines a dialog box for editing the image attributes. Image attributes are part of the Graphics Display Kit object.
An integer indicating whether ImageAttrPopup's dialog box should appear: 0 means it should not appear; 1 means it should. Typical ways to make the dialog box appear are to connect the vis subobject to UIcmd.do or UIbutton.do. When the command or button is pressed, the dialog box becomes visible.
Subobjects indicating the image attributes. When the dialog box first appears, these objects determine the initial settings of the dialog box's widgets. When you change the widget's settings, ImageAttrPopup in turn updates the subobjects connected to dith_tech, interp_type, missing_val, missing_red, missing_green, and missing_blue.
Libraries.Graphics_Display.Editors.UI_Editors.ObjectEditor
edit the light attributes of the Graphics Display Kit lights
LightAttribPopup defines a dialog box for editing the light attributes. Light attributes are part of the Graphics Display Kit lights.
An integer indicating whether LightAttribPopup's dialog box should appear: 0 means it should not appear; 1 means it should. Typical ways to make the dialog box appear are to connect the vis subobject to UIcmd.do or UIbutton.do. When the command or button is then pressed, the dialog box becomes visible.
Subobjects indicating light attributes. When the dialog box first appears, these objects determine the initial settings of the dialog box's widgets. When you change the widget's settings, LightAttribPopup in turn updates the subobjects connected to att1, att2, concen, and angle.
Libraries.Graphics_Display.Editors.UI_Editors.LightInfoEditor
edit the Graphics Display Kit light information
macro LightInfoEditor {
GDview_templ+IPort2 &view_in {
GDlight_info_templ &light_info;
};
ilink vis;
GDlinfo_edit GDlinfo_editor {
shell_vis => vis;
light_info => view_in.light_info;
};
GDlight_edit GDlight_editor {
shell_vis => vis;
light => GDlinfo_editor.sel_light;
};
macro LightInfoEditorUI {
UIshell light_info_shell {
title = "Light Info Editor";
visible => vis;
width = 225;
height = 400;
};
...
};
};
LightInfoEditor defines a dialog box to edit the light information subobject of the input view. It contains both a light information edit subobject (GDlinfo_edit), a light edit subobject (GDlight_edit), and a user interface (LightInfoEditorUI).
A view. view_in can be any group with a GDlight_info_templ subobject called light_info.
An integer indicating whether LightInfoEditor's user interface should appear: 0 means no; 1 means yes. Typically, you want the user interface to appear when the user selects a pulldown menu choice (a UIcmd object). To accomplish this, you connect vis to the UIcmd object's do element.
Libraries.Templates.VIEW.Components.ViewEditors
edit the line attributes of the Graphics Display Kit properties
LineAttribPopup defines a dialog box for editing line attributes. Line attributes are part of the Graphics Display Kit properties.
An integer indicating whether LineAttribPopup's dialog box should appear: 0 means it should not appear; 1 means it should. Typical ways to make the dialog box appear are to connect the vis subobject to UIcmd.do or UIbutton.do. When the command or button is pressed, the dialog box becomes visible.
Subobjects indicating line attributes. When the dialog box first appears, these objects determine the initial settings of the dialog box's widgets. When you change the widget's settings, LineAttribPopup in turn updates the subobjects connected to draw_mode, line_width, line_style, and line_aa.
Libraries.Graphics_Display.Editors.UI_Editors.PropsEditor
edit the material attributes of the Graphics Display Kit properties
MaterialPopup defines a dialog box for editing material attributes. Material attributes are part of the Graphics Display Kit properties.
An integer indicating whether MaterialPopup's dialog box should appear: 0 means it should not appear; 1 means it should. Typical ways to make the dialog box appear are to connect the vis subobject to UIcmd.do or UIbutton.do. When the command or button is then pressed, the dialog box becomes visible.
Subobjects indicating material attributes. When the dialog box first appears, these objects determine the initial settings of the dialog box's widgets. When you change the widget's settings, MaterialPopup in turn updates the subobjects connected to ambient, diffuse, spec, spec_exp, and trans.
Libraries.Graphics_Display.Editors.UI_Editors.PropsEditor
edit Graphics Display Kit modes
macro ModesEditor {
GDobject_templ+IPort2 &obj_in {
GDmodes_templ &modes;
};
ilink vis;
GDmodes_edit GDmodes_editor {
shell_vis => vis;
modes => obj_in.modes
};
macro ModesEditorUI {
UIshell modes_shell {
title = "Modes Editor";
visible => vis;
width = 425;
height = 480;
};
...
};
};
ModesEditor defines a dialog box to edit the modes subobject of the input object. It contains both an modes edit subobject (GDmodes_edit) and a user interface (ModesEditorUI).
An object. obj_in can be any group object with a GDmodes_templ subobject called modes.
An integer indicating whether ModesEditor's user interface should appear: 0 means no; 1 means yes. Typically, you want the user interface to appear when the user selects a pulldown menu choice (a UIcmd object). To accomplish this, you connect vis to the UIcmd object's do element.
Libraries.Templates.VIEW.Components.ObjectEditors
define a command list for a viewer's menu bar
ObjCmdList defines the pull-down command list to be placed on a viewer's menu bar. It is used to control the visibility of some of the Graphics Display Kit editors. Typically, you do not use ObjCmdList since it is designed for use by Viewer and Viewer3D. The command list looks like this:
ObjEditors
Object...
Xform...
Props...
Modes...
Texture...
Datamap...ObjCmdList works in conjunction with ObjectEditors which has the same number of editors as there are entries on the menu bar.
The command list, as a UIcmdList object.
The command list, as an array of UIcmd objects.
Libraries.Main.Viewers.Viewer3D
Libraries.Main.Viewers.Viewerdefine a command list for a 2D viewer's menu bar
Obj2DCmdList defines the pull-down command list to be placed on a 2D viewer's menu bar. It is used to control the visibility of some of the Graphics Display Kit editors. Typically, you do not use Obj2DCmdList since it is designed for use by Viewer2D. The command list looks like this:
ObjEditors
Object...
Xform...
Props...
Modes...
Datamap...Obj2DCmdList works in conjunction with Object2DEditors which has the same number of editors as there are entries on the menu bar.
The command list, as a UIcmdList object.
The command list, as an array of UIcmd objects.
Libraries.Main.Viewers.Viewer2D
edit a Graphics Display Kit object
macro ObjectEditor {
GDcamera_templ+IPort2 &camera_in;
GDobject_templ+IPort2 &obj_in;
ilink vis;
GDobj_edit GDobj_edit {
shell_vis => vis;
camera => camera_in
object => obj_in;
};
macro ObjectEditorUI {
UIshell obj_shell {
title = "Object Editor";
visible => vis;
width = 225;
height = 325;
};
...
};
};
ObjectEditor defines a dialog box to edit the input object. It contains both an object edit subobject (GDobject_edit) and a user interface (ObjectEditorUI).
The camera associated with the object being edited. The camera is required for the normalize operation.
The object controlled by the object editor. Typically obj_in is connected to the current object output of the ObjectSelector.
An integer indicating whether CameraEditor's user interface should appear: 0 means no; 1 means yes. Typically, you want the user interface to appear when the user selects a pulldown menu choice (a UIcmd object). To accomplish this, you connect vis to the UIcmd object's do element.
Libraries.Templates.VIEW.Components.ObjectEditors
define a group of editors for a viewer
ObjectEditors defines a group of the Graphics Display Kit editors for a viewer. The visibility of the individual editors is controlled by pulldowns on the menu bar. Typically, you do not use ObjectEditors since it is designed for use by Viewer and Viewer3D. The editors in ObjectEditors are:
ObjectEditors is used in conjunction with ObjCmdList which has the same number of entries on the menu bar as there are editors.
A connection to an object. Typically, the object is connected to the ViewEditor's current object. Alternatively, the object may be connected to the view's picked object.
An array of integers indicating whether the user has selected a pulldown menu choice.
Libraries.Main.Viewers.Viewer3D
Libraries.Main.Viewers.Viewerdefine a group of editors for a 2D viewer
Object2DEditors defines a group of the Graphics Display Kit editors for a 2D viewer. The visibility of the individual editors is controlled by pulldowns on the menu bar. Typically, you do not use Object2DEditors since it is designed for use by Viewer2D. The editors in Object2DEditors are:
Object2DEditors is used in conjunction with Obj2DCmdList which has the same number of entries on the menu bar as there are editors.
A connection to an object. Typically, the object is connected to the View2DEditor's current object. Alternatively, the object may be connected to the view's picked object.
An array of integers indicating whether the user has selected a pulldown menu choice.
Libraries.Main.Viewers.Viewer2D
select an object from a Graphics Display Kit view
macro ObjectSelector{
GDview_templ+IPort2 &view_in;
ilink vis;
GDobj_sel obj_selector{
view => view_in;
};
macro ObjectSelectorUI {
UIselectionBox curobj_sel{
title = "Object Selector";
visible => vis;
};
...
};
olink cur_obj => obj_selector.cur_obj;
};
ObjectSelector defines a dialog box to select a current object in a view. It contains both an object selector subobject (GDobj_sel) and a user interface (ObjectSelectorUI).
A view. The ObjectSelector creates a list of the objects in the view.
An integer indicating whether ObjectSelector's user interface should appear: 0 means no; 1 means yes. Typically, you want the user interface to appear when the user selects a pulldown menu choice (a UIcmd object). To do this, you connect vis to the UIcmd object's do element.
An object. The ObjectSelector outputs the current object. This is either the object selected from the selection box or the object that was picked in the view. This object is normally connected to any of the Graphics Display Kit editors that take an object as input.
Libraries.Templates.VIEW.Components.ViewEditors
edit a Graphics Display Kit output
macro OutputEditor {
GDview_templ+IPort2 &view_in {
GDoutput_templ+OPort2 &output;
};
ilink vis;
macro OutputEditorUI {
UIshell out_shell {
title = "Output Editor";
visible => vis;
width = 225;
height = 425;
};
...
};
};
OutputEditor defines a dialog box to edit the output subobject of the view input. It contains both a view edit subobject (GDview_edit) and a user interface (ViewEditorUI).
A view. OutputEditor edits the outpuf subobject of the input view.
An integer indicating whether OutputEditor's user interface should appear: 0 means no; 1 means yes. Typically, you want the user interface to appear when the user selects a pulldown menu choice (a UIcmd object). To do this, you connect vis to the UIcmd object's do element.
Libraries.Templates.VIEW.Components.ViewEditors
output a field in AVS/Express image format by capturing the contents of the view
GDoutput_templ GDfield_output_templ {
int flip;
int clear;
GDview_buffers+OPort2+write buffers {
framebuffer+nonotify;
zbuffer+nonotify;
};
method+notify_inst init = "GDfield_output_create";
method+notify_del delete = "GDfield_output_delete";
method+notify_val update = "GDfield_output_update";
};
GDfield_output_templ GDfield_output {
Field_Unif+Dim2+Space2+Node_Data+Vector4+OPort2
&output => buffers.framebuffer;
ptr+nonotify+nosave local_ptr;
};
group OutputFieldFuncs {
int type = 1;
func+virtual output_init = "GDoutput_init";
func+virtual output_flush = "GDoutput_flush";
func+virtual output_write = "GDfield_output_write";
func+virtual output_done = "GDoutput_done";
};
GDfield_output DefaultFieldOutput {
type = 1;
flip = 0;
buffers {
fb_type = GD_FB_ARGB;
zb_type = GB_ZB_FLOAT_1NEAR;
};
};
macro OutputField {
GDview_templ &view_in;
...
DefaultFieldOutput Output {
output<NEportLevels={0,3}>;
};
...
};
These objects define field output. GDoutput_templ defines the template for all objects that produce output from a view. GDfield_output_templ defines the template for field output. It adds the subobjects unique to field output and defines the instance, update and delete methods. OutputFieldFuncs defines the virtual methods unique to field output that are called during the render process that produces the field. OutputField is the macro that is meant to be instanced. It contains a user interface that appears in the Module Panel provided by the DataViewer or ModuleStack (as appropriate).
Three different types of output are available from the AVS/Express viewers: file output, field output, and print output. They are derived from a single base group that provides the basic hooks into the rendering pipeline to get output from the view.
OutputField captures the contents of the view and writes it to an AVS/Express field. The format of the field is the same as an AVS/Express image.
A view. The contents of the input view are captured and written to the specified file.
These parameters control the width and height in pixels at which the view is captured.
This parameter controls whether the contents of the view are inverted before being written to the output field.
This parameter controls whether a field is output each time the view is rendered: 0 means no; 1 means yes.
This parameter when set causes a field to be output. This is used when the dynamic parameter is set to a value of 0.
Field_Unif+Dim2+Space2_Node_Data+Vector4. This output is a field in AVS/Express image format.
DefaultObject. This output is a renderable object. It is typically connected to one of the 2D viewers to be rendered.
output an AVS/Express .x file by capturing the contents of the view
GDoutput_templ GDfile_output_templ {
int flip;
string+IPort filename;
method+notify_inst init = "GDfile_output_create";
method+notify_del delete = "GDfile_output_delete";
method+notify_val update = "GDfile_output_update";
};
group OutputFileFuncs {
int type = 1;
func+virtual output_init = "GDoutput_init";
func+virtual output_flush = "GDoutput_flush";
func+virtual output_write = "GDfile_output_write";
func+virtual output_done = "GDoutput_done";
};
These objects define file output. GDoutput_templ defines the template for all objects that produce output from a view. GDfile_output_templ defines the template for file output. It adds the subobjects unique to file output and defines the instance, update, and delete methods. OutputFileFuncs defines the virtual methods unique to file output that are called during the render process that produces the file. OutputFile is the macro that is meant to be instanced. It contains a user interface that appears in the Module Panel provided by the DataViewer or ModuleStack (as appropriate).
Three different types of output are available from the AVS/Express viewers: file output, field output, and print output. They are derived from a single base group that provides the basic hooks into the rendering pipeline to get output from the view.
OutputFile captures the contents of the view as an AVS/Express image and writes it to a file. This could have been done as a post-process on the field output but a separate module eliminates the need to have an extra copy of the data in memory. This is significant if the size of the view being captured is large (for example, 4K by 4K).
A view. The contents of the input view are captured and written to the specified file.
This parameter specifies the name of the output file that is created.
These parameters control the width and height in pixels at which the view is captured.
This parameter controls whether the contents of the view are inverted before being written to the output file.
This parameter controls whether a file is output each time the view is rendered: 0 means no; 1 means yes.
This parameter when set causes a file to be output. This is used when the dynamic parameter is set to a value of 0.
edit Graphics Display Kit properties
macro PropsEditor {
GDobject_templ+IPort2 &obj_in {
GDprops_templ &props;
};
ilink vis;
GDprops_edit GDprops_editor {
shell_vis => vis;
props => obj_in.props
};
macro PropsEditorUI {
UIshell props_shell {
title = "Props Editor";
visible => vis;
width = 225;
height = 230;
};
...
};
};
PropsEditor defines a dialog box to edit the props subobject of the input object. It contains both a props edit subobject (GDprops_edit) and a user interface (PropsEditorUI).
An object. obj_in can be any group object with a GDprops_templ subobject called props.
An integer indicating whether PropsEditor's user interface should appear: 0 means no; 1 means yes. Typically, you want the user interface to appear when the user selects a pulldown menu choice (a UIcmd object). To do this, you connect vis to the UIcmd object's do element.
Libraries.Templates.VIEW.Components.ObjectEditors
define the command list for SimpleViewer
SimpleCmdList defines the Editors pull-down command list for SimpleViewer, SimpleViewer2D, and SimpleViewer3D. Typically you do not use SimpleCmdList, since it is designed specifically for use within SimpleViewer, SimpleViewer2D, and SimpleViewer3D.
The command list looks like this:
Editors
View...
Object Selector...
Object...The command list, as a UIcmdList object. When cmdlist is connected to the command list that represents the menu bar, its items appear on the menu bar.
The command list, as an array of UIcmd objects. The do subobject in each UIcmd is used to control the visibility of the UIshell for the GD editor to which it is connected.
Libraries.Main.Viewers.SimpleViewer
define the editors for SimpleViewer
SimpleEditors defines the editors for SimpleViewer, SimpleViewer2D, and SimpleViewer3D. Typically you do not use SimpleEditors, since it is designed specifically for use within SimpleViewer, SimpleViewer2D, and SimpleViewer3D. The editors include the following:
Each editor includes both the required edit object (for example, GDview_edit) and the UI objects to access the edit object.
A view, typically from the View3D, View2D, or View macros.
The window to be tracked by the track editor. You connect edit_rv to the same window as the view. Typically, this is the UIrenderView from the ViewUI macro.
An array of integers indicating whether the user has selected a pulldown menu choice.
An integer that indicates what type of transformation the TrackEditor is to perform. Valid values are 0 for rotate, 1 for scale, 2 for XY translate, and 3 for Z translate. This is typically connected to the selected output port of the ViewUI macro.
The object selected through the object selector.
Libraries.Main.Viewers.SimpleViewer
define an integrated 2D and 3D viewer with a limited user interface
SimpleViewer defines an integrated 2D and 3D viewer with a limited user interface. It combines the following components:
- a basic user interface (that is, ViewUI)
- entries on the menu bar to control editor visibility (that is, SimpleCmdList)
- a group of editors that includes: view editor, object selector, object editor, and track editor (that is, SimpleEditors)
- basic 2D and 3D view components (that is, View)
One or more objects to be rendered in 3D.
One or more objects to be rendered in 2D.
define a 2D viewer with a limited user interface
SimpleViewer2D defines a 2D viewer with a limited user interface. It combines the following components:
- a basic user interface (that is, ViewUI)
- entries on the menu bar to control editor visibility (that is, SimpleCmdList)
- a group of editors that includes: view editor, object selector, object editor, and track editor (that is, SimpleEditors)
- basic 2D view components (that is, View2D)
One or more objects to be rendered in 2D.
Libraries.Examples.Graphics_Display.RegionCrop3D
Libraries.Examples.Graphics_Display.ImageAnnodefine a 3D viewer with a limited user interface
SimpleViewer3D defines a 3D viewer with a limited user interface. It combines the following components:
- a basic user interface (that is, ViewUI)
- entries on the menu bar to control editor visibility (that is, SimpleCmdList)
- a group of editors that includes: view editor, object selector, object editor, and track editor (that is, SimpleEditors)
- basic 3D view components (that is, View3D)
One or more objects to be rendered in 3D.
Most of the examples in Libraries.Examples.Visualization
edit Graphics Display Kit Datamap
macro StandAloneDatamapEditor {
int int<NEportLevels=1> = 1;
DefaultObject DefaultObject {
dmap<NEportLevels={0x3,0x0}>;
};
DatamapEditor DatamapEditor {
obj_in => <-.DefaultObject;
vis => <-.int;
DatamapEditorUI {
PALvirt {
vclass = 2;
vid =;
gamma = ;
cube_size = 6;
};
};
};
};
StandAloneDatamapEditor defines a shell containing the necessary controls to edit the datamap of a subobject. It contains both a datamap editor subobject (DatamapEdit) and a user interface (DatamapEditorUI).
A datamap. The StandloneDatamapEditor edits the input datamap.
edit the surface conversion attributes of the Graphics Display Kit object
SurfConvPopup defines a dialog box for editing the surface conversion attributes. Surface conversion attributes are part of the Graphics Display Kit object.
An integer indicating whether SurfConvPopup's dialog box should appear: 0 means it should not appear; 1 means it should. Typical ways to make the dialog box appear are to connect the vis subobject to UIcmd.do or UIbutton.do. When the command or button is pressed, the dialog box becomes visible.
Subobjects indicating the surface conversion attributes. When the dialog box first appears, these objects determine the initial settings of the dialog box's widgets. When you change the widget's settings, SufcConvPopup in turn updates the subobjects connected to surf_conv, chunk, surf_chunk, line_chunk, tmap_method, tri_subdiv_type, tri_subdiv_aval, and tri_subdiv, and fval.
Libraries.Graphics_Display.Editors.UI_Editors.ObjectEditor
edit a Graphics Display Kit texture
macro TextureEditor {
GDobject_templ+IPort2 &obj_in {
GDtexture_templ &texture;
};
ilink vis;
GDtexture_edit GDtexture_editor {
shell_vis => vis;
texture => obj_in.texture
};
macro TextureEditorUI {
UIshell texture_shell {
title = "Texture Editor";
visible => vis;
width = 225;
height = 475;
};
...
};
};
TextureEditor defines a dialog box to edit the texture subobject of the input object. It contains both a texture edit subobject (GDtexture_edit) and a user interface (TextureEditorUI).
An object. obj_in can be any group object with a GDtexture_templ subobject called texture.
An integer indicating whether TextureEditor's user interface should appear: 0 means no; 1 means yes. Typically, you want the user interface to appear when the user selects a pulldown menu choice (a UIcmd object). To do this, you connect vis to the UIcmd object's do element.
Libraries.Templates.VIEW.Components.ObjectEditors
edit a Graphics Display Kit transform using the virtual trackball editor
The virtual trackball editor takes in screen space XY coordinates produced from UItwoPoint interactors, a view, a camera and an object and produces a transformation matrix that rotates, scales, or translates the input object. It combines:
- A pair of UItwoPoint and GDtrack_edit modules. This allows the editor to perform all possible transformations with a single gesture.
- Three pairs of UItwoPoint interactors and GDtrack_edit modules. These are accelerators and are available on systems that have 3-button mouses. This allows the editor to perform the following transformations, each with a unique gesture:
- A user interface which is accessed through a pulldown on the menu bar in some of the Graphics Display Kit viewers.
A connection to a camera. Typically camera_in is connected to the view's picked camera.
A connection to an object. Typically, you connect obj_in to the current object from an object selector. Alternatively, you can connect the object to the view's picked object.
The window to be tracked by the track editor. track_rv is typically connected to the same window as the view.
An integer indicating whether TrackEditor's user interface should appear: 0 means no; 1 means yes. Typically, you want the user interface to appear when the user selects a pulldown menu choice (a UIcmd object). To do this, you connect vis to the UIcmd object's do element.
An integer indicating which type of transformation the first pair of UItwoPoint and GDtrack_edit modules are to perform. Typically, this is connected to the selected output of the ViewUI macro. This allows the selection of the transformation to be controlled from a viewer's user interface.
Libraries.Templates.VIEW.Components.ViewEditors
Libraries.Templates.VIEW.Components.SimpleEditorsconvert a vector ROI to a raster mask
macro Vector2Raster {
ilink in_field;
GDobject_templ &object<NEportLevels={2,1}>;
...
GDvector2raster GDvector2raster {
input => in_field;
obj_in => object;
output+OPort3;
};
DataObject DataObject {
in => GDvector2raster.output;
obj+OPort3;
};
};
Vector2Raster takes a mesh that represents a vector region(s) of interest (ROIs) and converts it to a raster mask with values of either 0 or 255. This raster mask can then be used as input to many of the image procesing routines.
Vector2Raster also provides a user interface that appears in the Module Panel provided by the DataViewer or ModuleStack (as appropriate) and produces a renderable object as output.
Mesh. The input mesh to converted to a raster mask.
GDobject_templ. An optional Graphics Display Kit object whose extents are used to set the extents of the ouput field. If the input does not exist, the extents of the output field are simply the extents of the input mesh.
This parameter controls if the area inside or outside the region(s) in the input mesh has a 0 or 255 value in the output field.
A value of 1 means the areas inside the mesh are set to 255 and the areas outside the mesh are set to 0 in the output field.
A value of 0 means the areas inside the mesh are set to 0 and the areas outside the mesh are set to 255 in the output field.
A string that can be used to filter the region(s) found in the input mesh If the name is null, all regions are processed. If the name has a value, only those regions that have the same name are processed.
Field_Unif+Dim2+Space2. The output scalar image that is created from the region(s) in the input mesh.
A renderable object that can be connected to a viewer for display.
Libraries.Examples.Graphics_Display.ROIdraw
define the basic components for rendering objects in 2D and3D
View defines the basic components for rendering Graphics Display Kit objects in 2D and 3D. View has the following subobjects:
- DefaultView
- BestVirtPal
- DefaultCamera3D and DefaultXform
- DefaultCamera2D and DefaultXform
- DefaultLightInfo and four pairs of DefaultLight and DefaultXform
- GroupObject to provide a Top3D object in the hierarchy
- GroupObject to provide a Top2D object in the hierarchy
- DefaultPickCtrl and UItwoPoint to provide picking in the view
The UIrenderView which serves as the parent window for the viewer.
One or more objects to be rendered in 3D.
One or more objects to be rendered in 2D.
The view's UItwoPoint interactor.
define the basic components for rendering objects in 2D
View2D defines the basic components for rendering Graphics Display Kit objects in 2D. View2D has the following subobjects:
- DefaultView
- BestVirtPal
- DefaultCamera2D and DefaultXform
- GroupObject to provide a Top object in the hierarchy
- DefaultPickCtrl and UItwoPoint to provide picking in the view
The UIrenderView which serves as the parent window for the viewer.
One or more objects to be rendered in 2D.
The view's UItwoPoint interactor.
Libraries.Main.Viewers.Viewer2D
define the basic components for rendering objects in 3D
View3D defines the basic components for rendering Graphics Display Kit objects in 3D. View3D has the following subobjects:
- DefaultView
- BestVirtPal
- DefaultCamera3D and DefaultXform
- DefaultLightInfo and four pairs of DefaultLight and DefaultXform
- GroupObject to provide a Top object in the hierarchy
- DefaultPickCtrl and UItwoPoint to provide picking in the view
The UIrenderView which serves as the parent window for the viewer.
One or more objects to be rendered in 3D.
The view's UItwoPoint interactor.
Libraries.Main.Viewers.Viewer3D
define a command list for a viewer's menu bar
ViewCmdList defines the pull-down command list to be placed on a viewer's menu bar. It is used to control the visibility of some of the Graphics Display Kit editors. Typically, you do not use ViewCmdList since it is designed for use by Viewer and Viewer3D. The command list looks like this:
ViewjEditors
View...
ObjectSelector...
Lights...
Camera...
Interactor...ViewCmdList works in conjunction with ViewEditors which has the same number of editors as there are entries on the menu bar.
The command list, as a UIcmdList object.
The command list, as an array of UIcmd objects.
Libraries.Main.Viewers.Viewer3D
Libraries.Main.Viewers.Viewerdefine a command list for a 2D viewer's menu bar
View2DCmdList defines the pull-down command list to be placed on a 2D viewer's menu bar. It is used to control the visibility of some of the Graphics Display Kit editors. Typically, you do not use ViewCmdList since it is designed for use by Viewer2D. The command list looks like this:
ViewEditors
View...
ObjectSelector...
Camera...
Interactor...View2DCmdList works in conjunction with View2DEditors which has the same number of editors as there are entries on the menu bar.
The command list, as a UIcmdList object.
The command list, as an array of UIcmd objects.
Libraries.Main.Viewers.Viewer2D
edit a Graphics Display Kit view
macro ViewEditor {
GDview_templ+IPort2 &view_in;
ilink vis;
GDview_edit view_edit {
shell_vis => vis;
view => view_in;
};
macro ViewEditorUI {
UIshell view_shell {
title = "View Editor";
visible => vis;
width = 225;
height = 450;
};
...
};
};
ViewEditor defines a dialog box to edit the view input. It contains both a view edit subobject (GDview_edit) and a user interface (ViewEditorUI).
A view. ViewEditor edits the input view.
An integer indicating whether ViewEditor's user interface should appear: 0 means no; 1 means yes. Typically, you want the user interface to appear when the user selects a pulldown menu choice (a UIcmd object). To do this, you connect vis to the UIcmd object's do element.
Libraries.Templates.VIEW.Components.ViewEditors
define a group of editors for a viewer
ViewEditors defines a group of the Graphics Display Kit editors for a viewer. The visibility of the individual editors is controlled by pulldowns on the menu bar. Typically, you do not use ViewEditors since it is designed for use by Viewer and Viewer3D. The editors in ViewEditors are:
- View editor
- Object selector
- Light-information and lights editor
- Camera editor
- Object interactor (track editor)
ViewEditors is used in conjunction with ViewCmdList which has the same number of entries on the menu bar as there are editors.
The window to be interacted with by the track editor. edit_rv is typically connected to the same window as the view.
An array of integers indicating whether the user has selected a pulldown menu choice.
An integer that indicates what type of transformation the TrackEditor is to perform. Valid values are 0 for rotate, 1 for scale, 2 for XY translate, and 3 for Z translate. This is typically connected to the selected output port of the ViewUI macro.
The object selected through the object selector.
Libraries.Main.Viewers.Viewer3D
Libraries.Main.Viewers.Viewerdefine a group of editors for a viewer
View2DEditors defines a group of the Graphics Display Kit editors for a viewer. The visibility of the individual editors is controlled by pulldowns on the menu bar. Typically, you do not use View2DEditors since it is designed for use by Viewer2D. The editors in View2DEditors are:
View2DEditors is used in conjunction with View2DCmdList which has the same number of entries on the menu bar as there are editors.
The window to be interacted with by the track editor. edit_rv is typically connected to the same window as the view.
An array of integers indicating whether the user has selected a pulldown menu choice.
An integer that indicates what type of transformation the TrackEditor is to perform. Valid values are 0 for rotate, 1 for scale, 2 for XY translate, and 3 for Z translate. This is typically connected to the selected output port of the ViewUI macro.
The object selected through the object selector.
Libraries.Main.Viewers.Viewer2D
define an intergrated 2D and 3D viewer with a full user interface
Viewer defines an integrated 2D and 3D viewer with a full user interface. It combines the following components:
- a basic user interface (that is, ViewUI)
- two entries on the menu bar to control editor visibility (that is, ViewCmdList and ObjCmdList)
- two groups of editors that include all editors (that is, ViewEditors and ObjectEditors)
- basic 3D view components (that is, View)
One or more objects to be rendered in 3D.
One or more objects to be rendered in 2D.
Input framebuffer and Z buffer information.
Output framebuffer and Z buffer information.
define a 2D viewer with a full user interface
Viewer2D defines a 2D viewer with a full user interface. It combines the following components:
- a basic user interface (that is, ViewUI)
- two entries on the menu bar to control editor visibility (that is, View2DCmdList and Obj2DCmdList)
- two groups of editors that include all editors needed for 2D(that is, View2DEditors and Object2DEditors)
- basic 3D view components (that is, View2D)
One or more objects to be rendered in 2D.
Input framebuffer and Z buffer information.
Output framebuffer and Z buffer information.
Libraries.Examples.Graphics_Display.vpalRamp
define a 3D viewer with a full user interface
Viewer3D defines a 3D viewer with a full user interface. It combines the following components:
- a basic user interface (that is, ViewUI)
- two entries on the menu bar to control editor visibility (that is, ViewCmdList and ObjCmdList)
- two groups of editors that include all editors (that is, ViewEditors and ObjectEditors)
- basic 3D view components (that is, View3D)
One or more objects to be rendered in 3D.
Input framebuffer and Z buffer information.
Output framebuffer and Z buffer information.
Libraries.Examples.Graphics_Display.ReplaceDatamap
define a basic user interface for a viewer
ViewUI defines a basic user interface for a viewer. It consists of a UIcmdList, a UIshell, a UIpanel, a UIrenderView, a UIlabel, and a UIoptionMenu. The command list that contains no entries is the menu bar. The label displays the name of the currently selected object at the bottom of the window. The option menu displays the types of transformations that can be done by the left mouse button.
The width and height of the render view are tied to the panel so when the panel is resized the render view is also. The render view serves as the parent window for the viewer.
The window's name. The default is Shell.
Zero or more commands for the window's main menu.
The name of the currently selected object. This is typically connected to the curobj_name subobject of the ObjectSelector.
The UIshell created by ViewUI.
The UIpanel created by ViewUI.
The UIrenderView created by ViewUI. This output is often connected to the view subobject of UIonePoint and UItwoPoint interactors.
The UIwinHandle subobject from the UIrenderView created by ViewUI. This output is connected to the handle subobject of GDview. It provides the necessary hook for the Graphics Display Kit to obtain information about the parent window for the viewer.
An integer that indicates what type of transformation has been selected from the option menu. This is connected to the selectedItem subobject of the UIoptionMenu. It provides the necessary information for the TrackEditor to have one GDtrack_edit module perform all possible transformations.
Libraries.Main.Viewers.Viewer3D
edit a Graphics Display Kit transform
macro XformEditor {
group+IPort2 &obj_in {
GDxform_templ &xform;
};
ilink vis;
GDxform_edit GDxform_editor {
shell_vis => vis;
xform => obj_in.xform
};
macro XformEditorUI {
UIshell trans_shell {
title = "Transformation Editor";
visible => vis;
width = 475;
height = 412;
};
...
};
};
XformEditor defines a dialog box to edit the xform subobject of the input object. It contains both an xform edit subobject (GDxform_edit) and a user interface (XformEditorUI).
An object, camera, or light. obj_in can be any group object with a GDxform_templ subobject called xform.
An integer indicating whether XformEditor's user interface should appear: 0 means no; 1 means yes. Typically, you want the user interface to appear when the user selects a pulldown menu choice (a UIcmd object). To do this, you connect vis to the UIcmd object's do element.
![]() |
![]() |
![]() |
![]() |
![]() |
Copyright © 2001 Advanced Visual Systems
Inc.
All rights reserved.