GDobj_edit


Synopsis

define an editor for a Graphics Display Kit object

GDobj_edit_notify_templ


group GDobj_edit_notify_templ
{
int  visible;
int pickable;
int  cached;
int cache_size;
enum surf_conv { choices = {"Simple", "Optimal"}; };
int chunk;
int surf_chunk;
int line_chunk;
int surf_subdiv;
enum  type { choices = {"Static", "Dynamic"}; };
enum dith_tech { choices = {"Cube", "Ramp"}; };
emum interp_type { choices = {"Point", "Bilinear", "Bicubic"}; };
int tmap_method;
int tri_subdiv_type;
int tri_subdiv_aval;
int tri_subdiv_fval;
float missing_val;
float missing_red;
float missing_green;
float missing_blue;
enum xform_mode {choices = {"Normal", "Parent", "Alternate", "Locked"}; };
int  reset;
int  normalize;
int  center;
int use_altobj;
enum space { choices = {"Match Camera", "Force 2D"}; };
};

 

GDobj_edit_templ


GDobj_edit_notify_templ  GDobj_edit_templ
{
int+IPort2 shell_vis;
GDcamera_templ+IPort2  *camera;
GDobject_templ+IPort2  *object;
method+notify_inst+notify_val upd_func = "GDobj_edit_update";
};

 

GDobj_templ


GDobj_edit_templ GDobj_edit;

 

Description

These templates define an editor for the Graphics Display Kit object. GDobject_edit_notify_templ and GDobject_edit_templ define the elements that cause the object editor's method to execute. GDobject_edit is the version you instance.

As an alternative to using GDobject_edit and having to define your own user interface for the editor, you can use ObjectEditor, an application component. ObjectEditor contains GDobject_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 object 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 object 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;

camera

The camera connected to the object editor. camera is a connection to an object that matches type GDobject_templ. The camera is needed in order to perform normalization.

object

The Graphics Display Kit object controlled by the object editor. object is a connection to an object that matches type GDobject_templ.

Parameters

visible

This parameter controls whether the object is visible: 0 means no; 1 means yes. When the object is not visible, all its children objects are also not visible.

pickable

This parameter controls whether the object is pickable: 0 means no; 1 means yes. When the object is not pickable, all its children objects are also not pickable.

cached

This parameter controls whether the Graphics Display Kit should cache the object's data: 0 means it should not; 1 means it should. The cache is a geometrical representation of the data being rendered. The cache is renderer- specific. If an object is rendered in multiple views with different renderers enabled, there are multiple caches. You should keep this is mind, particularly if the data being rendered is large.

cache_size

This parameter specifies the maximum allowable size of the geometrical cache in megabytes. The default cache size for each object is 8 megabytes. When the object is rendered, a calculation is performed to determine if the object will generate enough geometry to overflow the cache. If it will, the cache is automatically disabled before the rendering process begins. This allows the Graphics Display Kit to render large objects without consuming all the available memory.

surf_conv

This subobject controls how a surface is converted to a triangle strip.The feature is supported when the cell type is either triangle, quad, or polyhedron. There are two different types of surface conversion:

•      simple

A value of 0 means the simple conversion should be used. In simple surface conversion, a triangle strip is constructed by adding zero-area triangles. In a typical case, 10,000 triangles are converted into a triangle strip that has 60,000 triangles in the strip.

•      optimal

A value of 1 means the optimal conversion should be used. In the optimal case, the list of of cells is rearranged into a triangle strip that is a more efficient representation of the surface. In a typical case, 10,000 triangles turn into a triangle strip that is 20,000 long. Note that the optimization provided by the optimal conversion depends on the existence of shared nodes in the input field. While the triangle strip may be considerably shorter when using the optimal surface conversion, this manner of surface conversion takes extra time and memory. The amount of temporary storage that is used by the optimal conversion can roughly be calculated by multiplying the number of triangles by 240. The number that you get is the number of bytes. For example, if you have 10,000 triangles, the temporary storage requirements are 2,400,000 bytes or about 2.3 Mbytes.

Optimal surface conversion is faster with smaller chunk sizes. It is worth experimenting with these controls to determine the configuration that provides the best speed/memory tradeoff for the data sets that you are trying to render.

chunk

