GDview_edit


Synopsis

define an editor for a Graphics Display Kit view

GDview_edit_notify_templ


group  GDview_edit_notify_templ
{
enum  renderer { choices = {"Software", "OpenGL", "XGL", "PEX", "XIL",
"Print", "VRML"}; }:
int  accel;
enum  buffer { choices = {"Single", "Double (MBX)", "Double (Pixmap)"};
};
int timer;
enum mode { choices = {"Manual", "Automatic"}: };
int pcache;
int  refresh;
float red;
float green;
float blue;
int output_enabled;
enum aspect { choices = {"Biggest", "Smallest"}; };
int stereo;
int video;
float stereo_distance;
float stereo_angle;
int video_off;
};

 

GDview_edit_templ


GDview_edit_notify_templ  GDview_edit_templ
{
int  shell_vis;
int reset;
GDview_templ+IPort2  *view;
method+notify_inst+notify_val upd_func = "GDview_edit_update";
};

 

GDview_edit


GDview_edit_templ  GDview_edit;

 

Description

These templates define an editor for the Graphics Display Kit view. GDview_edit_notify_templ and GDview_edit_templ define the elements that cause the view editor's method to execute. GDview_edit is the version you instance.

As an alternative to using GDview_edit and having to define your own user interface for the editor, you can use ViewEditor, an application component. ViewEditor contains GDview_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 view to which the editor is attached 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 view to which the editor is attached 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;

view

The view controlled by the editor. view is a connection to an object that matches type GDview_templ.

Parameters

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

 

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

 

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 frames per second is printed out in the terminal window where you started AVS/Express on completion of a track roll sequence: 0 disables the timer; 1 enables the timer. This is useful in timing the performance of various graphics adapters.

mode

The 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

 

pcache

This parameter is only applicable when using the XGL renderer on SunOS5 systems.

refresh

When this parameter is set, the view is refreshed. This parameter can be used in conjunction with the mode parameter 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 to manual update, the view is only refreshed when this parameter is set.

red
green
blue

These parameters control the background RGB color display in the view.

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.

aspect

This parameter controls how normalization is performed. Normalization may be done in two different ways: one, the objects in the view are fit to the view's biggest side and two, 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

 

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.

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: