TOC PREV NEXT INDEX

Getting Started with AVS/Express Developer Edition



5 Modifying the Data Visualization Application


In this chapter, you use the DataViewer editors and the Network Editor to modify your data visualization application.

In this chapter you:

5.1 Introduction

In the last chapter, you created a data-visualization application that reads a field data file, generates an isosurface of the field, and renders the isosurface in a data viewer.

In this chapter, you modify the application. You add two modules to the application:

5.2 Start AVS/Express
1. Open a command shell or an xterm window.
2. Navigate to the express directory.
3. Start AVS/Express by typing the platform-specific command listed below.
Visualization Edition users type:
Table E-1
UNIX
Windows
vxp
bin\pc\vxp
-or-
click on the application icon

Developer Edition users type:
Table E-2
UNIX
Windows
express
bin\pc\express
-or-
click on the application icon

Note: Do not start AVS/Express in the background. You start AVS/Express in the foreground because AVS/Express' V Command Processor (VCP) uses the shell window.
4. Select None as the application type in the initial application dialog box:.
Because you will load the application that you built and saved in the last chapter, you start the Network Editor without an application framework. Instead the Network Editor workspace displays the Applications object. This is a special object that contains all the applications you load into the Network Editor. It does not include the DataViewer editors or viewer window.
5.3 Load Your Application

Modifying the data-visualization application

Load the application
Adding a bounds object
Add a crop object
Save your application

You begin by loading your application into AVS/Express.

1. Select File -> Load Application.
A file-selection dialog appears.
2. Select your viz1.v application.
Navigate to it, select it, then select the OK button.
AVS/Express loads the application into the Applications workspace:
Figure E-1


The SingleWindowApp DataViewer appears with Read Field's interface displayed inxx the Modules editor.
3. Read the hydrogen data.
a. Click the Browse button in the Read Field editor panel.
A file selection dialog box appears
b. From the Files list in the file selection dialog select hydrogen.fld.

The hydrogen data is read into the Read Field module, triggering both the isosurface and Uviewer3D modules. The hydrogen image appears in the DataViewer window.

5.4 Add Objects to Your Application

Modifying the data-visualization application

Load the application
Adding a bounds object
Add a crop object
Save your application

The bounds object creates a bounding box for a field. A bounding box helps you visualize your data's extents. In this section you add a bounds object to your application, then test it.

Note: You can add a bounding box to the hydrogen object in the view using the Object editor in the DataViewer. The DataViewer provides easy access to a bounding box but does not give you as much control over the bounding box as the bounds object.
Instance and Connect the bounds Object
1. Instance bounds, then connect it to Read_Field and Uviewer3D, as shown in the diagram below.
bounds is located near the top of the Mappers library- the same library where you found isosurface.
You connect the left input port of bounds to the left output port of Read_Field. You connect the input port of Uviewer3D to the right output port of bounds.
Figure E-1


You will not see the bounding box in the DataViewer view window yet.
Test the Application
1. Use the Scale icon to reduce the object.
a. Click the Scale icon in the DataViewer toolbar:
b. Move the mouse pointer to the hydrogen image in the viewer window. Press and hold the left mouse button and drag the mouse pointer downward a bit.
c. Release the mouse button.
Notice that the object has a bounding box, which in the current perspective appears as a white square surrounding the object.



2. Rotate the object.
a. Click the Rotate icon:
b. Move the mouse pointer to the hydrogen image.
c. Press and hold the left mouse button and drag the mouse pointer a bit.
d. Release the mouse button. You can now see that the bounding box has three dimensions.



3. Next we will experiment with the user interface for bounds.
bounds lets you display various surfaces along the bounds.
From the Modules option menu at the top of the editor panel in the DataViewer, select bounds. The user interface for bounds appears, consisting of a set of toggle options:


Select the following toggles: Edges, Imax, and Data. AVS/Express displays the surface data along the maximum I face:



5.5 Add a Crop Object to Your Application

Modifying the data-visualization application

Load the application
Adding a bounds object
Add a crop object
Save your application

The crop object crops a set of field data along one or more selected dimensions. In your application, you insert crop between Read_Field and isosurface so that the application will display an isosurface of data that has been cropped.

Instance and Connect crop
1. Disconnect isosurface from Read_Field.
One way to disconnect objects is to repeat the connection operation, as if you were connecting the objects a second time. Another way is to move the mouse pointer to the connection line, then select the Delete Connection popup command with the right mouse button. AVS/Express disconnects the objects.
Figure E-1


You want to insert crop between Read_Field and isosurface, but it will not fit. So you first move isosurface and Uviewer3D down. One way to do this is to drag each object separately. Another way is to lasso the objects and move them at the same time. The instructions below illustrate how to lasso objects.
Note: You do not have to physically place crop between Read_Field and isosurface to make the connections. You could place it anywhere, but the connection lines would not be as clean, and it would be harder to see the structure of your application.
2. Move the mouse pointer so that it is pointing to an unoccupied area just above isosurface.
Figure E-2


3. Hold down the left mouse button and drag the mouse pointer downward and slightly to the right.
As you do, the Network Editor displays a rectangle. This is the lasso. Any object completely or partially inside the lasso when you release the mouse button will be selected.
Figure E-3


4. When the lasso partially covers both isosurface and Uviewer3D, release the mouse button.
The Network Editor selects both objects and highlights them in blue.
5. Move isosurface and Uviewer3D down by positioning the mouse pointer over one of the selected objects, then dragging the pointer with the left mouse button.
The objects now look something like this:



Notice that the connection line between Uviewer3D and bounds passes under isosurface. You can make the connection line clearer by moving Uviewer3D to the right.
6. Move the mouse pointer to an unoccupied area in the application workspace, then click the left mouse button.
This deselects both objects.
7. Drag Uviewer3D to the right.
Uviewer3D, now the only selected object, moves accordingly.
Figure E-4


You are now ready to add the crop object.
8. Instance crop and position it below Read_Field. Then connect crop to Read_Field and isosurface, as shown in the diagram below.
crop is located in the Filters library. Connect the left input port of crop to the left output port of Read_Field. Connect the left input port of isosurface to the left output port of crop.
Figure E-5


Test the Application
1. Bring the DataViewer to the front.
2. Try out the user interface for crop.
Select the crop option from the Modules option menu. The user interface for crop appears, consisting of a set of min and max sliders for dimensions I, J, and K. Drag the I max slider (the second one down) with the left mouse button until it is set to 32.
AVS/Express crops the data object, removing all values greater than 32 along the I dimension. Here is what the data object looks like in the viewer window, before and after the crop:
Figure E-6


5.6 Save Your Application

Finally, you can save the application.

1. From the Network Editor, select File -> Save Application.
A standard file-selection dialog appears.
2. Save your application in a file called viz1.v replacing your previous application
Table E-1
UNIX
Windows
Choose viz1.v from the Files list in the Save Application dialog.
Click OK.
Choose viz1.v from the Files list in the Save Application dialog.
Click OK.

AVS/Express requests confirmation and then saves the application.
3. Select File -> Exit from the Network Editor to exit AVS/Express.

This completes this tutorial.

5.7 For More Information

TOC PREV NEXT INDEX