0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / BRepFill / BRepFill_Sweep.hxx
1 // Created on: 1997-11-21
2 // Created by: Philippe MANGIN
3 // Copyright (c) 1997-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_Sweep_HeaderFile
18 #define _BRepFill_Sweep_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <GeomFill_ApproxStyle.hxx>
25 #include <GeomAbs_Shape.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TopoDS_Shape.hxx>
28 #include <TopTools_DataMapOfShapeShape.hxx>
29 #include <TopTools_ListOfShape.hxx>
30 #include <TopoDS_Wire.hxx>
31 #include <TopTools_MapOfShape.hxx>
32 #include <BRepFill_DataMapOfShapeHArray2OfShape.hxx>
33 #include <BRepFill_TransitionStyle.hxx>
34 class BRepFill_LocationLaw;
35 class BRepFill_SectionLaw;
36 class TopoDS_Edge;
37
38
39 //! Topological Sweep Algorithm
40 //! Computes an  Sweep  shell using a  generating
41 //! wire, an SectionLaw and an LocationLaw.
42 class BRepFill_Sweep 
43 {
44 public:
45
46   DEFINE_STANDARD_ALLOC
47
48   
49   Standard_EXPORT BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section, const Handle(BRepFill_LocationLaw)& Location, const Standard_Boolean WithKPart);
50   
51   Standard_EXPORT void SetBounds (const TopoDS_Wire& FirstShape, const TopoDS_Wire& LastShape);
52   
53   //! Set Approximation Tolerance
54   //! Tol3d : Tolerance to surface approximation
55   //! Tol2d : Tolerance used to perform curve approximation
56   //! Normally the 2d curve are approximated with a
57   //! tolerance given by the resolution on support surfaces,
58   //! but if this tolerance is too large Tol2d is used.
59   //! TolAngular : Tolerance (in radian) to control the angle
60   //! between tangents on the section law and
61   //! tangent of iso-v on approximated surface
62   Standard_EXPORT void SetTolerance (const Standard_Real Tol3d, const Standard_Real BoundTol = 1.0, const Standard_Real Tol2d = 1.0e-5, const Standard_Real TolAngular = 1.0e-2);
63   
64   //! Tolerance  To controle Corner management.
65   //!
66   //! If the discontinuity is lesser than <AngleMin> in radian The
67   //! Transition Performed will be alway "Modified"
68   Standard_EXPORT void SetAngularControl (const Standard_Real AngleMin = 0.01, const Standard_Real AngleMax = 6.0);
69   
70   //! Set the flag that indicates attempt to approximate
71   //! a C1-continuous surface if a swept surface proved
72   //! to be C0.
73   Standard_EXPORT void SetForceApproxC1 (const Standard_Boolean ForceApproxC1);
74   
75   //! Build the Sweep  Surface
76   //! Transition define Transition strategy
77   //! Approx define Approximation Strategy
78   //! - GeomFill_Section : The composed Function Location X Section
79   //! is directly approximated.
80   //! - GeomFill_Location : The location law is approximated, and the
81   //! SweepSurface is bulid algebric composition
82   //! of approximated location law and section law
83   //! This option is Ok, if Section.Surface() methode
84   //! is effective.
85   //! Continuity : The continuity in v waiting on the surface
86   //! Degmax     : The maximum degree in v required on the surface
87   //! Segmax     : The maximum number of span in v required on
88   //! the surface.
89   Standard_EXPORT void Build (TopTools_MapOfShape& ReversedEdges, BRepFill_DataMapOfShapeHArray2OfShape& Tapes, BRepFill_DataMapOfShapeHArray2OfShape& Rails, const BRepFill_TransitionStyle Transition = BRepFill_Modified, const GeomAbs_Shape Continuity = GeomAbs_C2, const GeomFill_ApproxStyle Approx = GeomFill_Location, const Standard_Integer Degmax = 11, const Standard_Integer Segmax = 30);
90   
91   //! Say if the Shape is Build.
92   Standard_EXPORT Standard_Boolean IsDone() const;
93   
94   //! returns the Sweeping Shape
95   Standard_EXPORT TopoDS_Shape Shape() const;
96   
97   //! Get the Approximation  error.
98   Standard_EXPORT Standard_Real ErrorOnSurface() const;
99   
100   Standard_EXPORT Handle(TopTools_HArray2OfShape) SubShape() const;
101   
102   Standard_EXPORT Handle(TopTools_HArray2OfShape) InterFaces() const;
103   
104   Standard_EXPORT Handle(TopTools_HArray2OfShape) Sections() const;
105
106   //! returns the Tape corresponding to Index-th edge of section
107   Standard_EXPORT TopoDS_Shape Tape(const Standard_Integer Index) const;
108
109
110
111 protected:
112
113   Standard_EXPORT Standard_Boolean CorrectApproxParameters();
114   
115   Standard_EXPORT Standard_Boolean BuildWire (const BRepFill_TransitionStyle Transition);
116   
117   Standard_EXPORT Standard_Boolean BuildShell (const BRepFill_TransitionStyle Transition, const Standard_Integer Vf, const Standard_Integer Vl, TopTools_MapOfShape& ReversedEdges, BRepFill_DataMapOfShapeHArray2OfShape& Tapes, BRepFill_DataMapOfShapeHArray2OfShape& Rails, const Standard_Real ExtendFirst = 0.0, const Standard_Real ExtendLast = 0.0);
118   
119   Standard_EXPORT Standard_Boolean PerformCorner (const Standard_Integer Index, const BRepFill_TransitionStyle Transition, const Handle(TopTools_HArray2OfShape)& Bounds);
120   
121   Standard_EXPORT Standard_Real EvalExtrapol (const Standard_Integer Index, const BRepFill_TransitionStyle Transition) const;
122   
123   Standard_EXPORT Standard_Boolean MergeVertex (const TopoDS_Shape& V1, TopoDS_Shape& V2) const;
124   
125   Standard_EXPORT void UpdateVertex (const Standard_Integer Ipath, const Standard_Integer Isec, const Standard_Real Error, const Standard_Real Param, TopoDS_Shape& V) const;
126   
127   Standard_EXPORT void RebuildTopOrBottomEdge (const TopoDS_Edge& aNewEdge, TopoDS_Edge& anEdge, TopTools_MapOfShape& ReversedEdges) const;
128
129
130
131
132 private:
133
134   
135
136
137   Standard_Boolean isDone;
138   Standard_Boolean KPart;
139   Standard_Real myTol3d;
140   Standard_Real myBoundTol;
141   Standard_Real myTol2d;
142   Standard_Real myTolAngular;
143   Standard_Real myAngMin;
144   Standard_Real myAngMax;
145   GeomFill_ApproxStyle myApproxStyle;
146   GeomAbs_Shape myContinuity;
147   Standard_Integer myDegmax;
148   Standard_Integer mySegmax;
149   Standard_Boolean myForceApproxC1;
150   TopoDS_Shape myShape;
151   Handle(BRepFill_LocationLaw) myLoc;
152   Handle(BRepFill_SectionLaw) mySec;
153   Handle(TopTools_HArray2OfShape) myUEdges;
154   Handle(TopTools_HArray2OfShape) myVEdges;
155   TopTools_DataMapOfShapeShape myVEdgesModified;
156   Handle(TopTools_HArray2OfShape) myFaces;
157   TopTools_ListOfShape myAuxShape;
158   Handle(TopTools_HArray1OfShape) myTapes;
159   Standard_Real Error;
160   TopoDS_Wire FirstShape;
161   TopoDS_Wire LastShape;
162
163 };
164
165
166
167
168
169
170
171 #endif // _BRepFill_Sweep_HeaderFile