From 2e52f10a2cccb1471859b05e0d0e9dd9649859c8 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期四, 03 四月 2025 13:36:07 +0800 Subject: [PATCH] 封装HelixToolkit.Core.Wpf水力管网模型展示 --- Yw.WinFrmUI.Hydro.L3d.Core/02-helper/05-network/Network2dExtensions.cs | 26 ++++++++++++++++++++++---- 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Yw.WinFrmUI.Hydro.L3d.Core/02-helper/05-network/Network2dExtensions.cs b/Yw.WinFrmUI.Hydro.L3d.Core/02-helper/05-network/Network2dExtensions.cs index f74559b..3350e05 100644 --- a/Yw.WinFrmUI.Hydro.L3d.Core/02-helper/05-network/Network2dExtensions.cs +++ b/Yw.WinFrmUI.Hydro.L3d.Core/02-helper/05-network/Network2dExtensions.cs @@ -1,4 +1,6 @@ -锘縩amespace Yw.WinFrmUI.Hydro +锘縰sing OpenTK.Graphics.ES20; + +namespace Yw.WinFrmUI.Hydro { /// <summary> /// @@ -8,7 +10,7 @@ /// <summary> /// 缁樺埗2d /// </summary> - public static void Draw2d(this NetworkL3d nw) + public static void Draw2d(this NetworkL3d nw, float zoom) { if (nw == null) { @@ -16,12 +18,28 @@ } nw.Links.ForEach(x => { - x.Draw2d(); + if (x is PumpL3d pump) + { + pump.Draw2d(zoom); + } + else + { + x.Draw2d(); + } + }); nw.Nodes.ForEach(x => { - x.Draw2d(); + if (x is SourceL3d source) + { + source.Draw2d(zoom); + } + else + { + x.Draw2d(); + } + }); } -- Gitblit v1.9.3