TOC PREV NEXT INDEX

Using AVS/Express



3 Working with the Network Editor


The Network Editor is the main visual programming interface to AVS/Express. In this and the following chapters we will be introducing you to the concepts, tools, and steps necessary to build a visualization network.

This chapter introduces the basic concepts and tools for interfacing with AVS/Express. It discusses:

3.1 Choosing Your Initial Application

When you start AVS/Express, it displays the Network Editor and a dialog box in which you choose the initial configuration you want to use:

Figure C-1


You use the dialog box to choose the type of application and viewer you want to use:

Figure C-2


If you select one of the DataViewer applications, Application, Module Stack, or Scratch Pad, AVS/Express loads a predefined application framework. These applications are discussed in more detail in the following sections.

If you select Load application, AVS/Express displays a file browser dialog that you can use to select a previously saved application.

If you select None, AVS/Express starts-up with the root Applications object in the workspace. The Applications object is the ancestor of all applications in AVS/Express. You can instance a template application from a library into Applications. For example, you might want to instance one of the example applications from the Examples library.

If you select Add Data Import Wizard to application, AVS/Express loads a predefined application framework. This includes an instance of ImportWizard in your network editor which can be used through the modules menu in your application window to help you choose the correct reader for your data set.

If you select Add Data Visualization Wizard to application, AVS/Express loads a predefined application framework. This includes an instance of VizWizard in your network editor which can be used through the modules menu in your application window to help you create your application quickly and easily.

Visualization Edition Features
Setting a Default Viewer at Start-up

There is a .v file in the express/v directory, vxp_inst.v. This file is run when you start the Visualization Edition of Express.

You can put v code in this file to initialize your AVS/Express environment without having to select the application and viewer from the start-up dialogs.

For example, to open AVS/Express with the Multiwindow App application and the Uviewer viewer, use the following code:

APPS.MultiWindowApp MultiWindowApp<NEdisplayMode="maximized"> {
        GDM.Uviewer Uviewer<NEx=600,NEy=450>;
};
Library Structure

The library structure for the Visualization Edition is different in the following ways:

The DataViewer Applications

Select the Single-window DataViewer or the Multi-window DataViewer application to load a ready-made visualization environment framework. With either DataViewer configuration you can use the Viewer type radio buttons to create viewer windows that support 3D or 2D data, or both. AVS/Express instances a Uviewer object in the Network Editor workspace that supports the type of viewer you choose, and opens a viewer window and visualization environment.

The Single-window DataViewer opens one window that combines a viewer window in which you can display your data or image, and a set of editors that you can use to customize and interact with the viewer configuration:



The editor panels display controls for a set of editors you can use to manipulate the view. In addition, when you add modules to your application in the network editor, the controls for the modules are automatically added to a module stack displayed in this same panel.

The multi-window DataViewer application creates two windows, a viewer window and a separate window for the editor controls:



Chapter 2, Using the DataViewer Applications, provides comprehensive information about how to use the DataViewers.

The Default Application

The default application does not have any subobjects instanced automatically. You must instance any objects you want to use in your application, including viewer objects; UI windows and controls; and data import and processing objects.

The Module Stack Application

In releases of AVS/Express prior to Release 3.0, the default application was the Module Stack. You can load this application by choosing New Application->ModuleStack from the File menu. This application is similar to the Default Application, but it includes a User Interface panel, the Module Stack. AVS/Express automatically displays the controls for objects you instance into this application in the module stack.

The Scratch Pad

The Scratch Pad is a special application that you can use when creating or editing objects. When you drag an object into the ScratchPad workspace its template is moved rather than copied, and it does not become active. This means that AVS/Express does not attempt to execute the object while you are editing it. This is particularly helpful you are working on objects that interface to code.

When you are finished, you can move the edited object back to the library you moved it from or to another library.

Save Project's Default Application

To make your application choice the default application and avoid the start-up dialog, you can set the Set project's default application button on.

To enable this choice as the default, you must save the current session in a project file before exiting, When you start AVS/Express again using this project, the Network Editor loads your choice of application as the default and does not display the start-up dialog.

Install Area Project

The AVS/Express install area defines the install area project. This project includes:

Working in the Install Project

