Home Page > Programming Samples and Tutorials > Delphi Samples > Patch
Patch Native Delhpi Sample
Patch Delphi Sample
Source code for Patch sample is available in Samples\Delphi
folder of the installation directory. Patch is a simple form-based application, which
displays a DInsight model consisting of a single patch of surface using KernelCAD ActiveX control and allows to modify geometrical parameters of the
model
Running the application
Patch application loads ArcPatch.glm located in the Models folder of the
installation directory. The
dialog displays parameters, which can be modified to assign any shape valid for a
model with single cross-sectional element (See Elements).
To be able to compare behavior, two edges of ArcPatch.glm are not of the same type. The first edge (the right one) consists of arcs. The second edge
consists of straight line elements. The first edit box "Cross-section
position" specifies z coordinate for cross-sectional plane where all other
parameter modifications will be applied. The next four edit boxes allow
modification of coordinates of edge in the cross-section plane. Note that type of
modifications is different depending whether the cross-section position is at the end (
z=0 or z=10 ) or anywhere in the middle of the axial range.
Note that curvature can be negative. Valid range for the curvature is [-cMax,
cMax], where cMax is 1/ (half distance between the edges at the current
cross-section)
To enter new value of the parameters press "Apply" button. If entered values are
valid, the model will change in 3D.
Implementation
All the work is done inside TPatchForm module. TPatchForm.OnFormShow()
accesses necessary interfaces, controlling geometry of the model via IModel interface,
which is obtained using GetModel
method of KernelCAD control.
Modifications of the surface are performed in TPatchForm.OnApply handler
using SetParam methods of IElement interface..
See also KernelCAD and Delphi, Delphi Samples,
Visual C++ Samples,
All samples.
|