Salome HOME
Merge branch 'BR_v14_rc' of ssh://git.salome-platform.org/modules/hydro into HEAD
[modules/hydro.git] / src / HYDROData / HYDROData_Pipes.h
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #ifndef HYDROData_Pipes_HeaderFile
20 #define HYDROData_Pipes_HeaderFile
21
22 #include <TopoDS_Vertex.hxx>
23 #include <TopoDS_Wire.hxx>
24 #include <gp_Pnt.hxx>
25 #include <TopTools_ListOfShape.hxx>
26 #include <ShapeUpgrade_UnifySameDomain.hxx>
27
28 class BRepOffsetAPI_MakePipeShell;
29 class TopoDS_Face;
30
31 class HYDROData_Canal3dAnd2d
32 {
33 public:
34   HYDROData_Canal3dAnd2d( const TopoDS_Wire& Profile,
35                           const TopoDS_Wire& Guideline );
36   
37   Standard_Boolean Create3dPresentation();
38
39   Standard_Boolean Create2dPresentation();
40
41   Standard_Boolean ProjectWireOntoXOY(const TopoDS_Wire& aWire,
42                                       TopoDS_Wire& ProjectedWire);
43
44   void Make2dProfile();
45
46   TopoDS_Vertex ProjectVertexOntoXOY(const TopoDS_Vertex& aVertex);
47
48   void SetMiddlePoint2d();
49
50   void SetMiddlePoint3d();
51
52   TopoDS_Wire SetTransformedProfile(const TopoDS_Wire& aProfile,
53                                     const TopoDS_Wire& aGuideline,
54                                     const gp_Pnt& aMiddlePoint);
55
56   TopoDS_Wire CreateWireOnUnifiedPipe2d(const TopoDS_Wire& aWireOnPipe2d);
57
58   TopoDS_Wire GetBank(const TopoDS_Vertex& aFreeVertex);
59
60   //Queries
61   TopoDS_Shape Get3dPresentation();
62   TopoDS_Face  Get2dPresentation();
63   TopoDS_Wire GetLeftBank();
64   TopoDS_Wire GetRightBank();
65   TopoDS_Wire GetInlet();
66   TopoDS_Wire GetOutlet();
67   Standard_Integer GetStatus();
68
69   void MakeSharpVertexList();
70
71   Standard_Boolean MakeFillet();
72
73 private:
74
75   TopoDS_Wire myProfile;
76   TopoDS_Wire myGuideline;
77   TopoDS_Vertex myLeftVertex;
78   TopoDS_Vertex myRightVertex;
79   TopoDS_Vertex myLeftVertex2d;
80   TopoDS_Vertex myRightVertex2d;
81   gp_Pnt myMiddlePoint2d;
82   gp_Pnt myMiddlePoint3d;
83
84   TopoDS_Wire myProjectedProfile;
85   TopoDS_Wire myProjectedGuideline, myOriginalGuideline;
86   TopoDS_Wire myTransformedProfile3d;
87   TopoDS_Wire myTransformedProfile2d;
88   BRepOffsetAPI_MakePipeShell* mySweep3d;
89   BRepOffsetAPI_MakePipeShell* mySweep2d;
90
91   TopoDS_Shape myPipe3d;
92   TopoDS_Shape myPipe2d;
93   TopoDS_Shape myUnifiedPipe2d;
94   ShapeUpgrade_UnifySameDomain myUnifier;
95   TopoDS_Wire myInlet;
96   TopoDS_Wire myOutlet;
97   //TopoDS_Shape myLeftBank;
98   //TopoDS_Shape myRightBank;
99
100   Standard_Integer myStatus;
101   //0 - Ok
102   //1 - some edges does not belong to same plane or parallel (fillet can not be build)
103   //2 - can not create fillet at some vertex with given radius: the length of some edge is too small respective to width of canal
104   //3 - fillet failed at some vertex
105   //4 - fillet failed
106   //5 - projection failed
107   //6 - sweep 3d failed
108   //7 - sweep 2d failed
109
110   Standard_Real myFilletRadius;
111   TopTools_ListOfShape mySharpVertexList;
112   Standard_Real myTolAngular;
113 };
114
115 #endif