tangxu
2024-12-29 f7ec23b2fe6e8e48bbb32b8c9321b64529622406
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HydrEngineCSharp;
 
namespace DPumpHydr.WinFrmUI.Volute
{
    public partial class OccDesign3DCtrl: OccDesignBaseCtrl
    {
        public OccDesign3DCtrl()
        {
            this._is3D = true ;
        }
        public override void Initial()
        {
 
            // 创建时的代码
            pDisplayView = new HydrEngineCSharp.CDisplayView();
 
            pDisplayView.InitOCCDraw();
            IntPtr hwnd = this.Handle;
            //IntPtr hwnd = splitContainer1.Handle;
            // 初始化更新代码
            pDisplayView.InitialUpdateOCC((uint)hwnd, this._is3D);
 
            bool bSucc = pDisplayView.BeginTurbopumpTopoShape(strTurbopumpTopoShapeName);
 
 
        }
 
        public void CreateWaterBody(HydrEngineCSharp.BcGePoint theMPlnBasePt, HydrEngineCSharp.BcGePoint theMPlnOuterPt)
        {
            //double theRad = 80.0;
            //double theHigh = 520.0;
            //double theOffset = 0.0;
            //double dTopValue = 1.0;
            //double dBtmValue = 1.0;
            //double dMPlnBasePtScaleValue = 2.0;
            //double dMPlnOuterPtScaleValue = 2.0;
 
            //WaterBodyOuterParam theWaterBodyOuterParam = new WaterBodyOuterParam();
            //theWaterBodyOuterParam.SetOuterOffset(theOffset);
            //theWaterBodyOuterParam.SetOuterHigh(theHigh);
            //theWaterBodyOuterParam.SetOuterRad(theRad);
            //theWaterBodyOuterParam.SetTopValue(m_dTopValue);
            //theWaterBodyOuterParam.SetBtmValue(m_dBtmValue);
 
    
            //    string wstrName = "水体";
            //    string wstrShapeNameI = wstrName;
            //    HydrGeomCurve theHydrGeomCurve = HydrDisplayEngineBridge.CreateGeomCurve(HydrCurveType.EHydrGeomCircle);
            //    HydrProperties theHydrProperties = new HydrProperties();
            //    theHydrProperties.SetShapeName(wstrShapeNameI);
            //    theHydrGeomCurve.SetHydrProperties(theHydrProperties);
            //    pDisplayView.buildWaterBody(wstrShapeNameI, m_dMPlnBasePtScaleValue, m_dMPlnOuterPtScaleValue, theMPlnBasePt, theMPlnOuterPt, theWaterBodyOuterParam);
            //    Invalidate(true);
            //    pDisplayView.FitAll3DViews(true);
 
        }
        public void EditOutletFlow(HydrEngineCSharp.BcGePoint theMPlnBasePt, HydrEngineCSharp.BcGePoint theMPlnOuterPt) 
            //public void edit3DMidCurve(double dMPlnBasePtScaleValue, double dMPlnOuterPtScaleValue, HydrEngineCSharp.BcGePoint theMPlnBasePt, HydrEngineCSharp.BcGePoint theMPlnOuterPt, double dTopValue, double dBtmValue)
        {
       
                //pDisplayView.rebuildWaterBody(m_dMPlnBasePtScaleValue, m_dMPlnOuterPtScaleValue, theMPlnBasePt, theMPlnOuterPt, m_dTopValue, m_dBtmValue);
                //Invalidate(true);
                //pDisplayView.FitAll3DViews(true);
           
        }
   
        public void CreateOutletBody3d(double dThickness)
        {
            int nVoluteNum = 0;
            string wstrVoluteName = "加厚体" + (nVoluteNum).ToString();
          
            bool bSucc = pDisplayView.buildThicknessBody(wstrVoluteName, dThickness);
            if (bSucc)
            {
                Invalidate(true);
                pDisplayView.FitAll3DViews(true);
            }
        }
 
        public bool ExportWaterBodyFile(string aFileName, HydrEngineCSharp.FileType nFileType)
        {
 
            return pDisplayView.SaveWaterBody(aFileName, nFileType);
 
        }
 
        public bool ExportThicknessBody(string aFileName, HydrEngineCSharp.FileType nFileType)
        {
 
            return pDisplayView.SaveThicknessBody(aFileName, nFileType);
 
 
        }
 
        public bool ExportWaterAndThicknessBodyFile(string aFileName, HydrEngineCSharp.FileType nFileType)
        {
 
            return pDisplayView.SaveWaterAndThicknessBody(aFileName, nFileType);
 
        }
    }
}