add docfx samples.
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using Hi.Geom;
|
||||
using Hi.Disp;
|
||||
using System;
|
||||
using Hi.Coloring;
|
||||
|
||||
namespace Sample.Disp
|
||||
{
|
||||
/// <remarks>
|
||||
/// ### Source Code
|
||||
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoPick2.cs)]
|
||||
/// </remarks>
|
||||
public class DemoPick2 : IDisplayee, IDisposable
|
||||
{
|
||||
readonly Pickable pickableA = new ShowEventPickable { Tag = "A" };
|
||||
readonly Pickable pickableB = new ShowEventPickable { Tag = "B" };
|
||||
readonly Pickable pickableC = new ShowEventPickable { Tag = "C" };
|
||||
/// <inheritdoc/>
|
||||
public void Display(Bind bind)
|
||||
{
|
||||
bind.PickID = pickableA.PickingID;
|
||||
bind.RGB = ColorUtil.GetDiscreteRgb(1);
|
||||
new Box3d(0, 0, 0, 1, 1, 1).DisplayFace(bind);
|
||||
|
||||
bind.PickID = pickableB.PickingID;
|
||||
bind.RGB = ColorUtil.GetDiscreteRgb(2);
|
||||
new Box3d(0, 0, 1, 1, 1, 2).DisplayFace(bind);
|
||||
|
||||
bind.PickID = pickableC.PickingID;
|
||||
bind.RGB = ColorUtil.GetDiscreteRgb(3);
|
||||
new Box3d(0, 0, 2, 1, 1, 3).DisplayFace(bind);
|
||||
|
||||
bind.PickID = 0;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public void ExpandToBox3d(Box3d dst)
|
||||
{
|
||||
dst.Expand(new Vec3d(0, 0, 0));
|
||||
dst.Expand(new Vec3d(1, 1, 3));
|
||||
}
|
||||
#region IDisposable Support
|
||||
private bool disposedValue = false; // To detect redundant calls
|
||||
/// <inheritdoc/>
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (!disposedValue)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
pickableA.Dispose();
|
||||
pickableB.Dispose();
|
||||
pickableC.Dispose();
|
||||
}
|
||||
disposedValue = true;
|
||||
}
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
#endregion
|
||||
public static void Main()
|
||||
{
|
||||
DemoUtil.RunApplication("DemoPick2", new DemoPick2());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user