The install area is read-only - you cannot make changes to it. You must create a new project or projects in which to store your work. Projects created from the install area project (or any other read-only project) are derived from it - new projects define themselves as being like the install project, but with any additions and changes to you make to libraries, objects, and so on explicitly described.

Directories

The install project is made up of the contents of several subdirectories of the install directory. Here is a summary of the most significant of these directories:

Table C-1
Project directories
Description
v
Contains V files
bin
Contains the project's executables (express, user, and base) in a platform specific subdirectory
data
Contains sample data files
Others
Contain C and C++ source files, header files, and object files

Important V Files

The v directory includes the following V files (among others):

Table C-2
V file
Description
templ.v
Defines the Templates library. This is the top-level library, under which all of the project's objects are defined.
Here is a typical line from templ.v:
flibrary STD<libfile="std">;
This line defines a library called STD and specifies that the file std.v contains the V code for the library's constituent objects.
libs.v
Includes files that define the libraries as they appear in the Network Editor. The included file lib_xp.v defines the Libraries object in AVS/Express. This library contains libraries of NElink objects that point back to the libraries created by templ.v. Here is a sample line:
NElink Standard_Objects<NEdisplayMode="opened",
NEhorizontal=1> =>Templates.STD;
proc.v
Defines ProcTemplates, an object that lists the project's processes. Here is the V code. As you can see, the install area project consists of three processes:
group ProcTemplates {
process express;
process user;
process base;
};

3.2 Network Editor Overview

The section provides a overview of the Network Editor, its use, and its relation to the object oriented structure of AVS/Express.

The Network Editor Components

The following figure identifies the major components of the Network Editor:

Figure C-1 :


The Object Libraries

The Network Editor is divided into two main sections. The top section displays libraries of template objects. The template objects are predefined components that you can use to build your own application. They include high-level macros and modules such as viewers, data filters, and User Interface components that you can use to add ready-made functionality to your application; and low-level templates for primitive data objects, methods, modules, macros, and groups that you can combine to create your own template objects. You can also import objects created by other users.

For more information about using objects, see Chapter 5, Objects in AVS/Express.

The libraries organize the objects into functional groups. You can use the Libraries option menu to change from one library page to another. On each page, sublibraries further subdivide the objects into more specialized groupings. You can move through the hierarchy to look for the kind of object you need. For example, the Main library contains the objects you will most often need. Sublibraries within Main group the modules according to their function: data IO, filters, mappers, geometries, field mappers, or viewers. You can also select Find in All Libraries or Find in Selected Libraries from the Object menu to search the library hierarchy for a specific object.

For more information about the Library hierarchy, see Understanding Libraries on page 5-11.

The Application Workspace

The bottom section of the Network Editor displays the current application workspace. You build your application in the workspace by using your mouse to drag template objects from the libraries into the workspace. When you drop the object into an application workspace, AVS/Express creates a copy of the template, called an instance. An instanced object is active, that is, AVS/Express executes the methods in the object. You can reference data between instanced objects by using your mouse in the workspace to draw connections between objects.

For more information about instancing objects see Building Networks in a DataViewer Application on page 3-13

The ScratchPad

You can also open a special application called the ScratchPad into the workspace. When you drag objects out of an editable library into the ScratchPad, AVS/Express does not instance a copy of the object. Instead it moves the object itself out of the library into the workspace without instancing it. Because the object is not active, you can edit it without AVS/Express attempting to execute methods as you add them. When you are finished you can move the object back into any of the editable libraries and use it as template just like the predefined objects supplied by Advanced Visual Systems.

The Menu Bar

You can use commands on the Network Editor menu bar to perform a variety of AVS/Express functions:

3.3 Building Networks in a DataViewer Application

This section presents an overview of a sample network to illustrate how you create a network in the network editor and the relationship between the Network Editor and the DataViewers. More detailed information on instancing and connecting objects is given in Chapter 5, Objects in AVS/Express.

Groups of objects and their connections are called networks. You can build networks interactively by instancing template objects in the application workspace and connecting them using your mouse. By combining predefined objects you can quickly build a powerful application. The following illustration shows the implementation of a simple visualization network.

Figure C-1


When you start-up the Single-window or Multi-window DataViewer application, a UViewer module is automatically instanced. Output from this module appears in the viewer window.

Adding Modules

