TOC PREV NEXT INDEX

DefaultView

Synopsis

define the Graphics Display Kit view

GDview_render_templ

group GDview_render_templ {
enum renderer {
choices = { "Software", "OpenGL", "XGL", "PEX",
"XIL", "Print", "VRML", "VPS" };
};
func+virtual view_available;
func+virtual state_create;
func+virtual prim_3d_points;
func+virtual geom_init;
};

GDview_virtpal_templ

group GDview_virtpal_templ {
PALvirt_notify_templ+IPort2+read &virtpal;
method+notify_val pal_func = "GDview_update_virtpal";
};

GDview_pick_templ

group GDview_pick_templ {
GDpick_ctrl_templ+IPort2+read &pick_ctrl;
method+notify_val pick_func = "GDview_pick";
};

GDview_win_templ

group GDview_win_templ {
UIwinHandle+IPort2+read &handle {
// if we don't have a valid widget in the handle, use the display
// instead to get the display pointer
ptr+opt display;
};
method+notify_val win_func<immediate=1> = "GDview_event";
};

GDview_notify_templ

GDview_render_templ GDview_notify_templ {
int+read update;
int+nonotify list_update;
int refresh;
enum mode {
choices = {"Manual", "Automatic"};
};
enum buffer {
choices = {"Single", "Double (MBX)", "Double (Pixmap)"};
};
int accel;
int clear;
int+nonotify timer;
int pcache;
enum aspect {
choices = {"Biggest", "Smallest"};
};
float back_col<animate=1>[3];
int stereo;
int stereo_enable;
int video;
float stereo_balance;
float stereo_offset;
int video_off;
GDlight_info_templ+IPort2+read &light_info;
/* array of cameras to render */
int ncams;
GDcamera_templ+IPort2+read+nonotify &cameras[];
GDview_buffers+IPort2+read &buffers;
GDoutput_templ+IPort2+read &output {
GDview_buffers+opt+noread+write &buffers {
framebuffer+nonotify;
zbuffer+nonotify;
};
};

GDview_templ

GDview_notify_templ+GDview_win_templ+GDview_virtpal_templ+GDview_pick_templ+OPort GDview_templ<NEcolor0=0xff00ff> {
int output_enabled;
int config_flags;
int full_view_width;
int full_view_height;
/* picked camera and object */
GDcamera_templ+OPort2+nosave+write &picked_camera;
GDobject_templ+OPort2+nosave+write &picked_obj;
int cur_light;
int selected;
/* Timer Information: frames rendered, time in
seconds frames per second.*/
int frames;
float seconds;
float fps;
};

GDview

GDview_templ GDview<NEsmallPixmapName="binocs.bmx",
// this property is necessary to allow us to separate
// components during the compile operation. This object
// is referenced programmatically in the code of this object
need_objs="PALvirt_notify_templ", cxx_name="GDXview"> {
ncams => array_size(cameras);
};

DefaultView

GDview DefaultView {
renderer = GD_SWX_RENDERER;
accel = GD_VIEW_NOT_ACCEL;
mode = GD_VIEW_AUTO_UPDATE;
#ifdef MSDOS
buffer = GD_VIEW_DB_MBX; /* just means double buffer */
#else
buffer = GD_VIEW_DB_PIXMAP;
#endif
clear = 1;
timer = 0;
pcache = 0;
aspect = GD_VIEW_ASPECT_SMALLEST;
back_col = {0.0, 0.0, 0.0};
stereo = 0;
stereo_enable = 0;
video = 0;
stereo_balance = GD_DEFAULT_STEREO_BALANCE;
stereo_offset = GD_DEFAULT_STEREO_OFFSET;
video_off = 0;
full_view_width = 1280;
full_view_height = 1024;
output_enabled = 0;
config_flags = 0;
blend_mode = GD_DEFAULT_BLEND_MODE;
ts_enable = 0;
ts_uniform = 1;
ts_scale = 25000.0;
ts_yscale = 25000.0;
ts_xorig = 0.0;
ts_yorig = 0.0;
};

Description

These templates define a Graphics Display Kit view. GDview_notify_templ defines the elements that cause the view's update method to execute. In addition to the view's update method, there are also methods that execute when the UIwinHandle (that is, windowing system events), PALvirt (that is, virtual palette resource changes), and GDpick_ctrl (that is, picking) change. GDview defines an instanceable version without default values. DefaultView defines an instanceable version with default values.

Input Ports

light_info

The view's light information. light_info is a connection to an object matching type GDlight_info_templ. The light information controls the ambient lighting and the number and types of light sources to be used in the view.

buffers

The view's input buffers. buffers is a connection to an object matching type GDview_buffers. It can provide a framebuffer and Z buffer for the view to use. At the start of the render process, any input framebuffer and Z buffer are copied to the view's internal framebuffer and Z buffer. For more information about framebuffer/Z-buffer I/O, see Section 6.49, GDview_buffers_ [page_6-172].

handle

The view's window handle. handle is a connection to an object matching type UIwinHandle. Typically, this is the UIwinHandle in a UIrenderView. It provides a window for the view to use. Both UIwinHandle and PALvirt need to be connected to the view before the window for rendering can be created.

virtpal

The view's virtual palette. The virtual palette controls the type and amount of color resource requested and used by the view.

output

The view's optional output. output is a connection to an object matching type GDoutput_templ. The output controls file, field, and print output from the view.

pick_ctrl

The view's pick control information. pick_ctrl is a connection to an object matching type GDpick_ctrl_templ. pick_ctrl is typically connected to a UI interactor. When pick_ctrl changes, it causes the view's pick method to execute.

cameras

The view's cameras. cameras is an array of connections to objects matching type GDcamera_templ.

Parameters

update

This parameter is used by the Graphics Display Kit cameras and objects in the view to notify the view that it needs to be re-rendered.

refresh

When this parameter is set, the view is refreshed. This parameter can be used in conjunction with the mode parameter (see below) to control when the view gets rerendered. The default behavior is to have the view rerender when anything in it changes. However, by setting the mode parameter properly, the view is only refreshed when this parameter is set.

renderer

This parameter controls the type of renderer. Note that the print renderer (that is, GD_PRT_RENDERER) is not meant to be used interactively but instead with the PrintViewer.
Value
Meaning
Symbolic constant
0
Software renderer
GD_SWX_RENDERER
1
OpenGL renderer
GD_GL_RENDERER
2
XGL renderer
GD_XGL_RENDERER
3
PEX renderer
GD_PEX_RENDERER
4
XIL renderer
GD_XIL_RENDERER
5
PRT renderer
GD_PRT_RENDERER
6
VRML renderer
GD_VRML_RENDERER
7
VPS renderer
GD_VPS_RENDERER

mode

This parameter controls the view's update mode:
Value
Meaning
Symbolic constant
0
Update the view only when the view's refresh parameter has been set
GD_VIEW_MANUAL_UPDATE
1
Update the view automatically
GD_VIEW_AUTO_UPDATE

buffer

This parameter controls whether objects in the view are rendered using single buffering (that is, drawn directly to the screen) or double buffering (that is, drawn first off-screen, then copied to the screen).
Value
Meaning
Symbolic constant
0
Single buffering
GD_VIEW_SINGLE_BUFFER
1
MBX double buffering
GD_VIEW_DB_MBX
2
Pixmap double buffering
GD_VIEW_DB_PIXMAP
The two different double buffer modes are only valid for the software renderer. The hardware renderers -- OpenGL, XGL and PEX -- treat the value as a double buffer disabled/enabled flag.In the software renderer, 2D cameras can be rendered using any buffer mode. However, 3D cameras are inherently double buffered since the objects in them are rendered to an offscreen frame buffer and then converted and copied to the screen.

timer

This parameter controls if timing information is calculated on completion of a track roll sequence. This is useful in timing the performance of various graphics adapters. A value of 0 disables the timer and a value of 1 enables the timer. When timer is set to 1, the following subobjects are updated with the timing information: fps (frame per second), seconds and frames.

pcache

This parameter is only applicable when using the XGL renderer on SunOS5 systems. For details see the System Prerequisites.

aspect

This parameter controls how normalization is performed. Normalization may be done in two different ways: either the objects in the view are fit to the view's largest side, or the objects in the view are fit to the view's smallest side.
Value
Meaning
Symbolic constant
0
Objects fit to view's biggest side.
GD_VIEW_ASPECT_BIGGEST
1
Objects fit to the view's smallest side (default).
GD_VIEW_ASPECT_SMALLEST

back_col

This parameter controls the background RGB color display in the view.

stereo

This parameter controls whether a stereo image is rendered. A value of 0 means off and a value of 1 means on. Refer to the system prerequisite information in the Installing AVS/Express book for information regarding which hardware platforms support stereo.

video

This parameter controls whether the stereo image is rendered in "full-screen" mode using the "SGIFullScreenStereo" X extension. This in only active on SGI systems when quad-buffering support is not available. Refer to the system prerequisite information in the Installing AVS/Express book for further details.

stereo distance

This parameter controls the eye translation along the X axis part of the stereo view projection. shift = (distance - 1.0) * (angle / distance).

stereo angle

This parameter controls the eye separation angle part of the stereo view projection. The formula is: shift = (distance - 1.0) * (angle / distance). This is only fully implemented on SGI systems. Refer to the system prerequisite information in the Installing AVS/Express book for further details.

config flags

This parameter is set internally to register the capablility of display devices according to framebuffer type, operating system, graphics library, etc. See the GD_VIE_CONFIG_XXX statements in gd_def.h for the current list of flags and their meaning.

ncams

The number of cameras connected to the view. ncams is updated automatically.

accel

This parameter controls whether view rendering is accelerated. If the view is accelerated, objects that are set as static (see the type parameter in and ) are rendered in a separate pass and the image and Z-buffer information for that pass are saved. As long as the static objects in the view do not change, the saved buffers can be restored to start the rendering process. Only the dynamic objects are then rendered. Accelerate mode is useful for moving simple objects around a complex scene. For example, probing a complex geometry or moving some symbols around a complex map.
Value
Meaning
Symbolic constant
0
Rendering is not accelerated
GD_VIEW_NOT_ACCEL
1
Rendering is accelerated
GD_VIEW_ACCEL

clear

This parameter controls whether the view is cleared prior to rendering. A value of 1 causes the view to be cleared. A value of 0 causes the previous view contents to be left.

output_enabled

This parameter controls whether output from the view is enabled when there is a connection to the output subobject. A value of 0 means that output from the view is disabled. A value of 1 means that output from the view is enabled.

ts_enable

This parameter controls whether true scale display is enabled. When true scale display is enabled, the objects rendered in the view are displayed at a map scale as controlled by the ts_scale, ts_xorig and ts_yorig parameters. All coordinate values are treated as meters when true scale is enabled. By default true scale is disabled.There are two limitations or warnings in the use of true scale display: 2D hardcopy output from 3D cameras cannot be properly measured. Scaling of objects meant to be displayed at the specified map scale must not themselves be scaled or they cannot be measured properly in the hardcopy output.

ts_scale

This parameter sets a map scale when true scale display is enabled. A map's scale is a ratio that relates a unit of measure (centimeters) on a map to some number of units (meters) on the earth's surface. For instance, a map scale of 1:25000 means that 1 centimeter on the map represents 25,000 meters on the earth's surface. This allows distance to be measured on hardcopy output from a view. The default map scale is 1:25000.

ts_xorig

This parameter sets the X origin of the lower left of the view window in meters. By default the X origin is 0.0.

ts_yorig

This parameter sets the Y origin of the lower left of the view window in meters. By default the Y origin is 0.0.

trigger

This parameter is set to 1 after the rendering of the view is complete. It is useful for other modules that are interested in knowing when the renderer finishes executing.

Output Port

picked_camera

A connection to the camera that the user has picked, if any. picked_camera is updated automatically when the user selects a camera's viewport with the mouse. If several cameras occupy the selected point, the Graphics Display Kit picks one of the cameras. If the user selects the overlapping cameras repeatedly, the Graphics Display Kit picks a different camera each time.

picked_obj

A connection to the graphics-display object that the user has picked, if any. picked_obj is updated automatically.

Example

Libraries.Graphics_Display.Views.View3D

File

v/gd.v

See also related modules

Not Applicable.

TOC PREV NEXT INDEX