Example Application Source Code   

<<< Running the Example Application Chapters

Contents

[back to top]


3.1 Class structure

The Example Application contains the following 7 classes:

Classes

Description

CMyCode

This is the class where you should add your own Parasolid application code.

CSession

This class incorporates the code responsible for starting and stopping Parasolid. It registers the frustrum and starts the session as well as registering the error handler. See Chapter 4, "The Example Application", in Getting Started With Parasolid, for more details.

CAboutDlg
CExampleAppApp
CExampleAppDoc
CExampleAppView
CMainFrame

These classes are part of the MFC framework.

The graphical output (GO) functions and helper functions are in CExampleAppDoc, while the rest are in CExampleAppView. See Chapter 4, "The Example Application", in Getting Started With Parasolid, for more details.

You can ignore CAboutDlg (which contains code for the application's About dialog) and CMainFrame (which contains only MFC-generated code).

The relationships between the classes and the functional areas of each are detailed in Figure 3-1.

 

Figure 3-1 Relationships between the classes in the Example Application

[back to top]


3.2 File structure

The classes in the Example Application are split across the following files, containing the functionality shown.

 

File

Description

Example App

Initializes the MFC application. Creates a new CSession object.

Example AppDoc

Initializes the document and registers the graphical output (GO) frustrum functions. Stores a copy of the parts and geometries in the session.

Example AppView

MFC code for initializing the code and handling window events.

MainFrm

Standard MFC file.

GO

Part of the CExampleAppDoc class. It contains the GO functions as well as various helper functions.

OpenGL

Part of the CExampleAppView class. It initializes OpenGL.

Parasolid

Part of the CExampleAppView class. It contains the rendering loop.

Session

Registers the file frustrum and error handler, and starts and stops Parasolid.

MyCode

Contains the class encapsulation for the Parasolid application code you write.

Frustrum

Contains file based frustrum functions.

The relationships between these files and the functionality they contain are shown in Figure 3-2.

 

Figure 3-2 Overview of the files in the Example Application

[back to top]


3.3 Initializing Parasolid

The Example Application initializes Parasolid as follows:

[back to top]


3.4 Executing calls to Parasolid

The following events occur when you click in the Example Application:

ReRender controls the rendering loop in the Example Application.

Each Parasolid rendering function then calls GO functions whch convert the rendering data into OpenGL form and populate the OpenGL display lists. Finally, CExampleAppView::OnDraw clears the screen and traverses the OpenGL display list and displays it to screen.

This sequence of events is illustrated in Figure 3-3.

 

Figure 3-3 Order of events after clicking

 

[back to top]

<<< Running the Example Application Chapters