Lines Sample
Lines Sample demonstrates programming of Line
Strip objects
See also C# .NET Samples, All samples
The application
By default the application loads Lines.mdg with single continuous line strip
of three segments. The form displays all properties of the line strip.
The line strip is closed. It has three underlying points Its
index array is: [0, 1, 2, 0, -1].
When the point count is increased new points are added to the end of the
point array and correspondent index is inserted into the end of the index array.
Turning on the "Per Vertex" check box enables interpolation of the line colors from one end to another.
Implementation
LinesDlg::Init() function obtains
ISectionLineStrip
interface from the first ISection
in the model and gets access to its Point Array by quering it from the
ISectionLineStrip. and storing
it in m_iArray2 variable. To retrieve coordinates of the points
IMatrixData
is obtained with a call to ISectionPointSet.GetPoints.
IMatrixData
implemented by the Color Array is obtained via
ISectionPointSet.GetColors and stored into the m_iMatrixColor variable.
LinesDlg::OnPointCountChanged() handles changes in size of the point array
by adding or removing last points via m_iArray2.
All other operations are comparatively straightforward.
|