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"}; };
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 &virtpal;
method+notify_val pal_func = "GDview_update_virtpal";
};

 

GDview_pick_templ



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


GDview_win_templ


group  GDview_win_templ
{
UIwinHandle+IPort2 &handle;
method+notify_val win_func = "GDview_event";
};


 

GDview_notify_templ


GDview_render_templ GDview_notify_templ {
int update;
int+nonotify list_update;
int refresh;
enum renderer { choices = {"Software", "OpenGL", "XGL", "PEX", "XIL",
"Print", "VRML"}; };
enum mode { choices = {"Manual", "Automatic"}; };
enum buffer { choices = {"Single", Double (MBX)", "Double (Pixmap)"}; };
int accel;
int timer;
int pcache;
enum aspect { choices = {"Biggest", "Smallest"}; };
float back_col[3];
int stereo;
int video;
float stereo_distance;
float stereo_angle;
int video_off;
GDlight_info_templ+IPort2 &light_info;
int ncams;
GDcamera_templ+IPort2 &cameras[];
GDview_buffers+IPort2+read &buffers;
GDoutput_templ+IPort2+read &output {
GDview_buffers+opt+write &buffers {
framebuffer+nonotify;
zbuffer+nonotify;
};
};
int ts_enable;
int ts_scale;
float tx_xorig;
float ts_yorig;
int+write+nonotify trigger;
ptr+nonotify+write local_ptr;
method+notify_inst init_func() = "GDview_init";
method+notify_val upd_func = "GDview_update";
method+notify_deinst del_func = "GDview_delete";
};

 

GDview_templ


GDview_notify_templ+GDview_win_templ+GDview_virtpal_templ+
GDview_pick_templ+OPort  GDview_templ
{
int output_enabled;
GDcamera_templ+OPort2+nosave  &picked_camera;
GDobject_templ+OPort2+nosave  &picked_obj;
int cur_light;
int selected;
int frames;
float seconds;
float fps;
};

 

GDview


GDview_templ  GDview
<NEiconName="binocs"> {
ncams => array_size(cameras);
};


 

DefaultView



GDview  DefaultView
{
renderer = GD_SWX_RENDERER;
accel = GD_VIEW_NOT_ACCEL;
mode = GD_VIEW_AUTO_UPDATE;
buffer = GD_VIEW_DB_PIXMAP;
clear = 1;
timer = 0;
pcache = 0;
aspect = GD_VIEW_ASPECT_SMALLEST;
back_col = {0.0,0.0,0.0};
output_enabled = 0;
ts_enable = 0;
ts_scale = 25000;
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: