KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > Programming Samples and Tutorials > C++ Samples > Turbine Sample
Turbine C++ Sample

Turbine Sample

Source code for Turbine sample is available in Samples\VC folder of the installation directory. If you are going to compile the project we suggest to copy whole VC directory to location outside of the installation folder. Turbine is an MFC dialog-based application which displays simplified model of a turbine using KernelCAD ActiveX control and allows to modify geometrical parameters of the model.

Turbine sample demonstrates usage of three-tier design of an application which incorporates 3D simulation.. In addition to GUI and KernelCAD software tiers presented in the previous samples Turbine sample adds layer of classes which encapsulates business or rather geometrical logic of the simulated process.   

Implementation

Specifics of this sample is that the application uses two additional classes which isolate geometrical relations of the model into separate classes, namely Turbine and Blade classes. This separations helps isolate essential business logic of the process, which helps with maintenance of the application and makes it more reusable and less dependant on both User Interface side and 3D graphical component (KernelCAD software).

Roles of classes:

CTubnineDlg - implements the GUI layer. CTubnineDlg does not know anything about the geometry of the model. It just displays parameters, takes their new values and passes it to the Geometry layer. This work is done in CTurbineDlg::UpdateModel() method. It also takes display parameters from the geometrical layer and updates the dialog. This is done by CTurbineDlg::UpdatePage().

Turbine class. The highest level class in the geometrical layer is Turbine class. It keeps most important parameters of the geometry, which are familiar and useful to the End User . It also knows how to converts these parameters into calls to KernelCAD software interfaces. Another role of the geometry layer is to validate and handle invalid user input.

Blade class handles jobs related to a particular part of the model. This separation and delegation of roles employs benefits of Object Oriented approach, which is especially important in case of complicated processes and geometries.

See also Visual C++ Samples, All samples