To create this network you instance Read Field from the Readers library and isosurface from the Mappers library on the Main library page into the application workspace. When you instance these modules, you can access their controls in the editors panel by selecting Modules from the Editors menu in the menu bar, and then the name of the module from the Modules option menu at the top of the editor panel. You connect Read Field to isosurface, and isosurface to Uviewer.

Read Field imports a file containing AVS/Express field data. In this case, we have read in a file containing data representing a hydrogen molecule. isosurface takes the field as input and creates a surface of constant value, analogous to 3D contour lines. The isosurface controls, available through the editors panel, allow you to specify the surface value. The viewer accepts the surface data from isosurface and renders the image in the viewer window.

Using The Viewer Editors

You can also use the editors panel to access a set of viewer editors. These editors allow you to interactively transform and modify objects in the view and the view's camera and lights. Specifically, the following editors are available:

3.4 Visual Programming

In addition to building networks out of the existing objects, you can create and combine objects.

Object Types

All objects in AVS/Express, whether pre-defined or created by you, are derived from one of six base types. You can find templates for various versions of these objects in the Standard Objects library. The type of the object is identified by the icon in its upper left corner.

Primitive Data Objects

Primitive data objects are the simplest base type. They are usually used as parameters in a module to hold data. You can create primitive objects for the following types of data:

Primitive
Description
boolean
byte
char
double
enum
float
int
short
string
ptr
prim
Boolean integer
One-byte integer
Single character
Double-precision float
Enumerated data type
Single-precision float
Integer
Short integer
A NULL-terminated character string
Pointer to user data structure
Object with unset data type used for any one of the above

For example, the following parameter is created from a float parameter object. For detailed information about primitive data objects, see Values and Connections on page 6-16.

You can use a group object as a parameter in a module to encapsulate other objects, typically primitive values and other groups. Modules are a special type of group (see Modules on page 3-18). For detailed information on using groups, including modules and macros, see Defining Groups, Modules, and Macros on page 5-5.

Methods

You use method objects in modules to encapsulate user code. You can use three different types of methods depending on the type of code you want to use: C, C++, or Fortran:

Table C-1
Type of method
Technique
Notes
omethod
C API
takes a string value specifying the name of the function
cxxmethod
C++ API
string value, if present, is interpreted as the code corresponding to the method
fmethod
FORTRAN API
takes a string value specifying the name of the function

For detailed information about programming with method objects in AVS/Express, see Methods on page 6-41.

Modules

A module as an object that contains or encapsulates parameters and methods:

Figure C-1


Within the module you can define the interactions between methods and parameters so that, for example, a method executes whenever a particular parameter changes value, or a method will not execute unless a parameter has a value.

For detailed information on programming with modules in AVS/Express, see Modules on page 5-5.

Macros

When you have built a network in the Network Editor by connecting several modules together, you can encapsulate this group inside another type of object called a macro:



As in this example, you can export module parameters from inside a macro so that they become the interface to the macro. Parameters that are not exported are considered part of the implementation of the macro. A macro can contain other macros as well as modules so applications can be constructed out of progressively higher-level building blocks.

Since each object manages its own execution, the programming process is simplified. You instance and delete objects, and change parameter values either by making/breaking connections or by changing parameter values directly. You traverse the structure of the application visually and edit it using direct manipulation techniques. By making good use of macros, you can subdivide an application into manageable units of complexity.

Library

The library objects are used by AVS/Express to store the object templates displayed at the top of the Network Editor. You can also create libraries of your own.

By definition, a library contains a list of AVS/Express templates. Templates are inactive objects that you can copy to create other objects. Libraries can contain macros, modules, parameters and other libraries. Their primary goal is to arrange the collection of available AVS/Express objects into sets that share common behaviors and purposes.

There are two base types that you can use to build a library in AVS/Express: library and flibrary. The library base type is global by default and used only for simple libraries. The flibrary base type is more general since it can be made global or not, and can optionally store the definition of the objects it contains in a separate V file.

For detailed information on libraries, see Understanding Libraries on page 5-11.

Application

You use an application, like a macro, to hold networks of other objects, including other objects. But application is intended to be the root object of a project.

