Yw.Hydraulic.Core.sln
@@ -25,6 +25,8 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yw.WpfUI.Test.Core", "Yw.WpfUI.Test.Core\Yw.WpfUI.Test.Core.csproj", "{0FE901AA-19B5-2F29-5B9C-3A5DD952B1B8}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yw.WinFrmUI.Hydro.L3d2.Core", "Yw.WinFrmUI.Hydro.L3d2.Core\Yw.WinFrmUI.Hydro.L3d2.Core.csproj", "{1EAA9792-8D0F-43E9-A88F-777006746F72}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -131,6 +133,18 @@ {0FE901AA-19B5-2F29-5B9C-3A5DD952B1B8}.Release|x64.Build.0 = Release|Any CPU {0FE901AA-19B5-2F29-5B9C-3A5DD952B1B8}.Release|x86.ActiveCfg = Release|Any CPU {0FE901AA-19B5-2F29-5B9C-3A5DD952B1B8}.Release|x86.Build.0 = Release|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Debug|Any CPU.Build.0 = Debug|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Debug|x64.ActiveCfg = Debug|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Debug|x64.Build.0 = Debug|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Debug|x86.ActiveCfg = Debug|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Debug|x86.Build.0 = Debug|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Release|Any CPU.ActiveCfg = Release|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Release|Any CPU.Build.0 = Release|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Release|x64.ActiveCfg = Release|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Release|x64.Build.0 = Release|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Release|x86.ActiveCfg = Release|Any CPU {1EAA9792-8D0F-43E9-A88F-777006746F72}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -144,6 +158,7 @@ {AAA7D8E8-D013-4273-937A-0491B77C0D67} = {78034B18-DB21-49FB-B111-04E447A69DD9} {32092ECE-4526-CBA4-18F2-B8D27212A0E6} = {07493D58-8012-47FE-990D-BCA1FB8EDA74} {0FE901AA-19B5-2F29-5B9C-3A5DD952B1B8} = {07493D58-8012-47FE-990D-BCA1FB8EDA74} {1EAA9792-8D0F-43E9-A88F-777006746F72} = {78034B18-DB21-49FB-B111-04E447A69DD9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E02989A8-9B6F-43E5-AACA-790328215089} Yw.WinFrmUI.Hydro.L3d2.Core/ViewerL3d2.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,38 @@ namespace Yw.WinFrmUI.Hydro { partial class ViewerL3d2 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { components = new System.ComponentModel.Container(); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); } #endregion } } Yw.WinFrmUI.Hydro.L3d2.Core/ViewerL3d2.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,37 @@ using System.Windows.Forms.Integration; namespace Yw.WinFrmUI.Hydro { public partial class ViewerL3d2 : UserControl { public ViewerL3d2() { InitializeComponent(); } private Yw.WpfUI.Hydro.ViewerL3d _wpfViewer = null;//wpfæ§ä»¶ //åå§åwpfæ§ä»¶ private void InitialWpfControl() { this.Controls.Clear(); var elementHost = new ElementHost(); elementHost.Dock = DockStyle.Fill; this.Controls.Add(elementHost); _wpfViewer = new WpfUI.Hydro.ViewerL3d(); elementHost.Child = _wpfViewer; } /// <summary> /// åå§å /// </summary> public void Initial(Yw.WpfUI.Hydro.NetworkL3d nw) { InitialWpfControl(); _wpfViewer.Initial(nw); } } } Yw.WinFrmUI.Hydro.L3d2.Core/ViewerL3d2.resx
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,120 @@ <?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> </root> Yw.WinFrmUI.Hydro.L3d2.Core/Yw.WinFrmUI.Hydro.L3d2.Core.csproj
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,16 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net6.0-windows</TargetFramework> <Nullable>disable</Nullable> <UseWindowsForms>true</UseWindowsForms> <ImplicitUsings>enable</ImplicitUsings> <OutputType>Library</OutputType> <UseWPF>True</UseWPF> </PropertyGroup> <ItemGroup> <PackageReference Include="Yw.WpfUI.Hydro.L3d.Core" Version="1.0.0" /> </ItemGroup> </Project> Yw.WinFrmUI.Hydro.L3d2.Core/Yw.WinFrmUI.Hydro.L3d2.Core.csproj.user
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Compile Update="ViewerL3d2.cs"> <SubType>UserControl</SubType> </Compile> </ItemGroup> </Project> Yw.WinFrmUI.Test.Core/Form3.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,57 @@ namespace Yw.WinFrmUI.Test.Core { partial class Form3 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { viewerL3d21 = new Yw.WinFrmUI.Hydro.ViewerL3d2(); SuspendLayout(); // // viewerL3d21 // viewerL3d21.Dock = DockStyle.Fill; viewerL3d21.Location = new Point(0, 0); viewerL3d21.Name = "viewerL3d21"; viewerL3d21.Size = new Size(800, 450); viewerL3d21.TabIndex = 0; // // Form3 // AutoScaleDimensions = new SizeF(7F, 17F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(800, 450); Controls.Add(viewerL3d21); Name = "Form3"; Text = "Form3"; ResumeLayout(false); } #endregion private Hydro.ViewerL3d2 viewerL3d21; } } Yw.WinFrmUI.Test.Core/Form3.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,135 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Forms; using Yw.WpfUI.Hydro; using Yw.Epanet; namespace Yw.WinFrmUI.Test.Core { public partial class Form3 : Form { public Form3() { InitializeComponent(); this.Load += Form3_Load; } private void Form3_Load(object sender, EventArgs e) { var nw = LoadEpaNetwork(); var nw3d = Get3dNetwork(nw); this.viewerL3d21.Initial(nw3d); } private Yw.Epanet.Network LoadEpaNetwork() { var fileName = "wh.inp"; var nw = new Yw.Epanet.Network().ParseInpFile(fileName); return nw; } private NetworkL3d Get3dNetwork(Yw.Epanet.Network nw) { string msg = null; var nw3d = new NetworkL3d(); foreach (var tank in nw.Tanks) { var tank3d = new TankL3d(); tank3d.Id = tank.Id; tank3d.Name = tank.Name; tank3d.Position = new PointL3d() { X = (float)tank.Position.X, Y = (float)tank.Position.Y, Z = (float)tank.GetElev() }; nw3d.Append(tank3d, out msg); } foreach (var junction in nw.Junctions) { var junction3d = new JunctionL3d(); junction3d.Id = junction.Id; junction3d.Name = junction.Name; junction3d.Position = new PointL3d() { X = (float)junction.Position.X, Y = (float)junction.Position.Y, Z = (float)junction.GetElev() }; nw3d.Append(junction3d, out msg); } foreach (var pipe in nw.Pipes) { var pipe3d = new PipeL3d(); pipe3d.Id = pipe.Id; pipe3d.Name = pipe.Name; pipe3d.StartPosition = new PointL3d() { X = (float)pipe.StartNode.Position.X, Y = (float)pipe.StartNode.Position.Y, Z = (float)pipe.StartNode.GetElev() }; pipe3d.EndPosition = new PointL3d() { X = (float)pipe.EndNode.Position.X, Y = (float)pipe.EndNode.Position.Y, Z = (float)pipe.EndNode.GetElev() }; nw3d.Append(pipe3d, out msg); } foreach (var pump in nw.Pumps) { var pump3d = new PumpL3d(); pump3d.Id = pump.Id; pump3d.Name = pump.Name; pump3d.StartPosition = new PointL3d() { X = (float)pump.StartNode.Position.X, Y = (float)pump.StartNode.Position.Y, Z = (float)pump.StartNode.GetElev() }; pump3d.EndPosition = new PointL3d() { X = (float)pump.EndNode.Position.X, Y = (float)pump.EndNode.Position.Y, Z = (float)pump.EndNode.GetElev() }; nw3d.Append(pump3d, out msg); } foreach (var valve in nw.Valves) { var valve3d = new ValveL3d(); valve3d.Id = valve.Id; valve3d.Name = valve.Name; valve3d.StartPosition = new PointL3d() { X = (float)valve.StartNode.Position.X, Y = (float)valve.StartNode.Position.Y, Z = (float)valve.StartNode.GetElev() }; valve3d.EndPosition = new PointL3d() { X = (float)valve.EndNode.Position.X, Y = (float)valve.EndNode.Position.Y, Z = (float)valve.EndNode.GetElev() }; nw3d.Append(valve3d, out msg); } return nw3d; } } } Yw.WinFrmUI.Test.Core/Form3.resx
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,120 @@ <?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> </root> Yw.WinFrmUI.Test.Core/Program.cs
@@ -11,7 +11,7 @@ // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); Application.Run(new MainForm()); Application.Run(new Form3()); } } } Yw.WinFrmUI.Test.Core/Yw.WinFrmUI.Test.Core.csproj
@@ -1,16 +1,17 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net6.0-windows</TargetFramework> <Nullable>disable</Nullable> <UseWindowsForms>true</UseWindowsForms> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net6.0-windows</TargetFramework> <Nullable>disable</Nullable> <UseWindowsForms>true</UseWindowsForms> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\Yw.Epanet.Calcu.Core\Yw.Epanet.Calcu.Core.csproj" /> <ProjectReference Include="..\Yw.WinFrmUI.Hydro.L3d.Core\Yw.WinFrmUI.Hydro.L3d.Core.csproj" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Yw.Epanet.Calcu.Core\Yw.Epanet.Calcu.Core.csproj" /> <ProjectReference Include="..\Yw.WinFrmUI.Hydro.L3d.Core\Yw.WinFrmUI.Hydro.L3d.Core.csproj" /> <ProjectReference Include="..\Yw.WinFrmUI.Hydro.L3d2.Core\Yw.WinFrmUI.Hydro.L3d2.Core.csproj" /> </ItemGroup> </Project> Yw.WinFrmUI.Test.Core/Yw.WinFrmUI.Test.Core.csproj.user
@@ -7,6 +7,9 @@ <Compile Update="Form2.cs"> <SubType>Form</SubType> </Compile> <Compile Update="Form3.cs"> <SubType>Form</SubType> </Compile> <Compile Update="MainForm.cs"> <SubType>Form</SubType> </Compile> Yw.WpfUI.Hydro.L3d.Core/Properties/PublishProfiles/FolderProfile.pubxml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <!-- https://go.microsoft.com/fwlink/?LinkID=208121. --> <Project> <PropertyGroup> <Configuration>Release</Configuration> <Platform>Any CPU</Platform> <PublishDir>bin\Release\net6.0-windows\publish\</PublishDir> <PublishProtocol>FileSystem</PublishProtocol> <_TargetId>Folder</_TargetId> </PropertyGroup> </Project> Yw.WpfUI.Hydro.L3d.Core/Properties/PublishProfiles/FolderProfile.pubxml.user
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <!-- https://go.microsoft.com/fwlink/?LinkID=208121. --> <Project> <PropertyGroup> <History>True|2025-04-03T05:39:16.2049845Z||;</History> <LastFailureDetails /> </PropertyGroup> </Project> Yw.WpfUI.Hydro.L3d.Core/Yw.WpfUI.Hydro.L3d.Core.csproj
@@ -6,6 +6,8 @@ <Nullable>disable</Nullable> <UseWPF>true</UseWPF> <ImplicitUsings>enable</ImplicitUsings> <GeneratePackageOnBuild>True</GeneratePackageOnBuild> <Version>1.0.0</Version> </PropertyGroup> <ItemGroup> Yw.WpfUI.Hydro.L3d.Core/Yw.WpfUI.Hydro.L3d.Core.csproj.user
@@ -1,4 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup /> <PropertyGroup> <_LastSelectedProfileId>D:\WorkData\Module\Epanet\Yw.WpfUI.Hydro.L3d.Core\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId> </PropertyGroup> </Project> Yw.WpfUI.Test.Core/MainWindow.xaml.cs
@@ -129,46 +129,6 @@ } public void BuildSimpleNetwork(HelixViewport3D viewport, List<NodeL3d> nodes, List<LinkL3d> pipes) { // æ¸ ç©ºç°æå 容 viewport.Children.Clear(); // æ·»å å æº viewport.Children.Add(new DefaultLights()); // å建èç¹éåï¼ç¹ç²¾çµææ¯ï¼ var pointsVisual = new PointsVisual3D { Size = 5, // æ¾ç¤ºå¤§å°ï¼å±å¹åç´ ï¼ Color = Colors.Red, }; nodes.ForEach(x => pointsVisual.Points.Add(new Point3D(x.Position.X, x.Position.Y, x.Position.Z))); viewport.Children.Add(pointsVisual); // 2. æ¾ç¤ºç®¡é线段ï¼ä½¿ç¨LinesVisual3Dï¼ var linesVisual = new LinesVisual3D { Points = new Point3DCollection(pipes.Count * 2), // é¢åé å å Color = Colors.Blue, Thickness = 2.0 }; foreach (var pipe in pipes) { linesVisual.Points.Add(new Point3D(pipe.StartPosition.X, pipe.StartPosition.Y, pipe.StartPosition.Z)); linesVisual.Points.Add(new Point3D(pipe.EndPosition.X, pipe.EndPosition.Y, pipe.EndPosition.Z)); } viewport.Children.Add(linesVisual); // 4. èªå¨ç¼©æ¾å°åéå¤§å° viewport.ZoomExtents(); } }