PresentDemoApp

Synopsis

The PresentDemoApp application provides a base from which various forms of demonstration applications can be constructed. It is particularly intended to be used when making formal presentations using either the standard or multi-pipe editions of AVS/Express.

present_demo User Macro Parameters

Name Type Description UI Control

title string Title to display on Control Panel. n/a
rotate int Enables rotation of scene. R button
scale int Enables scaling of scene. S button
translate int Enables translation of scene. T button
rnc int Resets, Normalizes and Centres the scene. RNC button
use_mpu int Toggles use of MPU render when available. Toggle
show_menu int Toggles showing of normal AVS/Express application panel. Toggle
inc_objects int[] Indices of objects to include in output. Option box list
objectnames string[] Names of input objects. n/a

present_demo User Macro Output Ports

Name Type Description

out_objs mlink Array of links to selected objects.
module_panel link Link to application UI panel.

Description

Giving presentations is a major part of many academic and commercial people's work lives. Often these presentations will consist of displaying the results of visualizations to a wider audience. This can either be in the form of static images or dynamic visualizations. AVS/Express is in many ways a good tool for giving these sorts of dynamic presentation. Many presentations are given using laptop computers and AVS/Express visualizations can be relatively easily taken from a Unix-based desktop environment to a Windows-based laptop environment. The multi-pipe edition of AVS/Express is even more suited to giving dynamic presentations because it can make use of multi-user immersive displays such as Reality Centers and Immersadesks.

However AVS/Express does have one major problem when it is used for giving presentations. The standard Express user interface take up a large amount of space on the screen and can be distracting for the audience. Command line options can be used to remove the Network Editor and the V Command Processor. However this still leaves the standard SingleWindowApp or MultiWindowApp user interface. Both of these take a decent amount of screen space and contain many distracting buttons and sliders. These user interfaces can also be confusing for the presenter if they are not familiar with the AVS/Express user interface.

One solution to this problem is create a custom user interface that only contains the controls necessary. This is not a straightforward task and would normally involve removing the standard module user interface. This could be a major problem if the audience asked a question that could not be answered with the controls in your custom user interface. The PresentDemo project aims to solve both of these problems by allowing the user to build their demonstration application from a base application.

Using the PresentDemoApp user interface.

The PresentDemoApp base application is itself based on the MultiWindowApp application. Therefore it contains the same module user interface and the same scene viewer window. However by default the module user interface is hidden. Instead a panel similar to the one shown below is displayed.

PresentDemoApp User Interface

This panel can is spilt into top and bottom portions. The top portion contains all the general controls that are used by all applications and that are supplied by the PresentDemoApp application. These controls include:

File Menu Allows the user to exit express.
R Button Enables rotation of the scene.
S Button Enables scaling of the scene.
T Button Enables translation of the scene.
RNC Button Resets, Normalizes and Centres the scene.
Show Menu Toggle Toggles the display of the standard module user interface.
Use MPU Renderer Toggle Toggles use of the MPU renderer, when available.
Select Visualizations Radio Boxes Toggles the display of the various visualizations.

The bottom portion of the panel contains all the application specific controls that are supplied by the programmer of the demo. In this case these are a slider to control the level of an isosurface and a toggle to control the running of an advector visualization. Before you start developing your own demonstration applications you should become familiar with this user interface. The PresentDemoEg1 and PresentDemoEg2 example applications are provided so that you can do this.

Developing with the PresentDemoApp base.

Developing with the PresentDemoApp base application is in many ways similar to developing with the MultiWindowApp base application. As PresentDemoApp inherits from MultiWindowApp it contains the same user interface and Uviewer components and is used in much the same way. However there are some steps that you do have to take that are different to normal.

  1. Drag PresentDemoApp down from IAC library to start development.
    There is no 'New Application' option for the PresentDemoApp. Therefore you have to manually drag the application down from the IAC library.
  2. Specify title for PresentDemoApp panel.
    A title should be given to the application. This can be done by editing the string found in present_demo.params.title. This string will appear in the title-bar of the PresentDemoApp panel.
  3. Build application as normal using Network Editor.
  4. Feed all Red DataObject outputs through present_demo user macro.
    The PresentDemo panel allows the user to select the visibility of the various visualizations. However for this to work all the red DataObject outputs have be feed through the present_demo user macro. If they are feed directly into the Uviewer macro as normal then all the objects will be displayed all the time.
  5. Specify names for DataObjects
    By default the present_demo macro automatically gives all DataObjects a name. However these are not meaningful and normally better names should be manually specified. This can be done by editing the present_demo.objectnames array. The order in which names are given is important. Often it will be easier to specify these names by directly editing the V code.
  6. Place application user interface in application_UI macro.
    All the application UI components should be placed in the application_UI macro and connected to the parent link. By doing this the application components will appear in the bottom half of the PresentDemoApp panel. The output values of these components can then be connected to the appropriate values in the visualization modules.
  7. Resize PresentDemoApp panel so that all components are on screen.
    The PresentDemoApp application does not know which components the user will add. Due to this it cannot automatically resize its user interface and the user must do this manually.

