migrate doc to wwwroot.

This commit is contained in:
2025-04-14 17:05:35 +08:00
parent 9246bd6c41
commit f2ab7fe546
10 changed files with 97 additions and 6 deletions
+5
View File
@@ -4,6 +4,11 @@ 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)]
+5
View File
@@ -5,6 +5,11 @@ using Hi.Coloring;
namespace Sample.Disp
{
/// <summary>
/// Demonstrates the use of discrete RGB colors for rendering multiple objects.
/// Shows how to apply different colors to similar geometric shapes using the
/// <see cref="ColorUtil.GetDiscreteRGB_Env"/> method from <see cref="ColorUtil"/> class.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoDiscreteRgb.cs)]
+24
View File
@@ -6,12 +6,21 @@ using Hi.Coloring;
namespace Sample.Disp
{
/// <summary>
/// Demonstrates various drawing techniques using the HiAPI graphics system.
/// Provides examples of primitive drawing, attribute specification, and rendering options.
/// Includes methods for drawing lines, points, triangles, and other geometric primitives.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoDrawing.cs)]
/// </remarks>
public static class DemoDrawing
{
/// <summary>
/// Demonstrates simple line drawing using raw vertex coordinates.
/// Creates a basic line strip from three vertices and displays it using DemoUtil.
/// </summary>
public static void FreeDrawing()
{
#region DocSite.FreeDrawing
@@ -24,6 +33,11 @@ namespace Sample.Disp
#endregion
}
/// <summary>
/// Demonstrates various types of line drawing techniques.
/// Shows how to create points, line strips, line strips with normals, and colored line strips.
/// Illustrates different ways to specify vertex attributes like position, color, and normal.
/// </summary>
public static void DrawLines()
{
List<Vec3d> ps;
@@ -95,6 +109,11 @@ namespace Sample.Disp
, drawLineStripWithNormal, drawLineStripWithColor));
}
/// <summary>
/// Demonstrates drawing triangles using OpenGL primitives.
/// Shows how to create colored triangles (CV) and colored triangles with normals (CNV).
/// Illustrates packing of vertex attributes (color, normal, position) into arrays for rendering.
/// </summary>
public static void DrawTrianglesByPrimitives()
{
int n = 10;// triangle num
@@ -151,6 +170,11 @@ namespace Sample.Disp
new DispList(new RgbTreat(1, 0, 0), drawTrisCV, drawTrisCNV));
}
/// <summary>
/// Demonstrates drawing 3D triangles using the Tri3d helper class.
/// Creates a series of triangles and renders them as both face (filled) and line (wireframe) drawings.
/// Shows how to apply different colors to faces and lines of the same geometry.
/// </summary>
public static void DrawTri3d()
{
int n = 10;
+11 -2
View File
@@ -4,6 +4,11 @@ using Hi.Native;
namespace Sample.Disp
{
/// <summary>
/// Demonstrates basic object picking with mouse interaction in the HiAPI system.
/// Shows how to create a pickable 3D object that responds to mouse events by changing its appearance.
/// Implements the Pickable base class to enable mouse event handling.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoPick1.cs)]
@@ -34,8 +39,12 @@ namespace Sample.Disp
public override void OnMouseLeave(ui_event_type e, panel_state_t state)
{
isMouseOver = false;
}
public static void Main()
}
/// <summary>
/// Entry point for the DemoPick1 example.
/// Creates and displays a simple pickable object that changes color on mouse hover.
/// </summary>
static void Main()
{
DemoUtil.RunApplication("DemoPick1", new DemoPick1());
}
+12 -1
View File
@@ -5,6 +5,11 @@ using Hi.Coloring;
namespace Sample.Disp
{
/// <summary>
/// Demonstrates advanced object picking with multiple pickable objects.
/// Shows how to create and manage multiple pickable objects with different visual appearances.
/// Implements proper resource cleanup through the IDisposable interface.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoPick2.cs)]
@@ -59,7 +64,13 @@ namespace Sample.Disp
Dispose(true);
}
#endregion
public static void Main()
/// <summary>
/// Entry point for the DemoPick2 example.
/// Creates and displays multiple pickable objects with distinct colors and positions.
/// Demonstrates separation of picking behavior from visual representation.
/// </summary>
static void Main()
{
DemoUtil.RunApplication("DemoPick2", new DemoPick2());
}
+14
View File
@@ -4,6 +4,11 @@ using System;
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)]
@@ -13,6 +18,10 @@ namespace Sample.Disp
private readonly Drawing draw;
private readonly ShowEventPickable pickable;
/// <summary>
/// Initializes a new instance of DemoPickable.
/// Creates a pickable triangle with a specific picking ID for user interaction.
/// </summary>
public DemoPickable()
{
pickable = new ShowEventPickable();
@@ -36,6 +45,11 @@ namespace Sample.Disp
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()
{
+5
View File
@@ -3,6 +3,11 @@ using Hi.Disp;
namespace Sample.Disp
{
/// <summary>
/// Demonstrates a simple solar system animation using <see cref="IDisplayee"/> interface.
/// Shows how to create a hierarchical transform structure with sun, earth and moon using
/// <see cref="Mat4d"/> matrices and model matrix stack transformations.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoSatellite.cs)]
+4
View File
@@ -4,6 +4,10 @@ using Hi.Disp;
namespace Sample.Disp
{
/// <summary>
/// Demonstrates the loading, manipulation, and display of STL (stereolithography) files in HiAPI.
/// Shows operations like loading STL data, transforming geometries, and basic visualization.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoStl.cs)]
+12
View File
@@ -6,12 +6,24 @@ using System.Windows;
namespace Sample.Disp
{
/// <summary>
/// Provides utility functions for running HiAPI display examples in a WPF environment.
/// Contains helper methods that simplify the setup and execution of WPF applications with HiAPI rendering.
/// Handles common initialization and cleanup tasks for visualization examples.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoUtil.cs)]
/// </remarks>
public static class DemoUtil
{
/// <summary>
/// Creates and runs a WPF application with a RenderingWindow to display 3D content.
/// Handles proper initialization and cleanup of HiAPI resources including MongoDB server,
/// display engine, and licensing.
/// </summary>
/// <param name="title">The title for the application window</param>
/// <param name="displayee">The object that implements IDisplayee to be rendered</param>
public static void RunApplication(string title, IDisplayee displayee)
{
Application app = new Application();