This parameter controls whether chunking is enabled: 0 means disable; 1 means enabled. Chunking is provided as a way for you to control the temporary storage utilization during surface conversion. If chunking is disabled, the whole surface is converted at once. If chunking is enabled, the surface is converted in chunks as specified by the surface and line chunk sizes. The size is the number of primitives to convert at a time.

surf_chunk

This parameter controls the number of cells to process at once when chunking is enabled and a surface rendering mode is selected.

line_chunk

This parameter controls the number of cells to process at once when chunking is enabled and a line rendering mode is selected.

surf_subdiv

This parameter controls whether quad cells are subdivided and to what extent. Valid values are in the range 1 to 4. A value of 1 means that no subdivision will be done. Values of 2 through 4 mean that each quad cell will be divided upto the number specified if the node data values at the verticies of the quad cell vary too much. For a value of 2, the values can vary up to 50% of the total range of the data. For a value of 3, the values may vary up to 33%, and for a value of 4, the values may vary up to 25%.

type

This parameter controls whether the object is marked as static or dynamic for accelerate mode rendering. When accelerate mode is set on for the view, the renderer(s) store the image and Z-buffer information for static-type objects. When dynamic-type objects are changed, they are re-rendered into the buffers already containing the rendered static objects -- the static object need not be re-rendered unless it is also changed.

Value

 

Meaning (accelerate mode on)

 

Symbolic contant

 

0

Static

GD_OBJ_STATIC

1

Dynamic

GD_OBJ_DYNAMIC

 

dith_tech

This parameter controls how the datamap is used when scalar images are rendered and the virtual palette has an 8-bit visual selected. A value of 0 means that the scalar image values are converted to RGB color values and then dithered using the virtual palette's cube. A value of 1 means that the datamap is converted to a linear ramp in the system palette. The scalar image values are then converted directly to pixels using the ramp.

interp_type

This parameter controls the interpolation type used to scale the image. A value of 0 means point sampling. A value of 1 means bilinear interpolation. The XIL renderer (SunOS5 only) can also do bicubic interpolation (value 2).

tmap_method

This parameter controls the texture mapping method applied to the object. The default value is 0 or "normal" which is applicable for all platforms. A value of 1 means Vertex Level Texture Mapping (VLTM) and is applicable only in the XGL renderer on SunOS5 on the ZX graphics boards -- see the System Prerequisites document.

tri_subdiv_type

This parameter is only applicable when using VLTM texture mapping in the XGL renderer on SunOS5 systems on ZX graphics boards -- see tmap_method above and the System Prerequisites document.

tri_subdiv_aval

This parameter is only applicable when using VLTM texture mapping in the XGL renderer on SunOS5 systems on ZX graphics boards -- see tmap_method above and the System Prerequisites document.

tri_subdiv_fval

This parameter is only applicable when using VLTM texture mapping in the XGL renderer on SunOS5 systems on ZX graphics boards -- see tmap_method above and the System Prerequisites document.

missing_val

This paremeter provides the value to be used when rendering areas of scalar images that have been "left empty" due to rotation.

missing_red
missing_green
missing_blue

These parameters provide the values to be used when rendering areas of RGB images that have been "left empty" due to rotation.

xform_mode

This parameter controls the object's transform mode. Depending on the current transform mode, different transforms can be edited when the object is being directly manipulated. The transform mode may be:

Value

 

Meaning

 

Symbolic constant

 

0

Edit the xform of the object.

GD_XFORM_MODE_NORMAL

1

Edit the xform of the object's parent. Adhere to the parent's xform_mode.

GD_XFORM_MODE_PARENT

2

Edit the alt_xform of the object.

GD_XFORM_MODE_ALT

3

Do not edit the xform of the object.

GD_XFORM_MODE_LOCKED

 

reset

This parameter when set causes the object's transformation to be reset to its default -- the identity matrix.

normalize

This parameter when set causes the object to be normalized to the view.

center

This parameter when set causes the objects center of rotation to be set to the extents of the data.

use_altobj

This parameter controls whether the alternate object is used when rendering. By default, use_altobj is set to 0, disabling use of the alternate object.

space

This parameter controls whether the object is rendered with primitives that match the space of the camera (ie. 3D or 2D) or if 2D primitives are always used. A value of 0 means match to the space of the camera. A value of 1 means force the use of 2D primitives. This is especially useful in conjunction with the use of an alternate object so only 2D primitive are rendered. This gives more interactively in the camera.

Example

Libraries.Graphics_Display.Editors.UI_Editors.ObjectEditor

File

v/gd.v