0031303: Different calculation of offset direction in Adaptor2d_OffsetCurve and Geom2...
[occt.git] / src / BRepFill / BRepFill_Pipe.hxx
1 // Created on: 1994-06-07
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _BRepFill_Pipe_HeaderFile
18 #define _BRepFill_Pipe_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <TopoDS_Wire.hxx>
25 #include <TopoDS_Shape.hxx>
26 #include <gp_Trsf.hxx>
27 #include <TopTools_HArray2OfShape.hxx>
28 #include <TopTools_MapOfShape.hxx>
29 #include <BRepFill_DataMapOfShapeHArray2OfShape.hxx>
30 #include <TopTools_DataMapOfShapeListOfShape.hxx>
31 #include <Standard_Integer.hxx>
32 #include <GeomAbs_Shape.hxx>
33 #include <GeomFill_Trihedron.hxx>
34 #include <Standard_Boolean.hxx>
35 #include <Standard_Real.hxx>
36 class BRepFill_LocationLaw;
37 class Standard_DomainError;
38 class StdFail_NotDone;
39 class TopoDS_Wire;
40 class TopoDS_Shape;
41 class TopoDS_Face;
42 class TopoDS_Edge;
43 class TopoDS_Vertex;
44 class gp_Pnt;
45 class BRepFill_Sweep;
46
47
48 //! Create a  shape by sweeping a shape  (the profile)
49 //! along a wire (the spine).
50 //!
51 //! For each edge  or vertex from the spine  the  user
52 //! may ask for the shape generated from each subshape
53 //! of the profile.
54 class BRepFill_Pipe 
55 {
56 public:
57
58   DEFINE_STANDARD_ALLOC
59
60   
61   Standard_EXPORT BRepFill_Pipe();
62   
63   Standard_EXPORT BRepFill_Pipe(const TopoDS_Wire& Spine,
64                                 const TopoDS_Shape& Profile,
65                                 const GeomFill_Trihedron aMode = GeomFill_IsCorrectedFrenet,
66                                 const Standard_Boolean ForceApproxC1 = Standard_False,
67                                 const Standard_Boolean GeneratePartCase = Standard_False);
68   
69   Standard_EXPORT void Perform (const TopoDS_Wire& Spine,
70                                 const TopoDS_Shape& Profile,
71                                 const Standard_Boolean GeneratePartCase = Standard_False);
72   
73   Standard_EXPORT const TopoDS_Shape& Spine() const;
74   
75   Standard_EXPORT const TopoDS_Shape& Profile() const;
76   
77   Standard_EXPORT const TopoDS_Shape& Shape() const;
78   
79   Standard_EXPORT Standard_Real ErrorOnSurface() const;
80   
81   Standard_EXPORT const TopoDS_Shape& FirstShape() const;
82   
83   Standard_EXPORT const TopoDS_Shape& LastShape() const;
84   
85   //! Returns the  list   of shapes generated   from the
86   //! shape <S>.
87   Standard_EXPORT void Generated (const TopoDS_Shape& S, TopTools_ListOfShape& L);
88   
89   //! Returns the face created from an edge of the spine
90   //! and an edge of the profile.
91   //! if the edges are not in the spine or the profile
92   Standard_EXPORT TopoDS_Face Face (const TopoDS_Edge& ESpine, const TopoDS_Edge& EProfile);
93   
94   //! Returns the edge created from an edge of the spine
95   //! and a vertex of the profile.
96   //! if the edge or the vertex are not in  the spine or
97   //! the profile.
98   Standard_EXPORT TopoDS_Edge Edge (const TopoDS_Edge& ESpine, const TopoDS_Vertex& VProfile);
99   
100   //! Returns  the shape created from the profile at the
101   //! position of the vertex VSpine.
102   //! if the vertex is not in the Spine
103   Standard_EXPORT TopoDS_Shape Section (const TopoDS_Vertex& VSpine) const;
104   
105   //! Create a Wire by sweeping the Point along the <spine>
106   //! if the <Spine> is undefined
107   Standard_EXPORT TopoDS_Wire PipeLine (const gp_Pnt& Point);
108
109
110
111
112 protected:
113
114
115
116
117
118 private:
119
120   
121   //! Auxiliary  recursive  method  used  to  build  the
122   //! result.
123   Standard_EXPORT TopoDS_Shape MakeShape (const TopoDS_Shape& S,
124                                           const TopoDS_Shape& theOriginalS,
125                                           const TopoDS_Shape& FirstShape,
126                                           const TopoDS_Shape& LastShape);
127   
128   //! Auxiliary recursive method used to find the edge's index
129   Standard_EXPORT Standard_Integer FindEdge (const TopoDS_Shape& S,
130                                              const TopoDS_Edge& E,
131                                              Standard_Integer& Init) const;
132   
133   Standard_EXPORT Standard_Integer FindVertex (const TopoDS_Shape& S, const
134                                                TopoDS_Vertex& V,
135                                                Standard_Integer& Init) const;
136   
137   Standard_EXPORT void DefineRealSegmax();
138   
139   Standard_EXPORT void RebuildTopOrBottomFace (const TopoDS_Shape& aFace,
140                                                const Standard_Boolean IsTop) const;
141   
142   Standard_EXPORT void BuildHistory (const BRepFill_Sweep& theSweep,
143                                      const TopoDS_Shape&   theSection);
144
145
146   TopoDS_Wire mySpine;
147   TopoDS_Shape myProfile;
148   TopoDS_Shape myShape;
149   gp_Trsf myTrsf;
150   Handle(BRepFill_LocationLaw) myLoc;
151   Handle(TopTools_HArray2OfShape) mySections;
152   Handle(TopTools_HArray2OfShape) myFaces;
153   Handle(TopTools_HArray2OfShape) myEdges;
154   TopTools_MapOfShape myReversedEdges;
155   BRepFill_DataMapOfShapeHArray2OfShape myTapes;
156   BRepFill_DataMapOfShapeHArray2OfShape myRails;
157   Standard_Integer myCurIndexOfSectionEdge;
158   TopoDS_Shape myFirst;
159   TopoDS_Shape myLast;
160   TopTools_DataMapOfShapeListOfShape myGenMap;
161   Standard_Integer myDegmax;
162   Standard_Integer mySegmax;
163   GeomAbs_Shape myContinuity;
164   GeomFill_Trihedron myMode;
165   Standard_Boolean myForceApproxC1;
166   Standard_Real myErrorOnSurf;
167
168
169 };
170
171
172
173
174
175
176
177 #endif // _BRepFill_Pipe_HeaderFile