Salome HOME
refs #430: incorrect coordinates in dump polyline
[modules/hydro.git] / src / HYDROData / HYDROData_Pipes.h
1
2 #ifndef HYDROData_Pipes_HeaderFile
3 #define HYDROData_Pipes_HeaderFile
4
5 #include <TopoDS_Vertex.hxx>
6 #include <TopoDS_Wire.hxx>
7 #include <gp_Pnt.hxx>
8 #include <TopTools_ListOfShape.hxx>
9 #include <ShapeUpgrade_UnifySameDomain.hxx>
10
11 class BRepOffsetAPI_MakePipeShell;
12 class TopoDS_Face;
13
14 class HYDROData_Canal3dAnd2d
15 {
16 public:
17   HYDROData_Canal3dAnd2d( const TopoDS_Wire& Profile,
18                           const TopoDS_Wire& Guideline );
19   
20   Standard_Boolean Create3dPresentation();
21
22   Standard_Boolean Create2dPresentation();
23
24   Standard_Boolean ProjectWireOntoXOY(const TopoDS_Wire& aWire,
25                                       TopoDS_Wire& ProjectedWire);
26
27   void Make2dProfile();
28
29   TopoDS_Vertex ProjectVertexOntoXOY(const TopoDS_Vertex& aVertex);
30
31   void SetMiddlePoint2d();
32
33   void SetMiddlePoint3d();
34
35   TopoDS_Wire SetTransformedProfile(const TopoDS_Wire& aProfile,
36                                     const TopoDS_Wire& aGuideline,
37                                     const gp_Pnt& aMiddlePoint);
38
39   TopoDS_Wire CreateWireOnUnifiedPipe2d(const TopoDS_Wire& aWireOnPipe2d);
40
41   TopoDS_Wire GetBank(const TopoDS_Vertex& aFreeVertex);
42
43   //Queries
44   TopoDS_Shape Get3dPresentation();
45   TopoDS_Face  Get2dPresentation();
46   TopoDS_Wire GetLeftBank();
47   TopoDS_Wire GetRightBank();
48   TopoDS_Wire GetInlet();
49   TopoDS_Wire GetOutlet();
50   Standard_Integer GetStatus();
51
52   void MakeSharpVertexList();
53
54   Standard_Boolean MakeFillet();
55
56 private:
57
58   TopoDS_Wire myProfile;
59   TopoDS_Wire myGuideline;
60   TopoDS_Vertex myLeftVertex;
61   TopoDS_Vertex myRightVertex;
62   TopoDS_Vertex myLeftVertex2d;
63   TopoDS_Vertex myRightVertex2d;
64   gp_Pnt myMiddlePoint2d;
65   gp_Pnt myMiddlePoint3d;
66
67   TopoDS_Wire myProjectedProfile;
68   TopoDS_Wire myProjectedGuideline, myOriginalGuideline;
69   TopoDS_Wire myTransformedProfile3d;
70   TopoDS_Wire myTransformedProfile2d;
71   BRepOffsetAPI_MakePipeShell* mySweep3d;
72   BRepOffsetAPI_MakePipeShell* mySweep2d;
73
74   TopoDS_Shape myPipe3d;
75   TopoDS_Shape myPipe2d;
76   TopoDS_Shape myUnifiedPipe2d;
77   ShapeUpgrade_UnifySameDomain myUnifier;
78   TopoDS_Wire myInlet;
79   TopoDS_Wire myOutlet;
80   //TopoDS_Shape myLeftBank;
81   //TopoDS_Shape myRightBank;
82
83   Standard_Integer myStatus;
84   //0 - Ok
85   //1 - some edges does not belong to same plane or parallel (fillet can not be build)
86   //2 - can not create fillet at some vertex with given radius: the length of some edge is too small respective to width of canal
87   //3 - fillet failed at some vertex
88   //4 - fillet failed
89   //5 - projection failed
90   //6 - sweep 3d failed
91   //7 - sweep 2d failed
92
93   Standard_Real myFilletRadius;
94   TopTools_ListOfShape mySharpVertexList;
95   Standard_Real myTolAngular;
96 };
97
98 #endif