1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROData_Pipes_HeaderFile
24 #define HYDROData_Pipes_HeaderFile
26 #include <TopoDS_Vertex.hxx>
27 #include <TopoDS_Wire.hxx>
29 #include <TopTools_ListOfShape.hxx>
30 #include <ShapeUpgrade_UnifySameDomain.hxx>
32 class BRepOffsetAPI_MakePipeShell;
35 class HYDROData_Canal3dAnd2d
38 HYDROData_Canal3dAnd2d( const TopoDS_Wire& Profile,
39 const TopoDS_Wire& Guideline );
41 Standard_Boolean Create3dPresentation();
43 Standard_Boolean Create2dPresentation();
45 Standard_Boolean ProjectWireOntoXOY(const TopoDS_Wire& aWire,
46 TopoDS_Wire& ProjectedWire);
50 TopoDS_Vertex ProjectVertexOntoXOY(const TopoDS_Vertex& aVertex);
52 void SetMiddlePoint2d();
54 void SetMiddlePoint3d();
56 TopoDS_Wire SetTransformedProfile(const TopoDS_Wire& aProfile,
57 const TopoDS_Wire& aGuideline,
58 const gp_Pnt& aMiddlePoint);
60 TopoDS_Wire CreateWireOnUnifiedPipe2d(const TopoDS_Wire& aWireOnPipe2d);
62 TopoDS_Wire GetBank(const TopoDS_Vertex& aFreeVertex);
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();
73 void MakeSharpVertexList();
75 Standard_Boolean MakeFillet();
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;
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;
95 TopoDS_Shape myPipe3d;
96 TopoDS_Shape myPipe2d;
97 TopoDS_Shape myUnifiedPipe2d;
98 ShapeUpgrade_UnifySameDomain myUnifier;
100 TopoDS_Wire myOutlet;
101 //TopoDS_Shape myLeftBank;
102 //TopoDS_Shape myRightBank;
104 Standard_Integer myStatus;
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
110 //5 - projection failed
111 //6 - sweep 3d failed
112 //7 - sweep 2d failed
114 Standard_Real myFilletRadius;
115 TopTools_ListOfShape mySharpVertexList;
116 Standard_Real myTolAngular;