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