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 > Profile Sample
VC Profile Sample

Profile Sample

Source code for Profile sample is available in Samples\VC folder of the installation directory. It is recommended to copy whole VC directory to location outside of the installation folder before loading or compilation. Profile is an MFC application, which demonstrates usage of IProfiles interface

See also C# Profile Sample,   Visual C++ Samples,    All samples

Running the application  

The Element radio buttons allow to selection of an element in the surface strip, which is of a simplest kind in this case. It consists of a single patch and its two left and right edges.

Parameters group allow selecting a parameter in the current element. Parameters of an edge are x and y coordinates (coordinates in cross-section). The patch element has a single parameter - its curvature.

Profile group of controls allows selection of an axial knot and modification of the profile of the current parameter at the selected knot. "Add New" button creates new knot in the middle of the current axial segment (segment between the current and the next knot).

"Current Axial Segment" group allows changing type of the current axial element in the profile and changing its curvature. Note that curvature can be negative.

Note that changing axial element type and adding a new knot are topological operations. They are available in Pro level products only,  otherwise the correspondent interfaces will not be obtained and relevant controls in the dialog will be disabled.

Implementation

All implementation is contained in the main dialog class CProfileDlg. CProfileDlg::OnInitDialog() function obtains main interfaces ISection, IStrip and IAxiBase of the only object in the model. 

Update...() set of functions:

  • UpdateElemInfo()
  • UpdateParamsInfo()
  • UpdateProfileInfo()
  • UpdateAxialElementInfo()
  • UpdateProfileValue()
  • UpdateAxiSegmParameter()

call each other from top to bottom. This structure follows structure of the model and layout of controls in the dialog. When some control has been changed all controls below have to be updated.

The most specific to this sample interface IProfiles is obtained in  UpdateProfileInfo() by queering from the current IElement.

Another interesting interface IStripTopol is obtained in UpdateAxialElementInfo(). The interface is used in OnRbTypeArc() and OnRbTypeLine() to change type of the current axial line().

OnButtNewKnot() handler obtains IArray interface from IAxiBAse and uses it to insert a new knot in the middle of the current segment.