fix cubetree init crash.

This commit is contained in:
iamboss 2026-02-17 15:52:01 +08:00
parent 6931bbdc97
commit bb10b6e34d
2 changed files with 37 additions and 37 deletions

View File

@ -1,6 +1,7 @@
using Hi.Geom; using Hi.Disp;
using Hi.Geom;
using Hi.WpfPlus.Disp;
using System; using System;
using Hi.Disp;
namespace Sample.Disp namespace Sample.Disp
{ {
@ -41,7 +42,7 @@ namespace Sample.Disp
Console.WriteLine("bouindingbox.Min: " + bouindingbox.Min); Console.WriteLine("bouindingbox.Min: " + bouindingbox.Min);
Console.WriteLine("bouindingbox.Max: " + bouindingbox.Max); Console.WriteLine("bouindingbox.Max: " + bouindingbox.Max);
Console.WriteLine("bouindingbox.Center: " + bouindingbox.Center); Console.WriteLine("bouindingbox.Center: " + bouindingbox.Center);
DispUtil.CallRenderingFrame("DemoForm", stl.ToFaceDrawing()); DispFrameUtil.Call("DemoForm", stl.ToFaceDrawing());
#endregion #endregion
} }

View File

@ -4,39 +4,38 @@ using Hi.Licenses;
using Hi.WpfPlus.Disp; using Hi.WpfPlus.Disp;
using System.Windows; using System.Windows;
namespace Sample.Disp 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> /// <summary>
/// Provides utility functions for running HiAPI display examples in a WPF environment. /// Creates and runs a WPF application with a RenderingWindow to display 3D content.
/// Contains helper methods that simplify the setup and execution of WPF applications with HiAPI rendering. /// Handles proper initialization and cleanup of HiAPI resources including MongoDB server,
/// Handles common initialization and cleanup tasks for visualization examples. /// display engine, and licensing.
/// </summary> /// </summary>
/// <remarks> /// <param name="title">The title for the application window</param>
/// ### Source Code /// <param name="displayee">The object that implements IDisplayee to be rendered</param>
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoUtil.cs)] public static void RunApplication(string title, IDisplayee displayee)
/// </remarks> {
public static class DemoUtil LocalApp.AppBegin();
{ Application app = new Application();
/// <summary> app.Exit += (o, e) =>
/// Creates and runs a WPF application with a RenderingWindow to display 3D content. {
/// Handles proper initialization and cleanup of HiAPI resources including MongoDB server, LocalApp.AppEnd();
/// display engine, and licensing. };
/// </summary> app.Run(new RenderingWindow()
/// <param name="title">The title for the application window</param> {
/// <param name="displayee">The object that implements IDisplayee to be rendered</param> Title = title,
public static void RunApplication(string title, IDisplayee displayee) Displayee = displayee
{ });
LocalApp.AppBegin(); }
Application app = new Application();
app.Exit += (o, e) =>
{
LocalApp.AppEnd();
};
app.Run(new RenderingWindow()
{
Title = title,
Displayee = displayee
});
}
}
} }