DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Collapse ModelsModels
Collapse DG Kernel ComponentsDG Kernel Components
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
Collapse ModelModel
Collapse ViewView
Collapse General ComputingGeneral Computing
Collapse Samples and TutorialsSamples and Tutorials
Collapse GraphicsGraphics
Collapse Math ObjectsMath Objects
Collapse DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Search Documentation


MiniCAD Sample

Source code for MiniCAD sample is available in Samples\NET\C# folder of the installation directory. MiniCAD is a form-based application which displays DI model using DG Kernel ActiveX control and allows to modify geometrical parameters of the model.

See also Visual Basic .NET MiniCAD Sample    C++ MiniCAD Sample,   C# Samples,   All samples

Description of MiniCAD Sample

Implementation

Almost all functionality is implemented by MiniCADForm class. Navigation through the interface hierarchy is the most important task. InitModelInfo() method retrieves IModel  interface, which is stored in m_iModel field. 

                m_iModel = axKernCADnet1.GetModel();

Interface to the current entity is kept into m_iEntity. It is obtained by UpdateSectInfo() method,  using call

m_iEntity = m_iModel.GetEntity(m_nCurSect);

The same method MiniCADForm.UpdateSectInfo() acquires IAxiBase interface using call

m_iAxiBase = (KernCADnet.IAxiBase)m_iEntity;

Prior to that we query the entity type with

m_strSectType = m_iEntity.GetEntityType();

to check if the entity is a "3DSection". Otherwise it is a Surface of Revolution, which does not have base. 

We can query two more interfaces, namely  I3DObject and IStrip from m_iEntity. This is the last job done in MiniCADForm.UpdateSectInfo(). Note that IStrip interface m_iStrip is implemented by object which represents cross-entity segment strip in case of Generic 3D Object and profile segment strip in case of Surface Of Revolution.

Actual geometry changes are done in buttonApply_Click() handler through IElement interfaces which are kept in m_iElemJoint and m_iElemSegment members. These are obtained by UpdateJointInfo() and UpdateSegmentInfo() methods.

The best method to analyze the implementation is to step through the code in debugger, starting from MiniCADForm_Load() handler.