style(demos): file-scoped namespace + reindent DemoPickable

This commit is contained in:
iamboss 2026-06-27 19:16:45 +08:00
parent 523d1b6733
commit 3c4f552d5a

View File

@ -2,60 +2,57 @@
using Hi.Geom; using Hi.Geom;
using System; using System;
namespace Sample.Disp namespace Sample.Disp;
/// <summary>
/// Demonstrates creation of pickable 3D geometry at the primitive level.
/// Shows how to assign picking IDs directly to geometry vertices and create interactive triangles.
/// Uses a lower-level approach than the Pickable base class for more precise control.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoPickable.cs)]
/// </remarks>
public class DemoPickable : IDisplayee
{ {
/// <summary> private readonly Drawing draw;
/// Demonstrates creation of pickable 3D geometry at the primitive level. private readonly ShowEventPickable pickable;
/// Shows how to assign picking IDs directly to geometry vertices and create interactive triangles.
/// Uses a lower-level approach than the Pickable base class for more precise control. /// <summary>
/// </summary> /// Initializes a new instance of DemoPickable.
/// <remarks> /// Creates a pickable triangle with a specific picking ID for user interaction.
/// ### Source Code /// </summary>
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoPickable.cs)] public DemoPickable()
/// </remarks>
public class DemoPickable : IDisplayee
{ {
private readonly Drawing draw; pickable = new ShowEventPickable();
private readonly ShowEventPickable pickable; double pid = pickable.PickingID;
double[] vs = new double[] {
/// <summary> //pickID, x,y,z
/// Initializes a new instance of DemoPickable. pid, 0,0.1,0.1,
/// Creates a pickable triangle with a specific picking ID for user interaction. pid, 0.1,0,0,
/// </summary> pid, 0.1,0,0.1
public DemoPickable() };
{ draw = new Drawing(vs, Stamp.PV, GL.GL_TRIANGLES);
pickable = new ShowEventPickable(); }
double pid = pickable.PickingID; /// <inheritdoc/>
double[] vs = new double[] { public void Display(Bind bind)
//pickID, x,y,z {
pid, 0,0.1,0.1, draw.Display(bind);
pid, 0.1,0,0, }
pid, 0.1,0,0.1 /// <inheritdoc/>
}; public void ExpandToBox3d(Box3d dst)
draw = new Drawing(vs, Stamp.PV, GL.GL_TRIANGLES); {
} draw.ExpandToBox3d(dst);
/// <inheritdoc/>
public void Display(Bind bind)
{
draw.Display(bind);
}
/// <inheritdoc/>
public void ExpandToBox3d(Box3d dst)
{
draw.ExpandToBox3d(dst);
}
/// <summary>
/// Entry point for the DemoPickable example.
/// Creates and displays a pickable triangle that can respond to mouse events.
/// Demonstrates integration of picking functionality with geometric primitives.
/// </summary>
[STAThread]
public static void Main()
{
DemoUtil.RunApplication("DemoPickable", new DemoPickable());
}
} }
/// <summary>
/// Entry point for the DemoPickable example.
/// Creates and displays a pickable triangle that can respond to mouse events.
/// Demonstrates integration of picking functionality with geometric primitives.
/// </summary>
[STAThread]
public static void Main()
{
DemoUtil.RunApplication("DemoPickable", new DemoPickable());
}
} }