1.0 Introduction

2.0 MFC's Document/View Paradigm

3.0 Main MFC Classes in Multi Document Interface (MDI) Applications 

3.1 Relationships between the MFC MDI Classes

4.0 Integrating HOOPS with MFC 

4.1 Relationships between HOOPS/ MFC GUI Integration Classes


1.0 Introduction

The HOOPS/MFC GUI Integration classes encapsulate the work needed to connect the HOOPS 3D Application Framework to the Microsoft Foundation Classes (MFC). The MFC classes are used by most developers to build MS Windows compliant GUIs. The HOOPS/MFC GUI integration classes configure the HOOPS 3D Graphics System appropriately for the MFC environment and manage application level issues such as:

The HOOPS/MFC GUI integration classes are also designed to work seamlessly with the HOOPS/MVO Class Library.
Return to Index

2.0 MFC's Document/View Paradigm

The MFC toolkit is a hierarchical set of C++ objects designed to ease the task of building graphical user interfaces for the various Microsoft Windows platforms. MFC Objects encapsulate the data and methods defining the behavior of the various user interface elements found in MS Windows applications. As such, programming with the MFC toolkit fundamentally consists of selecting the objects needed to implement the desired user interface, connecting them to each other and finally connecting them to the rest of the application.  The toolkit is based on a Document/View paradigm where the data on which an application operates (creates, modifies, etc.) is said to be the Document and the visual representation of the data in the Document are the Views. Users of programs interact with the Document via one of its Views.  The data in the Document is in the computer's memory and not seen directly by the user of the application. To see the data in the document the application must provide some visual representation to the user - i.e., present a view of the data.  Most 3D applications go beyond viewing static data contained in documents and provide mechanisms for direct and dynamic interaction with a document's data. This includes the creation of new data and modification of existing data as well as dynamic manipulation of the views of the document's data.  The User Interface of the application is the visual elements, provided by MFC, used to invoke and control these data interaction mechanisms. 
Return to Index

3.0 Main MFC Classes for an Multi Document Interface (MDI) application

3.1 Relationships between the MFC MDI Classes

There are four main MFC classes in a Multi Document Interface (MDI) application: 
The navigable diagram below illustrates the relationships between these classes. 


CWinApp

The primary organizing object in the MFC framework is the CWinApp object. Each application has one and only one global instance of this object and all other objects are connected to it. CWinApp is derived from CWinThread, which manages the main event loop of the application. When an MFC-based application program (executable) is launched, the CWinApp object is created, initialized and its Run method is invoked. Application specific initialization and exit functionality are the responsibility of the CWinApp object. 

CMDIFrameWnd

The CFrame object is a container for the applications user interface elements: pull down menus, push buttons (icons), and CView objects. As its name, 'frame', implies the CMDIFrameWnd object manages the layout of the application.  When running in 8-bit mode, the CMDIFrameWnd object manages a color palette which may be shared by all attached CView objects. 

CDocument

CDocument encapsulates the Document part of the Document/View paradigm. Application specific objects are typically connected to the CDocument object. Document objects are typically stored in files on the computer and this object has methods for handling file reading and saving.

CView

CView encapsulates the View part of the Document/View paradigm. Views are associated with CDoc objects. Views contain window 'panes' into which the application 'draws' the representation of the Document's data.  There may be several views of a document but typically only one document per View. This means there may be several CView objects per CDocument object.  

Return to Index

4.0 Integrating HOOPS with MFC

The MFC document/view paradigm parallels the HOOPS Model/View paradigm.  The 3D data the application works with is the HOOPS 'model'. The HOOPS model object consists of a HOOPS segment, it's subsegments, and the geometry and attributes contained in that collection of segments. Views of the model are implemented using HOOPS segments along with a camera and viewing attributes. The application user interacts with the model via one or more views.  The HOOPS View object is an instance of a HOOPS driver segment and must have a connection to an output device, either a windowing system window or a printer. HOOPS can either obtain a window directly or connect to a window created by the application. When building a native user interface the latter approach must be employed.  Integrating HOOPS with MFC consists of logically connecting these objects to their analogous MFC objects and adding functionality specific to the MS Windows operating system. The HOOPS/MFC Classes are derived from the main MFC Classes, and encapsulate this additional functionality. They are accessed via a DLL (hoops_mfc.dll),  export library (hoops_mfc.lib) and several class header files located in the /dev_tools/hoops_mfc directory of the CD installation.  They encapsulate: 
The navigable diagram below illustrates their relationships to each other and the main MFC MDI classes.