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


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-entity). 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.