You can use applications to save networks that you build and then restore them. The Net work Editor has menu commands that you can use to save an application into a file. When you load the application file, AVS/Express opens the application into the Network Editor workspace, instances the objects that were instanced when you saved it, and reestablishes the connections between the objects. Other AVS/Express users can share your work by loading the application into their systems.

Comment objects

You can insert "comments" into a macro object using a special comment object:



You can enter a string into this object and include it in a macro to include information about your application. You, or other programmers can later open this object to reveal the text of the comment.

You can also specify the position of the comment in the macro by including a geometry string of the form +x+y or widthxheight+x+y after the initial equals sign. For example, "/*=+50+60 This is a comment. */" will be displayed as an icon at the position 50,60 in its macro parent.

Adding Modules To AVS/Express

AVS/Express provides support for you to add your own modules to the system. When you add modules to the system, you define the list of parameters and methods for a particular module, then specify which events should cause which methods to execute. A module's methods can execute when the module is instanced or destroyed, or when one or more parameters change. When a method is executed, it can determine which parameters have changed since the last invocation and can change one or more other parameters.

By adding a collection of modules, you can use AVS/Express to provide a visual programming interface to an existing library of code.

For information on using the Add Module tool to add a module to AVS/Express, see The Add Module Tool on page 8-2.

For detailed information about adding modules from a programming perspective, see Modules on page 5-5.

3.5 Handling Objects in the Workspace

This section summarizes techniques you can use to manipulate objects in an application workspace.

Selecting More than One Object

You select one or more objects in advance of performing certain pulldown commands. The selection indicates the objects to which the command applies. For example, the Edit->Delete pulldown command deletes the objects that you have selected.

You can:

Single Object

To select a single object select the object with the left mouse button.

If the object is open or maximized, you must select the object's title bar or frame. Do not select the object's ports.

AVS/Express selects the object and deselects all previously selected objects.

Multiple Objects Using a Lasso

Lassoing means using the mouse to outline a rectangular region, or lasso. The Network Editor selects the objects that are completely or partially inside the region. Lassoing works only inside an open or maximized macro object.

To select multiple objects at once using a lasso:

1. Point to one corner of the rectangular region you intend to outline.
The pointer must be over an unoccupied portion of the window.
2. Drag the mouse pointer with the left mouse button to the diagonally opposite corner of the region.
As you do, the Network Editor displays the rectangular region's outline.
3. Release the mouse button.

The Network Editor selects the objects that are completely or partially inside the rectangular region. It removes the outline and deselects all previously selected objects.

Selection List

When you select one or more objects, the Network Editor by default immediately deselects the previously selected objects. You can alter this behavior to incrementally add or remove objects from the selection list.

To add or remove objects from the selection list hold down the Shift key as you select an object.

Here is what happens:

You can use the Shift key with a lasso operation, too.

Objects in the selection list must have the same parent object. If you attempt to add an object to the selection list, but the object's parent is different, the Network Editor selects the object and deselects the previously selected objects.

Deselecting All Objects

To deselect all objects select an unoccupied area in an open or maximized macro window.

Repositioning an Object

Repositioning an object means moving the object within its parent's window.

The parent must be an open or maximized macro or application object.

You can:

Selected Objects

To reposition selected objects:

1. Select the objects you want to reposition.
2. Point to one of the selected objects.
Note that Steps 1 and 2 are accomplished simultaneously if you are repositioning only one object.
3. Hold down the left mouse button and drag the objects.
As you drag the objects, the Network Editor displays an outline of the selected objects and moves the outline. It also displays a cursor and status bar message indicating the operation, and it highlights in pink the window where the objects will be placed if you release the mouse button. Be sure not to move the pointer out of the current window; otherwise the objects will be reparented.
All Objects

You can "pan" your view of a macro object. This has the effect of repositioning all objects in the macro. This is particularly useful when the parent object has so many subobjects that you cannot see them all at the same time in the window.

To pan a macro:

1. Point to an unoccupied area of the window.
2. Hold down the Shift key and middle mouse button, and drag the objects.

On Windows systems, use the right mouse button.

Resizing a Window

You can resize any open object in a macro window. You can also resize the Libraries workspace. A resizable object has resize handles on its lower corners:

Figure C-1


You resize the window by dragging one of its resize handles.

To resize a window hold down the left mouse button and drag the lower left or right corner of the window.

