diff --git a/Disp/DemoCylindroid.cs b/Disp/DemoCylindroid.cs index d1a4683..e22096e 100644 --- a/Disp/DemoCylindroid.cs +++ b/Disp/DemoCylindroid.cs @@ -4,6 +4,11 @@ using System; namespace Sample.Disp { + /// + /// Demonstrates the creation and visualization of objects. + /// Includes examples of building a programmatically with + /// points and serializing/deserializing via XML. + /// /// /// ### Source Code /// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoCylindroid.cs)] diff --git a/Disp/DemoDiscreteRgb.cs b/Disp/DemoDiscreteRgb.cs index 2a1fa40..0d8c833 100644 --- a/Disp/DemoDiscreteRgb.cs +++ b/Disp/DemoDiscreteRgb.cs @@ -5,6 +5,11 @@ using Hi.Coloring; namespace Sample.Disp { + /// + /// Demonstrates the use of discrete RGB colors for rendering multiple objects. + /// Shows how to apply different colors to similar geometric shapes using the + /// method from class. + /// /// /// ### Source Code /// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoDiscreteRgb.cs)] diff --git a/Disp/DemoDrawing.cs b/Disp/DemoDrawing.cs index f076a2d..3c08be8 100644 --- a/Disp/DemoDrawing.cs +++ b/Disp/DemoDrawing.cs @@ -6,12 +6,21 @@ using Hi.Coloring; namespace Sample.Disp { + /// + /// 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. + /// /// /// ### Source Code /// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoDrawing.cs)] /// public static class DemoDrawing { + /// + /// Demonstrates simple line drawing using raw vertex coordinates. + /// Creates a basic line strip from three vertices and displays it using DemoUtil. + /// public static void FreeDrawing() { #region DocSite.FreeDrawing @@ -24,6 +33,11 @@ namespace Sample.Disp #endregion } + /// + /// 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. + /// public static void DrawLines() { List ps; @@ -95,6 +109,11 @@ namespace Sample.Disp , drawLineStripWithNormal, drawLineStripWithColor)); } + /// + /// 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. + /// 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)); } + /// + /// 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. + /// public static void DrawTri3d() { int n = 10; diff --git a/Disp/DemoPick1.cs b/Disp/DemoPick1.cs index ded202e..5ed4328 100644 --- a/Disp/DemoPick1.cs +++ b/Disp/DemoPick1.cs @@ -4,6 +4,11 @@ using Hi.Native; namespace Sample.Disp { + /// + /// 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. + /// /// /// ### 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() + } + /// + /// Entry point for the DemoPick1 example. + /// Creates and displays a simple pickable object that changes color on mouse hover. + /// + static void Main() { DemoUtil.RunApplication("DemoPick1", new DemoPick1()); } diff --git a/Disp/DemoPick2.cs b/Disp/DemoPick2.cs index 6c583dc..f89cfa7 100644 --- a/Disp/DemoPick2.cs +++ b/Disp/DemoPick2.cs @@ -5,6 +5,11 @@ using Hi.Coloring; namespace Sample.Disp { + /// + /// 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. + /// /// /// ### 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() + + /// + /// 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. + /// + static void Main() { DemoUtil.RunApplication("DemoPick2", new DemoPick2()); } diff --git a/Disp/DemoPickable.cs b/Disp/DemoPickable.cs index bd832ff..abca6e1 100644 --- a/Disp/DemoPickable.cs +++ b/Disp/DemoPickable.cs @@ -4,6 +4,11 @@ using System; namespace Sample.Disp { + /// + /// 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. + /// /// /// ### 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; + /// + /// Initializes a new instance of DemoPickable. + /// Creates a pickable triangle with a specific picking ID for user interaction. + /// public DemoPickable() { pickable = new ShowEventPickable(); @@ -36,6 +45,11 @@ namespace Sample.Disp draw.ExpandToBox3d(dst); } + /// + /// 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. + /// [STAThread] public static void Main() { diff --git a/Disp/DemoSatellite.cs b/Disp/DemoSatellite.cs index e7d12cb..75ed94e 100644 --- a/Disp/DemoSatellite.cs +++ b/Disp/DemoSatellite.cs @@ -3,6 +3,11 @@ using Hi.Disp; namespace Sample.Disp { + /// + /// Demonstrates a simple solar system animation using interface. + /// Shows how to create a hierarchical transform structure with sun, earth and moon using + /// matrices and model matrix stack transformations. + /// /// /// ### Source Code /// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoSatellite.cs)] diff --git a/Disp/DemoStl.cs b/Disp/DemoStl.cs index 7c64b7b..25dc1b3 100644 --- a/Disp/DemoStl.cs +++ b/Disp/DemoStl.cs @@ -4,6 +4,10 @@ using Hi.Disp; namespace Sample.Disp { + /// + /// Demonstrates the loading, manipulation, and display of STL (stereolithography) files in HiAPI. + /// Shows operations like loading STL data, transforming geometries, and basic visualization. + /// /// /// ### Source Code /// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoStl.cs)] diff --git a/Disp/DemoUtil.cs b/Disp/DemoUtil.cs index 10602a4..9d0bb39 100644 --- a/Disp/DemoUtil.cs +++ b/Disp/DemoUtil.cs @@ -6,12 +6,24 @@ using System.Windows; namespace Sample.Disp { + /// + /// 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. + /// /// /// ### Source Code /// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoUtil.cs)] /// public static class DemoUtil { + /// + /// 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. + /// + /// The title for the application window + /// The object that implements IDisplayee to be rendered public static void RunApplication(string title, IDisplayee displayee) { Application app = new Application(); diff --git a/Machining/DemoRenderingMachiningProcessAndStripPosSelection.cs b/Machining/DemoRenderingMachiningProcessAndStripPosSelection.cs index 5a989da..6a0d96a 100644 --- a/Machining/DemoRenderingMachiningProcessAndStripPosSelection.cs +++ b/Machining/DemoRenderingMachiningProcessAndStripPosSelection.cs @@ -11,7 +11,9 @@ using Hi.Disp; namespace Sample.Machining { /// - /// This example demonstrates how to integrate HiAPI's machining visualization capabilities into a WPF application. It utilizes the Hi.Wpf.Disp namespace to render machining processes in a 3D environment and implement user interaction features like strip position selection. The sample shows how to set up the rendering pipeline, handle camera controls, and connect machining data with the visualization system. This example is essential for developers building interactive CAM applications that require both rich visualization capabilities and user interaction with the machining model. + /// Demonstrates integration of machining process visualization with interactive strip position selection. + /// Shows how to load a machining project, configure rendering options, and implement user interaction. + /// Provides a complete example of a 3D visualization application with HiAPI and WPF. /// /// /// ### Source Code @@ -20,7 +22,7 @@ namespace Sample.Machining public static class DemoRenderingMachiningProcessAndStripPosSelection { [STAThread] - public static void Main(string[] args) + static void Main(string[] args) { #region Initialize Environment License.LogInAll(); @@ -36,7 +38,7 @@ namespace Sample.Machining Console.WriteLine($"Load Project: {projectPath}"); MachiningProject machiningProject = MachiningProject.LoadFile(projectPath); - machiningProject.ShellApi.MillingStepSelected += (MillingStep step) => + machiningProject.ShellApi.MillingStepSelected += (MachiningStep step) => { var sourceCommand = step.SourceCommand; Console.WriteLine($"Step Selected: MRR = {step.Mrr_mm3ds} At \"{sourceCommand?.FilePath}\" (Line {sourceCommand?.GetLineNo()}) \"{sourceCommand?.Line}\"");