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


Pipes Sample

Overview

Implementation

Model of the sample is constructed dynamically at runtime so the ModelPath property of the DG Kernel control is empty. Construction of the model starts in UpdateModelInfo function.

In DefineCentralCurveGeometry() ICurveFreeForm::GetData() is used to asses IArray3D of data points. After which the central line is an arc or radius 100 in x, z plane from (0, 100, 0) to (-100, 100, 100) extended with a straight line from (100, -200, 0) to (100, 0, 0) and an arc or radius 100 in x, y plane from (100, 0, 0) to (0, 100, 0).

Notice the way array of spline frames IFrameArray is accessed in PipesDlg::UpdateSplineFrame(). 

SplineDlg::UpdateFrameInfo() repeats the action. The obtained frame is used in SplineDlg::ToGlobal() to convert local 2D coordinates in x , y in the plane to global coordinates. 

PipesDlg::OnClientDraw() is probably the least intuitive places in the program. As geometry of the curve is defined relative to the local frame of the pipe it is simple to make the frame current using IDraw2::SetCurrentFrame(). The same procedure is repeated in PipesDlg::DrawSplineAttributes() to draw the local frame of the spline.