1.0 Introduction

2.0 Architecture of the Reference Applications


1.0 Introduction

This portion of the documentation focuses on helping you create your application. It assumes that you have read through the HOOPS/3dGS, HOOPS/MVO and HOOPS/GUI Techical Overviews and is broken into three separate sections. The first Creating your Application reviews the steps involved in creating your initial skeleton application depending on the UI toolkit you decided to use. Specifically, if you are planning on using the Microsoft Foundation Classes (MFC) it details how to install the Visual Studio Application Wizard which is included on the HOOPS media. If you are planning on using Qt to create a multi-platform application or MOTIF to create an X11 based application then it points you to the skeleton applications that are included on the media and gives you a brief techical overview of the architecture of the applications. After completing the 'Creating your Application' Section you can expect to have a simple skeleton application created which you will then use to build your application. The skeleton applications are used as the basis for all the work that is done in the 'Tutorials' section below.

The second section Sample Scene Graphs discusses the general concepts for design your graphics database and it does this on a per vertical market basis. For each vertical market we start by reviewing some of the higher level principals involved and then review the scene-graph design of a real-world solution. Some of the specific markets included are MCAD, CAE and AEC. After reviewing this section, the user should have a good understanding of how to author their data. It can then be loaded into the application created in the step above.

The final section Tutorials deals with the implementation of specific functionality within the skeleton application. Issues such as selection, snapping to a grid, 2D/3D geometry creation, and changing render-modes are reviewed here.


2.0 Architecture of the Reference Applications

A common architecture is used throughout the HOOPS/3dAF Reference Applications. The components relate to each other as illustrated in the following diagram.




Diagram 1: HOOPS/3dAF Reference Application Components and Event Flow

The HOOPS/MVO objects form the nucleus of the application. They use a one to one mapping of Model objects to View objects, i.e., each Model has precisely one View.  Though Each View has a set of Operator objects only one of which is "current" at any time. 

The HOOPS/GUI Integration modules connect to the GUI Toolkit's Event Processing Loop and pass user-generated events either directly to the View object or its current Operator. This functionality is part of a module-specific object derived from an object in the GUI toolkit. Their names reflect the naming convention of the GUI toolkit, i.e., for integrating with MFC the HOOPS/MFC objects are called CHoopsDoc and CHoopsView after the MFC CDoc and CView objects; the HOOPS/Qt module creates the HQWidget derived from Qt's QWidget.  While they perform many other functions in addition to the event encapsulation, this function is most pertinent to this discussion and we will refer to them as Event Encapsulator objects.

The View objects have several methods for configuring the View that are attached to "push buttons" in the GUI. Examples of these are methods to fit the View's camera to the extents of the Model object being viewed, selecting the rendering method used when drawing the model, and selecting the View's current Operator.

The mouse and keyboard events generated by the application user via the GUI are encapsulated in a HEventInfo object by the HOOPS/GUI integration module and sent to the current Operator by calling its event handling method for that particular type of event, e.g., OnLButtonDown.  In certain cases extra work is done in the operator class to further classify the event.  For example, the MFC OnMouseMove method breaks out to OnLButtonDownAndMove, OnRButtonDownAndMove, OnLRButtonDownAndMove and OnNoButtonDownAndMove depending on the mouse-state in the HEventInfo structure.  The following diagram illustrates the relationships of these objects and the flow of events between them.

Diagram 2: HOOPS/3dAF Reference Application Main Objects and Event Flow