The Network Editor displays an outline rectangle in the macro background that indicates the new size of the object.

When you resize the Libraries workspace, the Applications workspace grows or shrinks to fill the remaining space in the main Network Editor window.

Zooming In or Out on Objects in a Window

You can zoom in or out on objects in an opened or maximized window. The window must be for a macro or application object.

You can:

Zoom Using the Mouse

To zoom using the mouse:

1. Point to an unoccupied area inside the open or maximized window.
2. On UNIX systems, hold down the Ctrl key and the middle mouse button, and drag the mouse pointer.
On Windows systems, use the right mouse button.
To enlarge the window's objects, move the pointer up or to the right. To shrink the window's objects, move the pointer down or to the left.
Zoom to Fit the Window

To zoom so that all objects in a window can be seen:

1. Point to an unoccupied area inside the open or maximized window.
2. Select the Zoom To Fit popup command.
Resetting a Macro Window

You can reset the zooming and panning effect on a macro window. This causes all subobjects to appear in their original position and size.

To reset a macro window:

1. Point to an unoccupied area inside the open or maximized window.
2. Select the Reset Scaling popup command.
Using Automatic Layout

You can apply an algorithm that arranges all of a macro's subobjects according to their connections.

To use automatic layout on a macro object:

1. Point to an unoccupied area inside the open or maximized window.
2. Select the Arrange Icons popup command.
Viewing and Setting a Scalar Object Value

You can set the value of a scalar primitive object such as an int or string.

To set the value of a scalar object:

1. Make sure the object is open.
If necessary, open the object by pointing to it and selecting the Open popup command.
2. Make sure the object has the keyboard focus.
When you open the object, a typein is created, and the keyboard focus is assigned to the typein. This means you can immediately start entering text.
(Also, if the object has a value, the value text is selected. This means that any text you type will replace the current value text. To prevent this from happening, click inside the typein to unselect the text.)
If the object is already open, you can assign the keyboard focus to it by clicking in the typein with the mouse.
3. Type a new value for the object.
If you make a mistake, you can recall the current value by pressing the Esc key.
4. Apply the value.
You can apply the new object value by closing the object. If you prefer to leave the object open, apply the value by pressing the Enter key.
Viewing and Setting an Array Value

You can set the value of an array of primitive objects such as an ints or floats.

An array value is set using the same procedure as for setting a scalar value, but a multiline typein is used instead of a single-line typein. The multiline typein has scrollbars that allow you to access all lines of text.

You can enter newlines in the typein by pressing the Enter key. To apply the value of the typein, you either close the icon, or use a modifier key with the Enter key.

Traversing an Array of Groups

You can access individual elements in an array of groups. When an array of groups is open, it displays the subobjects of one element at a time. You can traverse the elements using arrow buttons in the object's title bar:

The object above is an array of groups, each element of which contains an int and a float. It is currently displaying the subobjects of element 0.

If you press the right arrow button (by clicking on it with the mouse), the current array element index is incremented. If you press the left arrow button, the index is decremented.

If the index is 0, then pressing the left arrow button causes the subobjects of the array template to be displayed. The array template is the object from which copies are made in order to create the actual array elements. When the array template is displayed, the index indicator in the object's title bar is an asterisk (array[*], for example).

For more information about arrays of groups, see Defining Arrays Of Groups, Modules, And Macros on page 6-36.

Viewing and Setting an Object's Name
View

To view an object's name look at the object's icon or title bar, or display the Info dialog box for the object.

The icon or title bar displays the object's unqualified name. The Info dialog box shows the object's full pathname.

Set

To set an object's name:

1. Select the Rename popup command for the object. Or select the object then the Object->Rename pulldown command.
The Rename Object dialog box appears.
2. Enter a name in the dialog box's entry field.
Follow these rules:
  • Valid characters - A name can contain uppercase letters, lowercase letters, numbers, and the special characters # (number sign) and _ (underscore). A name cannot contain only numbers.
  • Case sensitivity - AVS/Express is case sensitive. For example, mygroup and Mygroup differ.
  • Spaces - In the Network Editor, the underscore character in a name appears as a space. In the Rename dialog box, if you enter a name with spaces, AVS/Express internally converts each space to an underscore character.
  • Uniqueness - A name must be unique among its siblings in the object hierarchy. In the Network Editor, if you attempt to create an object with the same name as a sibling, AVS/Express appends the suffix #n to the object's name.
3. Press the Enter key, or select the OK button.
Viewing and Setting an Object's Type
View

To view an object's type display the Info dialog box for the object.

The dialog box shows the object's class and primitive type.

Set

You cannot change an object's type, but you can merge additional types into it.

For information on merging objects, see Merging Objects on page 5-27.

Viewing and Setting an Object's Attributes

For background information, see Managing Object Attributes and Properties on page 5-47.

View

To view an object's attributes display the Properties Editor for the object.

The current attributes appear in the Current Properties list box (along with other items).

Set

To add additional attributes to an object or delete attributes, use the Properties Editor for the object.

3.6 Manipulating Objects

In this section we will look at the most common means of cutting, deleting, pasting, and saving objects. More detail on this can be found in Chapter 6, Managing and Editing Objects.

You can perform cut and paste operations on objects. The Network Editor maintains a clipboard for temporary storage of objects. Clipboard operations are performed by selecting objects and executing commands on the Edit pulldown menu. The following operations are available:

Cut

The cut operation deletes the current contents of the clipboard, copies the selected objects to the clipboard, and deletes them from their current parent.

To perform a cut operation:

1. Select the objects you want to cut.
2. Select the Edit->Cut pulldown command.
The selected objects are moved to the clipboard.
Copy

The copy operation deletes the current contents of the clipboard and copies the selected objects to the clipboard, but leaves the original objects untouched.

To perform a copy operation:

1. Select the objects you want to copy.
2. Select the Edit->Copy pulldown command.
The selected objects are copied to the clipboard.
Paste

The paste operation copies the contents of the clipboard into the selected object. It leaves the clipboard contents unchanged, so you can paste them elsewhere.

To perform a paste operation:

1. Select the object into which you want to paste the clipboard contents.
2. Select the Edit->Paste pulldown command.

The clipboard contents are copied into the selected object.

Duplicating Objects

Duplicating means making a copy of selected objects. The duplicates are siblings of the originals.

To duplicate objects:

1. Select the objects you want to duplicate.
2. Select the Edit->Duplicate pulldown command.
The duplicated objects have names similar to the originals, but with a #n suffix. For example, if you duplicate a UIcmd object, the name of the duplicate object is UIcmd#1.
Deleting an Object

Deleting an object removes its definition, including the definition of its subobjects.

Cutting is a special type of deletion, in which a copy of the deleted objects is placed on the clipboard, allowing you to subsequently paste them elsewhere.

You can:

Single Object

To delete a single object:

n Select the Delete popup command for the object.
Selected Objects

To delete selected objects:

1. Select the objects you want to delete.
2. Select the Edit->Delete pulldown command.
Cut Operation

To cut selected objects onto the clipboard:

1. Select the objects you want to cut.
2. Select the Edit->Cut pulldown command.
Saving Objects to a V File

You can save selected objects to an ASCII V file. Do the following:

1. Select the objects you want to save.
When you select an object, its subobjects are also selected, so they will also be saved.
2. Select the Object->Save Objects pulldown command.
The Save Objects dialog box appears.
3. Specify a file.
You can navigate to a directory using the selection boxes.
4. Select the OK button.
Loading Objects from a V File

You can load a V file's objects into a selected AVS/Express object. Do the following:

1. Open/maximize and select a target object.
This is the object into which the V file's objects will be loaded.
2. Select the Object->Load Objects pulldown command.
The Load Objects dialog box appears.
3. Specify a file.
You can navigate to a directory using the selection boxes.
4. Select the OK button.

3.7 AVS/Express' Object-Oriented Paradigm

The Network Editor implements a prototype model object-oriented system. In this model the template objects are similar to the class objects of other set-based object-oriented systems, but there are important differences.

Subclassing

In a set-based model, like C++, you define an abstract type (the class), or modify an existing class to create a subclass, and then create individual instances of it.

In a prototype model, you can use any existing template object as a template for a subclass. In AVS/Express, when you instance an object into an application workspace, the copy operation performs both the subclass and construct operations. The subclass starts out as an identical copy of the template object but usually some additions or modifications are then made that differentiate it from the superclass.When you edit the object you are both changing the behavior of the active object and redefining the subclass it represents. If you return the object to an editable library, it can be used as a template for other objects.

