From 399c534c415062b08ee5a00fb2c36608f4b3c7ff Mon Sep 17 00:00:00 2001 From: tangxu <tangxu76880903> Date: 星期六, 02 十一月 2024 18:32:06 +0800 Subject: [PATCH] 添加occ控件 --- WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_InitialRibbon.cs | 79 +++++---- Client/DesktopMain/DPumpHydr.DesktopMain.csproj | 2 WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainDialog.cs | 1 WinFrmUI/DPumpHydr.WinFrmUI.Volute/DPumpHydr.WinFrmUI.Volute.csproj | 7 WinFrmUI/DPumpHydr.WinFrmUI.Volute/DPumpHydr.WinFrmUI.Volute.csproj.user | 6 WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage.cs | 20 +- WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_StepInfo.cs | 43 +++-- WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_OcctDemo.cs | 285 +---------------------------------- 8 files changed, 106 insertions(+), 337 deletions(-) diff --git a/Client/DesktopMain/DPumpHydr.DesktopMain.csproj b/Client/DesktopMain/DPumpHydr.DesktopMain.csproj index 75a4662..ef45a0d 100644 --- a/Client/DesktopMain/DPumpHydr.DesktopMain.csproj +++ b/Client/DesktopMain/DPumpHydr.DesktopMain.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <OutputType>WinExe</OutputType> - <TargetFramework>net8.0-windows</TargetFramework> + <TargetFramework>net8.0-windows7.0</TargetFramework> <UseWindowsForms>true</UseWindowsForms> <Company>涓婃捣涔夌淮娴佷綋绉戞妧鏈夐檺鍏徃</Company> </PropertyGroup> diff --git a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/DPumpHydr.WinFrmUI.Volute.csproj b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/DPumpHydr.WinFrmUI.Volute.csproj index 9ce241a..a43024c 100644 --- a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/DPumpHydr.WinFrmUI.Volute.csproj +++ b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/DPumpHydr.WinFrmUI.Volute.csproj @@ -7,7 +7,6 @@ </PropertyGroup> <ItemGroup> - <Compile Remove="MainViewPage_OcctDemo.cs" /> <Compile Remove="StepControl\LayersCtrl.cs" /> <Compile Remove="StepControl\LayersCtrl.Designer.cs" /> <Compile Remove="StepControl\StepTreeListCtrl.cs" /> @@ -28,6 +27,12 @@ </ItemGroup> <ItemGroup> + <Reference Include="HydrEngineCSharp"> + <HintPath>..\..\Library\HydrEngineCSharp.dll</HintPath> + </Reference> + </ItemGroup> + + <ItemGroup> <Compile Update="DebugRLT\DebugPage.cs"> <SubType>UserControl</SubType> </Compile> diff --git a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/DPumpHydr.WinFrmUI.Volute.csproj.user b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/DPumpHydr.WinFrmUI.Volute.csproj.user index baf1564..4eebe1e 100644 --- a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/DPumpHydr.WinFrmUI.Volute.csproj.user +++ b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/DPumpHydr.WinFrmUI.Volute.csproj.user @@ -32,9 +32,15 @@ <Compile Update="MainViewPage_InitialRibbon.cs"> <SubType>UserControl</SubType> </Compile> + <Compile Update="MainViewPage_OcctDemo.cs"> + <SubType>UserControl</SubType> + </Compile> <Compile Update="MainViewPage_StepInfo.cs"> <SubType>UserControl</SubType> </Compile> + <Compile Update="Occ\OccDesignCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> <Compile Update="StepControl\Form1.cs"> <SubType>Form</SubType> </Compile> diff --git a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainDialog.cs b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainDialog.cs index 98e0296..5737f5e 100644 --- a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainDialog.cs +++ b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainDialog.cs @@ -21,6 +21,7 @@ private void MainDialog_Load(object sender, EventArgs e) { MainViewPage page = new MainViewPage(); + page.InitWindow(); page.Name = "MainViewPage"; page.Dock = DockStyle.Fill; this.Controls.Add(page); diff --git a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage.cs b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage.cs index e35d6b7..883461e 100644 --- a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage.cs +++ b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage.cs @@ -4,7 +4,8 @@ using System.Windows.Forms; using System.IO; using System.Text; -using System.Drawing; +using System.Drawing; +using HydrEngineCSharp; namespace DPumpHydr.WinFrmUI.Volute { @@ -17,28 +18,25 @@ //InitWindow(); - InitialRibbonForm(); + } - ctrlHdrBaseInfo _ctrlHdrBaseInfo = null; - ctrlGeomBaseInfo _ctrlGeomBaseInfo = null; - ctrlSectionBaseInfo _ctrlSectionBaseInfo = null; - ctrlSectionShapeInfo18 _ctrlSectionShapeInfo18 = null; - ctrlSetOutflowStyle _ctrlSetOutflowStyle = null; - ctrlSetOutflowDim _ctrlSetOutflowDim = null; + public void InitWindow() { + InitialRibbonForm(); + //InitialStepNodes(); + InitialOcccCtrl(); + // SetParasCtrl(Step_ID_Hdr_Base_Info); - // SetParasCtrl(Step_ID_Hdr_Base_Info); - - // _currentStepID = Step_ID_Hdr_Base_Info; + // _currentStepID = Step_ID_Hdr_Base_Info; } #region 姝ラ鎿嶄綔 diff --git a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_InitialRibbon.cs b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_InitialRibbon.cs index d63f470..1dc418b 100644 --- a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_InitialRibbon.cs +++ b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_InitialRibbon.cs @@ -9,10 +9,7 @@ namespace DPumpHydr.WinFrmUI.Volute { public partial class MainViewPage - { - - - + { /// <summary> /// 鎺т欢澹版槑 /// </summary> @@ -93,7 +90,7 @@ #endregion - + private bool _isInitialOk = false; private void InitialRibbonForm() { bool isButtonMoreVisible = false; @@ -234,48 +231,60 @@ ribbonPanel瑙嗗浘.Name = "ribbonPanel瑙嗗浘"; ribbonPanel瑙嗗浘.ButtonMoreVisible = isButtonMoreVisible; - ////宸﹁鍥炬寜閽� - RBtn宸﹁鍥� = new System.Windows.Forms.RibbonButton(); - var RBtnimage宸﹁鍥� = "View-Left.png"; - RBtn宸﹁鍥�.Image = GlobalResource.BuildImage(RBtnimage宸﹁鍥�, 40, 40); + //宸﹁鍥炬寜閽� + RBtn宸﹁鍥� = new System.Windows.Forms.RibbonButton(); + RBtn宸﹁鍥�.Image = GlobalResource.BuildImage("View-Left.png", 40, 40); RBtn宸﹁鍥�.Name = "RBtn宸﹁鍥�"; RBtn宸﹁鍥�.Text = "宸﹁鍥�"; - + RBtn宸﹁鍥�.Click+=(sender, e) => + { + this._occDesignCtrl.SetViewDirect(Model.eViewDirect.LEFT); + }; ////鍙宠鍥炬寜閽� - RBtn鍙宠鍥� = new System.Windows.Forms.RibbonButton(); - var RBtnimage鍙宠鍥� = "View-Right.png"; - RBtn鍙宠鍥�.Image = GlobalResource.BuildImage(RBtnimage鍙宠鍥�, 40, 40); + RBtn鍙宠鍥� = new System.Windows.Forms.RibbonButton(); + RBtn鍙宠鍥�.Image = GlobalResource.BuildImage("View-Right.png", 40, 40); RBtn鍙宠鍥�.Name = "RBtn鍙宠鍥�"; RBtn鍙宠鍥�.Text = "鍙宠鍥�"; - + RBtn鍙宠鍥�.Click += (sender, e) => + { + this._occDesignCtrl.SetViewDirect(Model.eViewDirect.RIGHT); + }; ////淇鍥炬寜閽� - RBtn淇鍥� = new System.Windows.Forms.RibbonButton(); - var RBtnimage淇鍥� = "View-Top.png"; - RBtn淇鍥�.Image = GlobalResource.BuildImage(RBtnimage淇鍥�, 40, 40); + RBtn淇鍥� = new System.Windows.Forms.RibbonButton(); + RBtn淇鍥�.Image = GlobalResource.BuildImage("View-Top.png", 40, 40); RBtn淇鍥�.Name = "RBtn淇鍥�"; RBtn淇鍥�.Text = "淇鍥�"; - + RBtn淇鍥�.Click += (sender, e) => + { + this._occDesignCtrl.SetViewDirect(Model.eViewDirect.TOP); + }; ////浠拌鍥炬寜閽� - RBtn浠拌鍥� = new System.Windows.Forms.RibbonButton(); - var RBtnimage浠拌鍥� = "View-Bottom.png"; - RBtn浠拌鍥�.Image = GlobalResource.BuildImage(RBtnimage浠拌鍥�, 40, 40); + RBtn浠拌鍥� = new System.Windows.Forms.RibbonButton(); + RBtn浠拌鍥�.Image = GlobalResource.BuildImage("View-Bottom.png", 40, 40); RBtn浠拌鍥�.Name = "RBtn浠拌鍥�"; RBtn浠拌鍥�.Text = "浠拌鍥�"; - + RBtn浠拌鍥�.Click += (sender, e) => + { + this._occDesignCtrl.SetViewDirect(Model.eViewDirect.BOTTOM); + }; ////姝h鍥炬寜閽� - RBtn姝h鍥� = new System.Windows.Forms.RibbonButton(); - var RBtnimage姝h鍥� = "View-Front.png"; - RBtn姝h鍥�.Image = GlobalResource.BuildImage(RBtnimage姝h鍥�, 40, 40); + RBtn姝h鍥� = new System.Windows.Forms.RibbonButton(); + RBtn姝h鍥�.Image = GlobalResource.BuildImage("View-Front.png", 40, 40); RBtn姝h鍥�.Name = "RBtn姝h鍥�"; RBtn姝h鍥�.Text = "姝h鍥�"; - + RBtn浠拌鍥�.Click += (sender, e) => + { + this._occDesignCtrl.SetViewDirect(Model.eViewDirect.FRONT); + }; ////鍚庤鍥炬寜閽� - RBtn鍚庤鍥� = new System.Windows.Forms.RibbonButton(); - var RBtnimage鍚庤鍥� = "View-Back.png"; - RBtn鍚庤鍥�.Image = GlobalResource.BuildImage(RBtnimage鍚庤鍥�, 40, 40); + RBtn鍚庤鍥� = new System.Windows.Forms.RibbonButton(); + RBtn鍚庤鍥�.Image = GlobalResource.BuildImage("View-Back.png", 40, 40); RBtn鍚庤鍥�.Name = "RBtn鍚庤鍥�"; RBtn鍚庤鍥�.Text = "鍚庤鍥�"; - + RBtn鍚庤鍥�.Click += (sender, e) => + { + this._occDesignCtrl.SetViewDirect(Model.eViewDirect.BACK); + }; @@ -758,8 +767,14 @@ Rbtn寮�濮�.Click += (sender, e) => { Rbtn涓嬩竴姝�.Visible = true; Rbtn鍙栨秷.Visible = true; - - InitialStepNodes(); + if(_isInitialOk == false) + { + //this.panelParas.Controls.Clear(); + _isInitialOk = true; + this._occDesignCtrl.Initial(); + InitialStepNodes(); + } + Rbtn寮�濮�.Visible = false; }; Rbtn瀹屾垚 = new System.Windows.Forms.RibbonButton(); diff --git a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_OcctDemo.cs b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_OcctDemo.cs index 80e38a7..35887b0 100644 --- a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_OcctDemo.cs +++ b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_OcctDemo.cs @@ -1,285 +1,24 @@ -锘縰sing DevExpress.XtraEditors; -using System; +锘縰sing System; using System.Collections.Generic; using System.Windows.Forms; -using GCOCC; using System.IO; using System.Text; +using System.Linq; -namespace HydrCAD.WinFrmUI.Impeller +namespace DPumpHydr.WinFrmUI.Volute { - public partial class MainViewPage : TabbedMdiXtraForm - { - GCOCC_Point3d ShroundLine1Start; - GCOCC_Point3d ShroundLine1End; - GCOCC_Point3d ShroundLine2Control; - GCOCC_Point3d ShroundLine2End; - GCOCC_Point3d ShroundLine3End; - GCOCC_Point3d OutletLineEnd; - GCOCC_Point3d InletLineStart; - GCOCC_Point3d HubLine1End; - GCOCC_Point3d HubLine2Control; - GCOCC_Point3d HubLine2End; + public partial class MainViewPage + { + OccDesignCtrl _occDesignCtrl; - GCOCC.LineData ShroundLine1; - GCOCC.LineData ShroundLine2; - GCOCC.LineData ShroundLine3; - - GCOCC.LineData OutletLine; - GCOCC.LineData InletLine; - - GCOCC.LineData HubLine1; - GCOCC.LineData HubLine2; - GCOCC.LineData HubLine3; - - List<GCOCC.LineData> lines = new List<GCOCC.LineData>(); - - - - - - //GCDemo data; - private void InitOcctDemo() + private void InitialOcccCtrl() { - //data = new GCDemo(); - ShroundLine1Start = new GCOCC_Point3d(0, 50, 0); - ShroundLine1End = new GCOCC_Point3d(6.43625613, 50, 0); - ShroundLine2Control = new GCOCC_Point3d(15.43528266, 53.2753778, 0); - ShroundLine2End = new GCOCC_Point3d(20.22356467, 61.56892551, 0); - ShroundLine3End = new GCOCC_Point3d(27, 100, 0); - OutletLineEnd = new GCOCC_Point3d(45, 100, 0); - InletLineStart = new GCOCC_Point3d(0, 15, 0); - HubLine1End = new GCOCC_Point3d(12.57235685, 15, 0); - HubLine2Control = new GCOCC_Point3d(37.96045984, 25.90758985, 0); - HubLine2End = new GCOCC_Point3d(47.52439057, 51.83175847, 0); - - ShroundLine1 = new GCOCC.LineData(LineType.Straight, new GCOCC_Point3d[] { ShroundLine1Start, ShroundLine1End }); - ShroundLine2 = new GCOCC.LineData(LineType.Arc, new GCOCC_Point3d[] { ShroundLine1End, ShroundLine2Control, ShroundLine2End }); - ShroundLine3 = new GCOCC.LineData(LineType.Straight, new GCOCC_Point3d[] { ShroundLine2End, ShroundLine3End }); - - OutletLine = new GCOCC.LineData(LineType.Straight, new GCOCC_Point3d[] { ShroundLine3End, OutletLineEnd }); - InletLine = new GCOCC.LineData(LineType.Straight, new GCOCC_Point3d[] { InletLineStart, ShroundLine1Start }); - - HubLine1 = new GCOCC.LineData(LineType.Straight, new GCOCC_Point3d[] { InletLineStart, HubLine1End }); - HubLine2 = new GCOCC.LineData(LineType.Arc, new GCOCC_Point3d[] { HubLine1End, HubLine2Control, HubLine2End }); - HubLine3 = new GCOCC.LineData(LineType.Straight, new GCOCC_Point3d[] { HubLine2End, OutletLineEnd }); - - - //Read(System.IO.Path.Combine(@"D:\WorkData\Pump3D\DPumpHdrV1.0\out", "GridPints.txt")); - - - _occViewer2d = new HydrCAD.WinFrmUI.Viewer.OccBaseViewer(); - _occViewer2d.Dock = DockStyle.Fill; - _occViewer2d.Name = "OCCViewer2d1"; - this.Controls.Add(_occViewer2d); + _occDesignCtrl = new OccDesignCtrl(); + _occDesignCtrl.Size = new System.Drawing.Size(1000, 1000); + _occDesignCtrl.Name = "OccDesignCtrl"; + _occDesignCtrl.Dock = DockStyle.Fill; + this.panelParas.Controls.Add( _occDesignCtrl ); } - - /// <summary> - /// 杞撮潰鎶曞奖鍥� - /// </summary> - public void CreateAxialProjectionDiagram() - { - lines.Add(ShroundLine1); - lines.Add(ShroundLine2); - lines.Add(ShroundLine3); - lines.Add(OutletLine); - lines.Add(InletLine); - lines.Add(HubLine1); - lines.Add(HubLine2); - lines.Add(HubLine3); - _occViewer2d.View.Draw2dLines(lines.ToArray(), 1); - } - List<GCOCC.LineData> _passLines = null; - /// <summary> - /// 杩囨祦鏂潰 - /// </summary> - public void CreatCrossSection() - { - int flow_num = 10; - - _passLines = new List<GCOCC.LineData>(); - List<GCOCC.LineData> shroundLines = new List<GCOCC.LineData> { ShroundLine1, ShroundLine2, ShroundLine3 }; - List<GCOCC.LineData> hubLines = new List<GCOCC.LineData> { HubLine1, HubLine2, HubLine3 }; - var circles = GCOCC_MathMethord.GetMidArcBetweenTwoGroupLinesTest(shroundLines.ToArray(), hubLines.ToArray(), flow_num); - List<GCOCC.GCOCC_Point2d> starts = new List<GCOCC_Point2d>(); - List<GCOCC.GCOCC_Point2d> mids = new List<GCOCC_Point2d>(); - List<GCOCC.GCOCC_Point2d> ends = new List<GCOCC_Point2d>(); - //var circles = GCOCC_MathMethord.GetMidArcBetweenTwoGroupLines(shroundLines.ToArray(), hubLines.ToArray(), Convert.ToInt32(Numbers.Text)); - foreach (var c in circles) - { - GCOCC_Point3d start = new GCOCC_Point3d(c._start.X, c._start.Y, 0); - GCOCC_Point3d end = new GCOCC_Point3d(c._end.X, c._end.Y, 0); - GCOCC_Point3d mid = new GCOCC_Point3d(c._mid.X, c._mid.Y, 0); - starts.Add(new GCOCC_Point2d(c._start.X, c._start.Y)); - mids.Add(new GCOCC_Point2d(c._mid.X, c._mid.Y)); - ends.Add(new GCOCC_Point2d(c._end.X, c._end.Y)); - var isLine = GCOCC_MathMethord.CheckIf3PointsOnALine(start, end, mid); - GCOCC.LineData l = null; - if (isLine) - { - l = new GCOCC.LineData(LineType.Straight, new GCOCC_Point3d[] { start, end }); - } - else - { - l = new GCOCC.LineData(LineType.Arc, new GCOCC_Point3d[] { start, mid, end }); - } - _passLines.Add(l); - } - //View.DrawPoints(starts,"Ps"); - //View.DrawPoints(mids,"Pc"); - //View.DrawPoints(ends,"Ph"); - //View.DrawLines(_passLines, 1); - _occViewer2d.View.Draw2dLines(_passLines.ToArray(), 1); - } - List<GCOCC.LineData> _midFlowCurve = new List<GCOCC.LineData>(); - /// <summary> - /// 涓棿娴佺嚎 - /// </summary> - public void CreateMiddleFlowCurve() - { - if (_passLines == null || _passLines.Count < 3) - return; - - var pts = GCOCC.GCOCC_MathMethord.GetMidPointsFromPassLines(_passLines.ToArray()); - ShroundLine3End = new GCOCC_Point3d(27, 100, 0); - OutletLineEnd = new GCOCC_Point3d(45, 100, 0); - pts.Add(new GCOCC_Point2d((ShroundLine3End.X + OutletLineEnd.X) / 2, (ShroundLine3End.Y + OutletLineEnd.Y) / 2)); - List<GCOCC_Point3d> pt3ds = new List<GCOCC_Point3d>(); - foreach (var item in pts) - { - GCOCC_Point3d p3d = item.ConvertToPoint3d(); - pt3ds.Add(p3d); - } - var midLine = new GCOCC.LineData(LineType.BSpline, pt3ds.ToArray()); - _midFlowCurve.Add(midLine); - //View.DrawPoints(pts); - _occViewer2d.View.Draw2dLines(_midFlowCurve.ToArray(), 1); - } - - List<DividedPointData> shroundPoints = new List<DividedPointData>(); - List<DividedPointData> midPoints = new List<DividedPointData>(); - List<DividedPointData> hubPoints = new List<DividedPointData>(); - /// <summary> - /// 娴佺嚎鍒嗙偣 - /// </summary> - public void CreateStreamlineDividingPoint() - { - if (_midFlowCurve == null || _midFlowCurve.Count == 0) - return; - double Angles = 2.5; - List<GCOCC.LineData> shroundLines = new List<GCOCC.LineData> { ShroundLine1, ShroundLine2, ShroundLine3 }; - shroundPoints = GCOCC_MathMethord.GetPointsFromStreamLine(shroundLines.ToArray(), Angles); - shroundPoints.Insert(0, new DividedPointData(new GCOCC_Point2d(ShroundLine3End.X, ShroundLine3End.Y), 0, 0, true, 0, 0)); - List<GCOCC_Point2d> pts = new List<GCOCC_Point2d>(); - shroundPoints.ForEach(x => pts.Add(x.Point)); - _occViewer2d.View.Draw2dPointsWithIndex(pts.ToArray(), null); - - List<GCOCC.LineData> hubLines = new List<GCOCC.LineData> { HubLine1, HubLine2, HubLine3 }; - hubPoints = GCOCC_MathMethord.GetPointsFromStreamLine(hubLines.ToArray(), Angles); - hubPoints.Insert(0, new DividedPointData(new GCOCC_Point2d(OutletLineEnd.X, OutletLineEnd.Y), 0, 0, true, 0, 0)); - List<GCOCC_Point2d> pts2 = new List<GCOCC_Point2d>(); - hubPoints.ForEach(x => pts2.Add(x.Point)); - _occViewer2d.View.Draw2dPointsWithIndex(pts2.ToArray(), null); - - midPoints = GCOCC_MathMethord.GetPointsFromStreamLine(_midFlowCurve.ToArray(), Angles); - midPoints.Insert(0, new DividedPointData(new GCOCC_Point2d(OutletLineEnd.X, OutletLineEnd.Y), 0, 0, true, 0, 0)); - List<GCOCC_Point2d> pts3 = new List<GCOCC_Point2d>(); - midPoints.ForEach(x => pts3.Add(x.Point)); - - _occViewer2d.View.Draw2dPointsWithIndex(pts3.ToArray(), null); - } - - List<HydrCAD.Model.GridPoint> shroundGridPoints = new List<HydrCAD.Model.GridPoint>();//鏂规牸缃戝墠鐩栨澘娴佺嚎鐐归泦鍚堬紝 鍒嗙偣鍧愭爣 鍜屾棆杞搴� - List<HydrCAD.Model.GridPoint> hubGridPoints = new List<HydrCAD.Model.GridPoint>();//鍚庣洊鏉� - List<HydrCAD.Model.GridPoint> midGridPoints = new List<HydrCAD.Model.GridPoint>();//涓棿娴佺嚎 - List<PointRotateData> shroundRotateDatas = new List<PointRotateData>();//鍓嶇洊鏉挎祦绾� 杞撮潰鍥惧潗鏍� 鍜屾棆杞搴� - List<PointRotateData> hubRotateDatas = new List<PointRotateData>();//鍚庣洊鏉� - List<PointRotateData> midRotateDatas = new List<PointRotateData>();//涓棿娴佺嚎 - /// <summary> - /// 鏄犲皠鏂规牸缃� - /// </summary> - public void CreateMappingGrid() - { - if (shroundGridPoints == null || shroundGridPoints.Count == 0) - return; - - List<GCOCC.LineData> shroundLines = new List<GCOCC.LineData> { ShroundLine1, ShroundLine2, ShroundLine3 }; - List<double> shroundGridY = new List<double>(); - shroundGridPoints.ForEach(x => shroundGridY.Add(x.Y)); - var shroundMapPoints = GCOCC_MathMethord.MapGridPointsToStreamLinePoints(shroundLines.ToArray(), shroundPoints, shroundGridY); - for (int i = 0; i < shroundMapPoints.Count; i++) - { - GCOCC_Point3d pt = new GCOCC_Point3d() - { - X = shroundMapPoints[i].X, - Y = shroundMapPoints[i].Y, - Z = 0 - }; - PointRotateData data = new PointRotateData(pt, 2.5 * i); - shroundRotateDatas.Add(data); - } - - List<GCOCC.LineData> hubLines = new List<GCOCC.LineData> { HubLine1, HubLine2, HubLine3 }; - List<double> hubGridY = new List<double>(); - hubGridPoints.ForEach(x => hubGridY.Add(x.Y)); - var hubMapPoints = GCOCC_MathMethord.MapGridPointsToStreamLinePoints(hubLines.ToArray(), hubPoints, hubGridY); - for (int i = 0; i < hubMapPoints.Count; i++) - { - GCOCC_Point3d pt = new GCOCC_Point3d() - { - X = hubMapPoints[i].X, - Y = hubMapPoints[i].Y, - Z = 0 - }; - PointRotateData data = new PointRotateData(pt, 2.5 * i); - hubRotateDatas.Add(data); - } - - List<double> midGridY = new List<double>(); - midGridPoints.ForEach(x => midGridY.Add(x.Y)); - var midMapPoints = GCOCC_MathMethord.MapGridPointsToStreamLinePoints(_midFlowCurve.ToArray(), midPoints, midGridY); - for (int i = 0; i < midMapPoints.Count; i++) - { - GCOCC_Point3d pt = new GCOCC_Point3d() - { - X = midMapPoints[i].X, - Y = midMapPoints[i].Y, - Z = 0 - }; - PointRotateData data = new PointRotateData(pt, 2.5 * i); - midRotateDatas.Add(data); - } - } - - - List<GCOCC_Point3d> shroundRotatedPoints; - List<GCOCC_Point3d> hubRotatedPoints; - List<GCOCC_Point3d> midRotatedPoints; - /// <summary> - /// 鍙剁墖璁捐闈㈤�犲瀷 - /// </summary> - public void CreateWorkSheet() - { - if (shroundRotateDatas == null || shroundRotateDatas.Count == 0) - return; - - shroundRotatedPoints = GCOCC_MathMethord.RotatePoint(shroundRotateDatas); - _occViewer2d.View.Draw3dPoints(shroundRotatedPoints.ToArray()); - - hubRotatedPoints = GCOCC_MathMethord.RotatePoint(hubRotateDatas); - _occViewer2d.View.Draw3dPoints(hubRotatedPoints.ToArray()); - - midRotatedPoints = GCOCC_MathMethord.RotatePoint(midRotateDatas); - _occViewer2d.View.Draw3dPoints(midRotatedPoints.ToArray()); - - GCOCC.LineData sline = new GCOCC.LineData(LineType.BSpline, shroundRotatedPoints.ToArray()); - GCOCC.LineData hline = new GCOCC.LineData(LineType.BSpline, hubRotatedPoints.ToArray()); - GCOCC.LineData mline = new GCOCC.LineData(LineType.BSpline, midRotatedPoints.ToArray()); - - //_occViewer2d.View.MakeSurfaceAcrossSplines2(new List<GCOCC.LineData>() { sline, mline, hline }.ToArray()); - } - - diff --git a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_StepInfo.cs b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_StepInfo.cs index ff69fac..b07e29e 100644 --- a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_StepInfo.cs +++ b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_StepInfo.cs @@ -1,17 +1,22 @@ -锘� -using System; +锘縰sing System; using System.Collections.Generic; using System.Windows.Forms; using System.IO; using System.Text; using System.Linq; -using DPumpHydr.WinFrmUI.Volute.ViewModel; -using System.Security.Policy; namespace DPumpHydr.WinFrmUI.Volute { public partial class MainViewPage { + // + ctrlHdrBaseInfo _ctrlHdrBaseInfo = null; + ctrlGeomBaseInfo _ctrlGeomBaseInfo = null; + ctrlSectionBaseInfo _ctrlSectionBaseInfo = null; + ctrlSectionShapeInfo18 _ctrlSectionShapeInfo18 = null; + ctrlSetOutflowStyle _ctrlSetOutflowStyle = null; + ctrlSetOutflowDim _ctrlSetOutflowDim = null; + //鍩虹淇℃伅 private readonly string Group_Name_Base_Info = "BaseInfo"; private readonly int Group_ID_Base_Info = -1;//缁処D @@ -60,16 +65,16 @@ ViewModel.SectionBaseInfo _sectionBaseInfo = null; ViewModel.SectionShapePara _sectionShapePara = null; DPumpHydr.WinFrmUI.Volute.TreeStepNode next_step = null; - int index; + int _currentSectIndex; /// <summary> /// 涓嬩竴姝ユ牳蹇� /// </summary> /// <returns></returns> private bool GoNextStepCore() { - if (_currentStepID != Step_ID_Section18_Dim || index>8 || index<=1) + if (_currentStepID != Step_ID_Section18_Dim || _currentSectIndex>8 || _currentSectIndex<=1) { - index = 9; + _currentSectIndex = 9; next_step = (from x in _allStepNodes where x.ID > _currentStepID orderby x.ID @@ -128,12 +133,12 @@ } _sectionBaseInfo = sectionBaseInfo; _sectionBaseInfo.InitialAllParameters(_hdrBaseInfo, _geomBaseInfo); - index--; + _currentSectIndex--; if (_sectionShapePara == null) { _sectionShapePara = new ViewModel.SectionShapePara(); } - _sectionShapePara.Initialparameters(index, _sectionBaseInfo); + _sectionShapePara.Initialparameters(_currentSectIndex, _sectionBaseInfo); } //1-8鏂潰杩涜涓嬩竴姝ョ偣鍑� if (_currentStepID == Step_ID_Section18_Dim) @@ -147,12 +152,12 @@ } _sectionShapePara = sectionShapeInfo18; _sectionShapePara.CalcHeightByArea(_sectionBaseInfo.ShapeType); - _sectionBaseInfo.EditSingleShape(_sectionShapePara, index); - if(index != 9) + _sectionBaseInfo.EditSingleShape(_sectionShapePara, _currentSectIndex); + if(_currentSectIndex != 9) { - index--; + _currentSectIndex--; } - _sectionShapePara.Initialparameters(index, _sectionBaseInfo); + _sectionShapePara.Initialparameters(_currentSectIndex, _sectionBaseInfo); } SetParasCtrl(next_step.ID); @@ -186,17 +191,17 @@ //} if (_currentStepID == Step_ID_Hdr_Base_Info) return false; - if(_currentStepID == Step_ID_Section18_Dim && index >=1 &&index < 8) + if(_currentStepID == Step_ID_Section18_Dim && _currentSectIndex >=1 &&_currentSectIndex < 8) { - index++; - _sectionShapePara.Initialparameters(index, _sectionBaseInfo); + _currentSectIndex++; + _sectionShapePara.Initialparameters(_currentSectIndex, _sectionBaseInfo); SetParasCtrl(Step_ID_Section18_Dim); return true; } if(_currentStepID == Step_ID_Outflow_Style) { - index = 1; - _sectionShapePara.Initialparameters(index, _sectionBaseInfo); + _currentSectIndex = 1; + _sectionShapePara.Initialparameters(_currentSectIndex, _sectionBaseInfo); } var prev_step = (from x in _allStepNodes where x.ID < _currentStepID @@ -491,7 +496,7 @@ _ctrlHdrBaseInfo.Dock = DockStyle.Right; _ctrlHdrBaseInfo.SetBindingData(hdrBaseInfo); } - this.panelParas.Controls.Clear(); + //this.panelParas.Controls.Clear();//涓嶈兘娓呯悊 this.panelParas.Controls.Add(_ctrlHdrBaseInfo); this._currentStepID = Step_ID_Hdr_Base_Info; //this.stepTreeListCtrl.SetStepSource(_allStepNodes, 1); -- Gitblit v1.9.3