0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / BiTgte / BiTgte_Blend.hxx
1 // Created on: 1996-12-16
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1996-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 _BiTgte_Blend_HeaderFile
18 #define _BiTgte_Blend_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <BRepFill_DataMapOfShapeDataMapOfShapeListOfShape.hxx>
25 #include <TopTools_DataMapOfShapeListOfShape.hxx>
26 #include <TopTools_IndexedMapOfShape.hxx>
27 #include <BRepOffset_Analyse.hxx>
28 #include <BRepOffset_DataMapOfShapeOffset.hxx>
29 #include <BRepAlgo_Image.hxx>
30 #include <Standard_Integer.hxx>
31 #include <TColStd_HArray1OfInteger.hxx>
32 #include <TopTools_ListOfShape.hxx>
33 #include <BiTgte_ContactType.hxx>
34 #include <TopTools_DataMapOfShapeBox.hxx>
35 class BRepAlgo_AsDes;
36 class TopoDS_Face;
37 class TopoDS_Edge;
38 class Geom_Surface;
39 class Geom_Curve;
40 class Geom2d_Curve;
41 class BRepOffset_Offset;
42 class BRepOffset_Inter3d;
43
44
45 //! Root class
46 class BiTgte_Blend 
47 {
48 public:
49
50   DEFINE_STANDARD_ALLOC
51
52   
53   Standard_EXPORT BiTgte_Blend();
54   
55   //! <S>: Shape to be rounded
56   //! <Radius>: radius of the fillet
57   //! <Tol>: Tol3d used in approximations
58   //! <NUBS>: if true,  generate only NUBS surfaces,
59   //! if false, generate analytical surfaces if possible
60   Standard_EXPORT BiTgte_Blend(const TopoDS_Shape& S, const Standard_Real Radius, const Standard_Real Tol, const Standard_Boolean NUBS);
61   
62   Standard_EXPORT void Init (const TopoDS_Shape& S, const Standard_Real Radius, const Standard_Real Tol, const Standard_Boolean NUBS);
63   
64   //! Clear all the Fields.
65   Standard_EXPORT void Clear();
66   
67   //! Set two faces   of <myShape> on which the  Sphere
68   //! must roll.
69   Standard_EXPORT void SetFaces (const TopoDS_Face& F1, const TopoDS_Face& F2);
70   
71   //! Set an edge of <myShape> to be rounded.
72   Standard_EXPORT void SetEdge (const TopoDS_Edge& Edge);
73   
74   //! Set a face on which the fillet must stop.
75   Standard_EXPORT void SetStoppingFace (const TopoDS_Face& Face);
76   
77   //! Compute the generated surfaces.
78   //! If <BuildShape> is true, compute the resulting Shape.
79   //! If false, only the blending surfaces are computed.
80   Standard_EXPORT void Perform (const Standard_Boolean BuildShape = Standard_True);
81   
82   Standard_EXPORT Standard_Boolean IsDone() const;
83   
84   //! returns the result
85   Standard_EXPORT const TopoDS_Shape& Shape() const;
86   
87   //! returns the Number of generated surfaces.
88   Standard_EXPORT Standard_Integer NbSurfaces() const;
89   
90   //! returns the surface of range Index
91   Standard_EXPORT Handle(Geom_Surface) Surface (const Standard_Integer Index) const;
92   
93   //! returns the surface of range Index
94   Standard_EXPORT const TopoDS_Face& Face (const Standard_Integer Index) const;
95   
96   //! set in <LC> all the center lines
97   Standard_EXPORT void CenterLines (TopTools_ListOfShape& LC) const;
98   
99   //! returns  the surface generated  by the centerline.
100   //! <CenterLine> may be
101   //! - an edge  : generate a pipe.
102   //! - a vertex : generate a sphere.
103   //! Warning: returns a Null Handle if <CenterLine> generates
104   //! no surface.
105   Standard_EXPORT Handle(Geom_Surface) Surface (const TopoDS_Shape& CenterLine) const;
106   
107   //! returns  the face generated  by the centerline.
108   //! <CenterLine> may be
109   //! - an edge  : generate a pipe.
110   //! - a vertex : generate a sphere.
111   //! Warning: returns a Null Shape if <CenterLine> generates
112   //! no surface.
113   Standard_EXPORT const TopoDS_Face& Face (const TopoDS_Shape& CenterLine) const;
114   
115   //! returns the type of contact
116   Standard_EXPORT BiTgte_ContactType ContactType (const Standard_Integer Index) const;
117   
118   //! gives the first support shape relative to
119   //! SurfaceFillet(Index);
120   Standard_EXPORT const TopoDS_Shape& SupportShape1 (const Standard_Integer Index) const;
121   
122   //! gives the second support shape relative to
123   //! SurfaceFillet(Index);
124   Standard_EXPORT const TopoDS_Shape& SupportShape2 (const Standard_Integer Index) const;
125   
126   //! gives the 3d curve of SurfaceFillet(Index)
127   //! on SupportShape1(Index)
128   Standard_EXPORT Handle(Geom_Curve) CurveOnShape1 (const Standard_Integer Index) const;
129   
130   //! gives the 3d curve of SurfaceFillet(Index)
131   //! on SupportShape2(Index)
132   Standard_EXPORT Handle(Geom_Curve) CurveOnShape2 (const Standard_Integer Index) const;
133   
134   //! gives the PCurve associated to CurvOnShape1(Index)
135   //! on the support face
136   //! Warning: returns a Null Handle if SupportShape1 is not a Face
137   Standard_EXPORT Handle(Geom2d_Curve) PCurveOnFace1 (const Standard_Integer Index) const;
138   
139   //! gives the PCurve associated to CurveOnShape1(Index)
140   //! on the Fillet
141   Standard_EXPORT Handle(Geom2d_Curve) PCurve1OnFillet (const Standard_Integer Index) const;
142   
143   //! gives the PCurve  associated to CurveOnShape2(Index)
144   //! on the  support face
145   //! Warning: returns a Null Handle if SupportShape2 is not a Face
146   Standard_EXPORT Handle(Geom2d_Curve) PCurveOnFace2 (const Standard_Integer Index) const;
147   
148   //! gives the PCurve associated to CurveOnShape2(Index)
149   //! on the fillet
150   Standard_EXPORT Handle(Geom2d_Curve) PCurve2OnFillet (const Standard_Integer Index) const;
151   
152   Standard_EXPORT Standard_Integer NbBranches();
153   
154   //! Set in <From>,<To>   the indices of the faces  of
155   //! the branche <Index>.
156   //!
157   //! i.e: Branche<Index> = Face(From) + Face(From+1) + ..+ Face(To)
158   Standard_EXPORT void IndicesOfBranche (const Standard_Integer Index, Standard_Integer& From, Standard_Integer& To) const;
159   
160   //! Computes the center lines
161   Standard_EXPORT void ComputeCenters();
162
163
164
165
166 protected:
167
168
169
170
171
172 private:
173
174   
175   //! Perform the generated surfaces.
176   Standard_EXPORT void ComputeSurfaces();
177   
178   //! Build the resulting shape
179   //! All the faces must be computed
180   Standard_EXPORT void ComputeShape();
181   
182   //! Computes the intersections with <Face> and all the
183   //! OffsetFaces stored  in <myMapSF>.  Returns <True>
184   //! if an intersections ends on a boundary of a Face.
185   Standard_EXPORT Standard_Boolean Intersect (const TopoDS_Shape& Init, const TopoDS_Face& Face, const TopTools_DataMapOfShapeBox& MapSBox, const BRepOffset_Offset& OF1, BRepOffset_Inter3d& Inter);
186
187
188   Standard_Real myRadius;
189   Standard_Real myTol;
190   Standard_Boolean myNubs;
191   TopoDS_Shape myShape;
192   TopoDS_Shape myResult;
193   Standard_Boolean myBuildShape;
194   TopTools_IndexedDataMapOfShapeListOfShape myAncestors;
195   BRepFill_DataMapOfShapeDataMapOfShapeListOfShape myCreated;
196   TopTools_DataMapOfShapeListOfShape myCutEdges;
197   TopTools_IndexedMapOfShape myFaces;
198   TopTools_IndexedMapOfShape myEdges;
199   TopTools_MapOfShape myStopFaces;
200   BRepOffset_Analyse myAnalyse;
201   TopTools_IndexedMapOfShape myCenters;
202   BRepOffset_DataMapOfShapeOffset myMapSF;
203   BRepAlgo_Image myInitOffsetFace;
204   BRepAlgo_Image myImage;
205   BRepAlgo_Image myImageOffset;
206   Handle(BRepAlgo_AsDes) myAsDes;
207   Standard_Integer myNbBranches;
208   Handle(TColStd_HArray1OfInteger) myIndices;
209   Standard_Boolean myDone;
210
211
212 };
213
214
215
216
217
218
219
220 #endif // _BiTgte_Blend_HeaderFile