Parenting

When you instance an object into the application workspace, the container object into which you drop the object becomes its parent. You can reparent an object in the Network Editor simply by dragging it out of one object and into another.

Other objects at the same level in the same container object are called siblings of the instanced object. Subobjects of a container object are called its children. Together this system of parents, siblings, and children determine the object hierarchy.

For more information on the object hierarchy, see the AVS/Express Object Hierarchy on page 3-34

Inheritance

When you instance an object, it is derived from its template object and inherits the template object's subobjects and other characteristics such as its reference mode, array declaration, value expression, attributes, and properties. A template object may itself be derived from other objects. The derivation hierarchy of object is the hierarchy of all the template objects from which it inherits. This is similar to the class-hierarchy of other object-oriented systems.

Both subclasses and instances keep track of the template from which they were created so that future changes to the template will be propagated to the new object.

AVS/Express also supports multiple inheritance; an object may have more than one immediate ancestor in its derivation hierarchy. In the Network Editor this is represented by the merge operation which instances a template object into another object in the workspace, combining their subobjects and properties.

Object Interfaces

In most object-oriented systems, the interface to an object consists of a set of methods (also called "messages") that the object supports. You call these methods to access the functionality of the object.

In AVS/Express, an object's methods are not exposed to other objects. Instead the interface to an AVS/Express object is a list of named parameters. These parameters can be simple primitive values such as an array of three numbers specifying a color or an integer specifying the height of a widget. They can also be aggregate objects themselves such as an image that might contain width, height, and data.

The connections between objects in the Network Editor are connections between parameters. A connection provides a conduit for the sharing of information between two objects. The methods in an AVS/Express execute in response to events that occur on the parameters of the object. Objects can send messages back and forth across connections to other objects without your needing to manage this communication explicitly. Thus you do not have to know of the existence of the methods and do not need to manage the execution of the object. This is called execution encapsulation. In AVS/Express objects that have parameters and methods and have their execution encapsulated are called modules.

Parameters connect to other objects through ports. You can give a parameter an input port, output port, or both at the same time. Ports are colored based on the data type of the object. Multi-colored ports can be used to indicate polymorphic objects (objects that can be used for more than one purpose). In many cases, a connection represents a lasting relationship of equality between two parameters. For example, by connecting a width parameter to a height parameter, you are guaranteed that width will always equal height.

For more detail on this see Chapter 5, Objects in AVS/Express.

AVS/Express Object Hierarchy

We have defined several different types of AVS/Express objects: macro, module, parameter, method, and library. Each of these objects is a subclass of a common object type called simply object. These objects are all stored in a single tree structure called the object hierarchy.

In the object hierarchy, each object may have a list of subobjects and a single parent object. The subobjects of a module are parameters and methods. The subobjects of a library are macros, modules, and other libraries. The subobjects of a macro are modules and other macros. Methods have no subobjects. If a parameter has subobjects, they are also considered parameters.

These objects are joined together to form a single object hierarchy with the Root object containing Templates and Applications subobjects.



Taken as a whole, the object hierarchy defines your execution and development environment. The branch from Applications define the execution environment, The path from Templates defines the development environment, that is, the template objects you have available to you.

This entire environment is called your project. Whenever you work in AVS/Express you are working in a project.

3.8 Reusing Your Work

You can save your work in applications or in projects.

Saving Your Work in Applications

By building up a hierarchy of objects, you can use AVS/Express to build a complete application. An application in AVS/Express is just a special kind of macro object that is not contained within other macros. The Network Editor's workspace represents an application object.The application object is usually created by AVS/Express when the process is started and is not destroyed until you exit the application.

You can save applications from the Network Editor using the Save Application commands on the File menu. AVS/Express displays a file dialog in which you can name the application file. When you save an application, you preserve all the objects and the structure of the AVS/Express project.

To restore the application you use the Load Application command from the File menu and specify the application file name in the file dialog that appears. AVS/Express loads the application in the Network Editor workspace and makes it the current application

One of the advantages of creating complete applications using AVS/Express is that you can pass the application to your users and optionally allow them to customize the application using the Network Editor.

Saving Your Work In Projects