After all these steps have been taken your demonstration application should be finished. You should then save the completed application as a V file. If you want to edit the application again you can start express and load the application as normal. If you want to run the application as a demonstration you should use a script or batch file similar to the following. These will start Express without the Network Editor or V Command Processor, and will suppress error messages. These scripts assume that they are being run from the project's root directory.

For Unix systems using C shell:

#!/usr/bin/csh
setenv NE_NO_ERROR_DIALOG 1
./bin/{$MACHINE}/express -novcp -none demo.v

For Windows systems:

set NE_NO_ERROR_DIALOG 1
start bin\{$MACHINE}\express -novcp -none demo.v

Inputs to present_demo user macro

in_objs

Array of DataObjects that the user can select to be displayed. This input array can be built up by making multiple connections from red output ports to the in_objs port.

Parameters of present_demo user macro

title

String parameter that specifies the name that should be given to the demonstration application. This string will be displayed in the title-bar of the PresentDemoApp control panel.

rotate scale translate

These integer parameters specify whether mouse movements should rotate, scale or translate the selected object or scene. These parameters are already connected to the appropriate places in the user interface and normally these connections will not need to be altered.

rnc

Integer parameter that is used to trigger the resetting, normalization and centering of the selected object or scene. This parameter is already connected to the appropriate place in the user interface and normally this connection will not need to be altered.

use_mpu

Integer parameter that specifies whether the MPU renderer should be used. This parameter is only used when the Multi-pipe edition of AVS/Express is being used. The PresentDemoApp base application already connects this parameter to the appropriate places in the Uviewer. Normally these connections will not need to be altered.

show_menu

Integer parameter that specifies the visibility of the normal MultiWindowApp module user interface. Making the normal module user interface visible allows more detailed adjustments to be made than would be possible with the customized application user interface. By default the normal user interface is visible. This default is necessary because of a problem with AVS/Express when running on Windows. If the MultiWindowApp user interface is initially invisible then the sizes of various user interface components are not setup correctly and hence the user interface does not work correctly.

inc_objects[]

Integer array that specifies which DataObjects should be included in the output GroupObject. The array contains a list of zero-based indices into the input array. Therefore a value of {0,3} means that the first and fourth DataObjects will be included in the output GroupObject. By default no elements of the input array are selected.

objectnames[]

String array that specifies the names of the DataObjects in the input array. These names are displayed in the user interface so that the user can more easily choose between the objects. By default the objects are named Object[0], Object[1] and so forth. However explicit object names can be easily specified.

Outputs from present_demo user macro

out_objs

Output GroupObject that contains references to the selected DataObjects from the input array. This output should be directly connected to the input of the Uviewer macro.

module_panel

Link to the bottom UIpanel of the PresentDemoApp control panel. Any user interface components that are connected to this output will be displayed in the PresentDemoApp control panel. If the PresentDemoApp base application is used this output is connected to the application_UI macro. In this case all user interface components should be contained with that macro.

Utility Macros

The PresentDemoApp base application uses the present_demo user macro. This user macro makes use of the PresentDemoMainUI, PresentDemoControlsUI and PresentDemoModulesUI user interface macros. It also uses the ExtractObjectsCore low-level module. The PresentDemoParams parameter block is used to communicate between these components.

Examples

The PresentDemo project includes two example application. The PresentDemoEg1 example reads a geometry file and display it. This example is intended to be a very simple illustration of how the PresentDemoApp base application can be used.

The PresentDemoEg2 example illustrates how a more complex visualization can be presented as a demonstration. The demonstration control panel includes 2 application controls, a slider that controls the level of the isosurface and a toggle that runs the advection. This example is also based on the PresentDemoApp base application.

Files

iac_proj/p_demo/pdemmods.v contains the V definition of the PresentDemoParams parameter block.

iac_proj/p_demo/pdemmacs.v contains the V definitions of the PresentDemoMainUI, PresentDemoControlsUI and PresentDemoModulesUI user interface macros and the present_demo user macro.

iac_proj/p_demo/pdemapps.v contains the V definitions of the PresentDemoApp base application, and the PresentDemoEg1 and PresentDemoEg2 example applications.

Prerequisites

The PresentDemo project relies on the successful installation of the following components. Without them the project will not function correctly.

Other Notes

This project was initially inspired by some code created by Ian Curington for the multi-pipe edition demonstration disk. Some of the methods and techniques used in this project where taken from this code.

The PresentDemo project does not contain any procedural code and hence the process it executes in is not important. The ExtractObjects project executes under the process specified in the ExtractObjectsMod library.

Author

Andrew Dodd,
International AVS Centre

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also