54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
using Hi.Disp;
|
|
using Hi.Geom;
|
|
using System;
|
|
|
|
namespace Sample.Disp
|
|
{
|
|
/// <summary>
|
|
/// Demonstrates the creation and visualization of <see cref="Cylindroid"/> objects.
|
|
/// Includes examples of building a <see cref="Cylindroid"/> programmatically with
|
|
/// <see cref="PairZr"/> points and serializing/deserializing via XML.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// ### Source Code
|
|
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoCylindroid.cs)]
|
|
/// </remarks>
|
|
public static class DemoCylindroid
|
|
{
|
|
internal static void BuildCylindorid()
|
|
{
|
|
Cylindroid cylindroid = new Cylindroid(24,
|
|
new PairZr(0, 1),
|
|
new PairZr(1, 1),
|
|
new PairZr(1, 2),
|
|
new PairZr(2, 2),
|
|
new PairZr(8, 3));
|
|
|
|
DispEngine.Init();
|
|
DemoUtil.RunApplication("BuildCylindorid", cylindroid.ToFaceDrawing());
|
|
}
|
|
|
|
internal static void TestCylindoridXml()
|
|
{
|
|
Cylindroid cylindroid = new Cylindroid(24,
|
|
new PairZr(0, 1),
|
|
new PairZr(1, 1),
|
|
new PairZr(1, 2),
|
|
new PairZr(2, 2),
|
|
new PairZr(4, 3));
|
|
var xmlElement = cylindroid.MakeXmlSource(null, null);
|
|
Console.WriteLine("XML:" + xmlElement);
|
|
|
|
cylindroid = new Cylindroid(xmlElement);
|
|
DispEngine.Init();
|
|
DemoUtil.RunApplication("BuildCylindorid", cylindroid.ToFaceDrawing());
|
|
}
|
|
|
|
static void Main()
|
|
{
|
|
BuildCylindorid();
|
|
//TestCylindoridXml();
|
|
}
|
|
}
|
|
}
|