When you first use AVS/Express, you access a default read-only project from the AVS/Express install area. This project includes all the libraries of template objects available with AVS/Express.

In order to save your objects you create and change the configuration of the default project, you create your own project by using the Project`Save As pull-down command from the Network Editor. You load the project when you start AVS/Express by using the -project command-line option. For example, to start the Visualization edition with a project call myproj you would use the following command:

vxp -project myproj
Note: Unlike saving an application, saving a project does not save objects and networks currently in the application workspace.In order to save objects you have created in the application workspace, you must move them into a library.

You can change the configuration of the project, excluding libraries and other templates sets by using the Project`Configure pull-down command. This command displays a dialog listing libraries and other items you can remove from AVS/Express. You can toggle the items you want to include or exclude from your project. When you save your project, these choices are used to configure the project. They next time you load the project, the Network Editor displays only the items you chose to include.

For detailed information on the structure and programming of projects, see Chapter 10, Projects and Processes.

Generating Runtimes

You can also use the Save Compiled Project command from the Project menu to compile a selected set of objects into a separate project area. This mechanism allows you to build runtime versions of your AVS/Express applications that are smaller, start up faster, depend upon fewer files, and are therefore ideal for distribution.

For more information on saving and using compile projects, see Chapter 10, Projects and Processes.

3.9 Changing Your Project Configuration

To change the configuration of the libraries saved in your project, select Configure from the Project menu. AVS/Express displays a list of libraries and renderers that you can exclude from your project:



Check the items you want to include in your project. When you save the project the items you did not select will not be included. The next time you load the project the Network Editor and its associated editor interfaces and dialogs are initialized to remove the items you did not include.

Excluding objects you do not want to use makes the Network Editor interface easier to use and improves the speed with which AVS/Express starts up and initializes.

3.10 Journaling

Journaling lets you record a set of operations you perform on objects in the Applications hierarchy, then replay them. AVS/Express records these operations as V statements and commands in a journal file that you specify.

Note: The journaling facility only records operations that are made in program state and user state. For more information on state modes, see Methods on page 6-41.

This includes operations performed through the Network Editor, through the VCP, or through user interface widgets. It does not record operations performed by modules, unless these modules explicitly set the state mode.

Recording

To record a set of Network Editor operations.

1. From the Journal menu on the Network Editor menu bar, select the Record pull-down command. The Record File dialog box appears.
2. Specify a journal file. You can navigate to a directory using the selection boxes.
3. Select OK. Recording begins.
4. Perform a series of operations. For example, you can instance objects, connect them, set values, and interact with the resulting application. AVS/Express records each operation. You can perform actions outside of the application workspace, such as opening and scrolling libraries, but the journaling facility ignores them.
Stopping

To stop recording, from the Journal menu select the Stop pull-down command.

The journaling facility stops recording and saves the resulting V file. The file contains a collection of V statements and V commands.

Playback

To play back the V file:

1. Make sure that you are no longer recording and that your network is in the same state that it was in when you began recording. For example, if you started recording with an empty Default Application object, you must have an empty Default Application object to play back your journal file.
2. Select the Journal->Playback pull-down command. The Playback File dialog box appears.
3. Select the journal file. You can navigate to a directory using the selection boxes.
4. Select OK.

AVS/Express loads the V file and executes the file's statements and commands. You cannot stop a playback in progress.

3.11 Using On-line Help and On-line Documentation
To display on-line help for an object:
n Select the Help popup command for the object. Or select the object, then select the Help->On Selected Object pulldown command.

AVS/Express displays the reference page for the object in the on-line document set.

Some objects do not have associated help, in which case the Network Editor displays a dialog box containing an informational message.

Displaying the Top-Level Contents

To display the top-level table of contents for the on-line document set:

n Select Help->Contents.
3.12 Displaying Errors

By default, AVS/Express displays error messages in an error dialogue:

Figure C-1


You can leave this window up as a home for error messages, or close it. AVS/Express opens it when a new message arrives.

AVS/Express opens the Error Dialog window and displays the current message. You can use the buttons to control what messages are displayed:

You can also choose to display the error message in the VCP console. To disable the error dialog box mechanism and see the error messages displayed in the VCP console window, set the environment variable NE_NO_ERROR_DIALOG.


TOC PREV NEXT INDEX