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.
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.
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
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // modify it under the terms of the GNU Lesser General Public
20 // License as published by the Free Software Foundation; either
21 // version 2.1 of the License, or (at your option) any later version.
23 // This library is distributed in the hope that it will be useful,
24 // but WITHOUT ANY WARRANTY; without even the implied warranty of
25 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 // Lesser General Public License for more details.
28 // You should have received a copy of the GNU Lesser General Public
29 // License along with this library; if not, write to the Free Software
30 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
35 #ifndef HYDROData_Pipes_HeaderFile
36 #define HYDROData_Pipes_HeaderFile
38 #include <TopoDS_Vertex.hxx>
39 #include <TopoDS_Wire.hxx>
41 #include <TopTools_ListOfShape.hxx>
42 #include <ShapeUpgrade_UnifySameDomain.hxx>
44 class BRepOffsetAPI_MakePipeShell;
47 class HYDROData_Canal3dAnd2d
50 HYDROData_Canal3dAnd2d( const TopoDS_Wire& Profile,
51 const TopoDS_Wire& Guideline );
53 Standard_Boolean Create3dPresentation();
55 Standard_Boolean Create2dPresentation();
57 Standard_Boolean ProjectWireOntoXOY(const TopoDS_Wire& aWire,
58 TopoDS_Wire& ProjectedWire);
62 TopoDS_Vertex ProjectVertexOntoXOY(const TopoDS_Vertex& aVertex);
64 void SetMiddlePoint2d();
66 void SetMiddlePoint3d();
68 TopoDS_Wire SetTransformedProfile(const TopoDS_Wire& aProfile,
69 const TopoDS_Wire& aGuideline,
70 const gp_Pnt& aMiddlePoint);
72 TopoDS_Wire CreateWireOnUnifiedPipe2d(const TopoDS_Wire& aWireOnPipe2d);
74 TopoDS_Wire GetBank(const TopoDS_Vertex& aFreeVertex);
77 TopoDS_Shape Get3dPresentation();
78 TopoDS_Face Get2dPresentation();
79 TopoDS_Wire GetLeftBank();
80 TopoDS_Wire GetRightBank();
81 TopoDS_Wire GetInlet();
82 TopoDS_Wire GetOutlet();
83 Standard_Integer GetStatus();
85 void MakeSharpVertexList();
87 Standard_Boolean MakeFillet();
91 TopoDS_Wire myProfile;
92 TopoDS_Wire myGuideline;
93 TopoDS_Vertex myLeftVertex;
94 TopoDS_Vertex myRightVertex;
95 TopoDS_Vertex myLeftVertex2d;
96 TopoDS_Vertex myRightVertex2d;
97 gp_Pnt myMiddlePoint2d;
98 gp_Pnt myMiddlePoint3d;
100 TopoDS_Wire myProjectedProfile;
101 TopoDS_Wire myProjectedGuideline, myOriginalGuideline;
102 TopoDS_Wire myTransformedProfile3d;
103 TopoDS_Wire myTransformedProfile2d;
104 BRepOffsetAPI_MakePipeShell* mySweep3d;
105 BRepOffsetAPI_MakePipeShell* mySweep2d;
107 TopoDS_Shape myPipe3d;
108 TopoDS_Shape myPipe2d;
109 TopoDS_Shape myUnifiedPipe2d;
110 ShapeUpgrade_UnifySameDomain myUnifier;
112 TopoDS_Wire myOutlet;
113 //TopoDS_Shape myLeftBank;
114 //TopoDS_Shape myRightBank;
116 Standard_Integer myStatus;
118 //1 - some edges does not belong to same plane or parallel (fillet can not be build)
119 //2 - can not create fillet at some vertex with given radius: the length of some edge is too small respective to width of canal
120 //3 - fillet failed at some vertex
122 //5 - projection failed
123 //6 - sweep 3d failed
124 //7 - sweep 2d failed
126 Standard_Real myFilletRadius;
127 TopTools_ListOfShape mySharpVertexList;
128 Standard_Real myTolAngular;