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 #ifndef HYDROData_Pipes_HeaderFile
20 #define HYDROData_Pipes_HeaderFile
22 #include <TopoDS_Vertex.hxx>
23 #include <TopoDS_Wire.hxx>
25 #include <TopTools_ListOfShape.hxx>
26 #include <ShapeUpgrade_UnifySameDomain.hxx>
28 class BRepOffsetAPI_MakePipeShell;
31 class HYDROData_Canal3dAnd2d
34 HYDROData_Canal3dAnd2d( const TopoDS_Wire& Profile,
35 const TopoDS_Wire& Guideline );
37 Standard_Boolean Create3dPresentation();
39 Standard_Boolean Create2dPresentation();
41 Standard_Boolean ProjectWireOntoXOY(const TopoDS_Wire& aWire,
42 TopoDS_Wire& ProjectedWire);
46 TopoDS_Vertex ProjectVertexOntoXOY(const TopoDS_Vertex& aVertex);
48 void SetMiddlePoint2d();
50 void SetMiddlePoint3d();
52 TopoDS_Wire SetTransformedProfile(const TopoDS_Wire& aProfile,
53 const TopoDS_Wire& aGuideline,
54 const gp_Pnt& aMiddlePoint);
56 TopoDS_Wire CreateWireOnUnifiedPipe2d(const TopoDS_Wire& aWireOnPipe2d);
58 TopoDS_Wire GetBank(const TopoDS_Vertex& aFreeVertex);
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();
69 void MakeSharpVertexList();
71 Standard_Boolean MakeFillet();
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;
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;
91 TopoDS_Shape myPipe3d;
92 TopoDS_Shape myPipe2d;
93 TopoDS_Shape myUnifiedPipe2d;
94 ShapeUpgrade_UnifySameDomain myUnifier;
97 //TopoDS_Shape myLeftBank;
98 //TopoDS_Shape myRightBank;
100 Standard_Integer myStatus;
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
106 //5 - projection failed
107 //6 - sweep 3d failed
108 //7 - sweep 2d failed
110 Standard_Real myFilletRadius;
111 TopTools_ListOfShape mySharpVertexList;
112 Standard_Real myTolAngular;