1.0 Introduction

2.0 What's a GUI Toolkit?

3.0 Connecting a GUI Toolkit to HOOPS/3dAF


1.0 Introduction

This document reviews the architecture of the HOOPS/GUI Integrations. Some familiarity with HOOPS/MVO and HOOPS/3dGS is assumed.

The HOOPS/GUI Integration modules encapsulate the work needed to connect HOOPS/3dAF to several different Graphical User Interface (GUI) toolkits. The following HOOPS/GUI modules exist:


2.0 What's a GUI Toolkit?

All software applications provide some type of user interface (UI) that enables the user to operate the application. Most applications built for the Windows and UNIX operating systems provide visual-based user interface elements, such as menus and icons, as their UI. These types of user interfaces are typically referred to as a graphical user interface (GUI). An input device attached to the computer is used by the operator of the application to interact with the visual elements of the GUI which in turn cause some code within the application to execute.

Almost all of the GUI toolkits available employ the same basic design, consisting of:

The GUI objects form the visual elements of the GUI that are seen by the application's user, and these are connected to the internal application code. The application user generates events by operating an input device such as a pointer, keyboard, joystick, or data-glove, while looking at the visual elements of the GUI. The input device generates an event which the operating system collects and puts on the GUI's event queue. The event processing loop acquires the event from the event queue, then executes the application functionality that is associated to the GUI object. The following diagram illustrates this event sequence.

Diagram 1. Typical Event Sequence for User Operation of an Application via its Graphical User Interface

While the various OS-specific GUI toolkits are similar in their design and function, their API's are most often quite dissimilar. Therefore, developing an application that will run on multiple operating systems will require either separate GUI toolkit implementations, or cross platform toolkits such as Qt.


3.0 Connecting a GUI Toolkit to HOOPS/3dAF

Each of the HOOPS/GUI integration modules encapsulates the work necessary to connect a GUI toolkit to the HOOPS 3D Application Framework. Specifically, this work involves:

3.1 Creating a Custom Widget

All the GUI toolkits provide some type of widget into which a graphics library can display its geometric output. Integration of a 3rd party graphics library such as the HOOPS/3dGS requires deriving a new class from the standard output widget in the GUI toolkit, adding methods to extract necessary information from the windowing system, and passing the information on to HOOPS. This enables HOOPS to draw into a widget within the GUI toolkit. Each HOOPS/GUI integration module provides just such a custom widget. The custom widgets are made available as linkable libraries or supplied as source code, and can be directly embedded in customer applications.

The diagram below provides an abstract example of how a HOOPS/GUI Widget is derived and connected to MVO objects.

gen_arch

3.2 Connecting to the GUI's Event Processing Loop

The purpose of a GUI is to provide a visual mechanism through which the internal application code can be invoked. This involves building a connection between the visual elements, the widgets, and the application code, so that when the user generates an "event" by clicking on a button or pressing a key, the appropriate application code is invoked.

If a developer wants to use the HOOPS/MVO Classes in an application, user input events must be mapped from the GUI to the HOOPS/MVO HBaseOperator objects. The HOOPS/GUI integration modules encapsulate this mapping logic in their custom widgets. This allows the developer to customize existing HOOPS/MVO Operators or create new ones without knowing what type of GUI will ultimately be used to build the application; MVO and it's operators can remain GUI-independent.

The following diagram shows how several GUI-specific mouse events get passed to their platform/GUI-independent MVO counterparts:

The GUI event information is passed to the HBaseOperator classes via an HEventInfo object: