0031939: Coding - correction of spelling errors in comments [part 6]
[occt.git] / src / BRepFill / BRepFill_PipeShell.hxx
1 // Created on: 1998-07-22
2 // Created by: Philippe MANGIN
3 // Copyright (c) 1998-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_PipeShell_HeaderFile
18 #define _BRepFill_PipeShell_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TopoDS_Wire.hxx>
24 #include <TopoDS_Shape.hxx>
25 #include <BRepFill_SequenceOfSection.hxx>
26 #include <TopTools_DataMapOfShapeListOfShape.hxx>
27 #include <Standard_Real.hxx>
28 #include <Standard_Integer.hxx>
29 #include <Standard_Boolean.hxx>
30 #include <TopTools_HArray2OfShape.hxx>
31 #include <GeomFill_Trihedron.hxx>
32 #include <BRepFill_TransitionStyle.hxx>
33 #include <GeomFill_PipeError.hxx>
34 #include <Standard_Transient.hxx>
35 #include <BRepFill_TypeOfContact.hxx>
36 #include <TopTools_ListOfShape.hxx>
37 #include <TopTools_SequenceOfShape.hxx>
38 #include <TColStd_SequenceOfInteger.hxx>
39 class Law_Function;
40 class BRepFill_LocationLaw;
41 class BRepFill_SectionLaw;
42 class Standard_DomainError;
43 class StdFail_NotDone;
44 class TopoDS_Wire;
45 class gp_Ax2;
46 class gp_Dir;
47 class TopoDS_Shape;
48 class TopoDS_Vertex;
49 class BRepFill_Section;
50 class gp_Trsf;
51 class BRepFill_Sweep;
52
53
54 class BRepFill_PipeShell;
55 DEFINE_STANDARD_HANDLE(BRepFill_PipeShell, Standard_Transient)
56
57 //! Computes a topological shell using some wires
58 //! (spines and profiles) and diplacement option
59 //! Perform general sweeping construction
60 class BRepFill_PipeShell : public Standard_Transient
61 {
62
63 public:
64
65   
66   //! Set an sweep's mode
67   //! If no mode are set, the mode used in MakePipe is used
68   Standard_EXPORT BRepFill_PipeShell(const TopoDS_Wire& Spine);
69   
70   //! Set an Frenet or an CorrectedFrenet trihedron
71   //! to  perform  the  sweeping
72   Standard_EXPORT void Set (const Standard_Boolean Frenet = Standard_False);
73   
74   //! Set a Discrete trihedron
75   //! to  perform  the  sweeping
76   Standard_EXPORT void SetDiscrete();
77   
78   //! Set  an  fixed  trihedron  to  perform  the  sweeping
79   //! all sections will be parallel.
80   Standard_EXPORT void Set (const gp_Ax2& Axe);
81   
82   //! Set an fixed  BiNormal  direction to  perform
83   //! the sweeping
84   Standard_EXPORT void Set (const gp_Dir& BiNormal);
85   
86   //! Set support to the spine to define the BiNormal
87   //! at   the spine, like    the  normal the surfaces.
88   //! Warning: To  be  effective,  Each  edge  of  the  <spine>  must
89   //! have an  representation  on   one   face  of<SpineSupport>
90   Standard_EXPORT Standard_Boolean Set (const TopoDS_Shape& SpineSupport);
91   
92   //! Set  an  auxiliary  spine  to  define  the Normal
93   //! For  each  Point  of  the  Spine  P,  an  Point  Q  is  evalued
94   //! on  <AuxiliarySpine>
95   //! If <CurvilinearEquivalence>
96   //! Q split <AuxiliarySpine> with  the  same  length ratio
97   //! than P split  <Spline>.
98   //! Else  the  plan  define  by  P  and  the  tangent  to  the  <Spine>
99   //! intersect <AuxiliarySpine> in Q.
100   //! If <KeepContact> equals BRepFill_NoContact: The Normal is defined
101   //! by the vector PQ.
102   //! If <KeepContact> equals BRepFill_Contact: The Normal is defined to
103   //! achieve that the sweeped section is in contact to the
104   //! auxiliarySpine. The width of section is constant all along the path.
105   //! In other words, the auxiliary spine lies on the swept surface,
106   //! but not necessarily is a boundary of this surface. However,
107   //! the auxiliary spine has to be close enough to the main spine
108   //! to provide intersection with any section all along the path.
109   //! If <KeepContact> equals BRepFill_ContactOnBorder: The auxiliary spine
110   //! becomes a boundary of the swept surface and the width of section varies
111   //! along the path.
112   Standard_EXPORT void Set (const TopoDS_Wire& AuxiliarySpine, const Standard_Boolean CurvilinearEquivalence = Standard_True, const BRepFill_TypeOfContact KeepContact = BRepFill_NoContact);
113   
114   //! Define the maximum V degree of resulting surface
115   Standard_EXPORT void SetMaxDegree (const Standard_Integer NewMaxDegree);
116   
117   //! Define the maximum number of spans in V-direction
118   //! on resulting surface
119   Standard_EXPORT void SetMaxSegments (const Standard_Integer NewMaxSegments);
120   
121   //! Set the flag that indicates attempt to approximate
122   //! a C1-continuous surface if a swept surface proved
123   //! to be C0.
124   //! Give section to sweep.
125   //! Possibilities are :
126   //! - Give one or sevral profile
127   //! - Give one profile and an homotetic law.
128   //! - Automatic compute of correspondence between profile, and section on the sweeped shape
129   //! - correspondence between profile, and section on the sweeped shape defined by a vertex of the spine
130   Standard_EXPORT void SetForceApproxC1 (const Standard_Boolean ForceApproxC1);
131
132   //! Set an section. The correspondence with the spine, will be automaticaly performed.
133   Standard_EXPORT void Add (const TopoDS_Shape& Profile, const Standard_Boolean WithContact = Standard_False, const Standard_Boolean WithCorrection = Standard_False);
134
135   //! Set an section. The correspondence with the spine, is given by Location.
136   Standard_EXPORT void Add (const TopoDS_Shape& Profile, const TopoDS_Vertex& Location, const Standard_Boolean WithContact = Standard_False, const Standard_Boolean WithCorrection = Standard_False);
137   
138   //! Set  an    section  and  an   homotetic    law.
139   //! The  homotetie's  centers  is  given  by  point  on  the  <Spine>.
140   Standard_EXPORT void SetLaw (const TopoDS_Shape& Profile, const Handle(Law_Function)& L, const Standard_Boolean WithContact = Standard_False, const Standard_Boolean WithCorrection = Standard_False);
141   
142   //! Set  an    section  and  an   homotetic    law.
143   //! The  homotetie  center  is  given  by  point  on  the  <Spine>
144   Standard_EXPORT void SetLaw (const TopoDS_Shape& Profile, const Handle(Law_Function)& L, const TopoDS_Vertex& Location, const Standard_Boolean WithContact = Standard_False, const Standard_Boolean WithCorrection = Standard_False);
145   
146   //! Delete an section.
147   Standard_EXPORT void DeleteProfile (const TopoDS_Shape& Profile);
148   
149   //! Say if <me> is ready to build the shape
150   //! return False if <me> do not have section definition
151   Standard_EXPORT Standard_Boolean IsReady() const;
152   
153   //! Get a status, when Simulate or Build failed.
154   Standard_EXPORT GeomFill_PipeError GetStatus() const;
155   
156   Standard_EXPORT void SetTolerance (const Standard_Real Tol3d = 1.0e-4, const Standard_Real BoundTol = 1.0e-4, const Standard_Real TolAngular = 1.0e-2);
157   
158   //! Set the  Transition Mode to manage discontinuities
159   //! on the sweep.
160   Standard_EXPORT void SetTransition (const BRepFill_TransitionStyle Mode = BRepFill_Modified, const Standard_Real Angmin = 1.0e-2, const Standard_Real Angmax = 6.0);
161   
162   //! Perform simulation of the sweep :
163   //! Somes Section are returned.
164   Standard_EXPORT void Simulate (const Standard_Integer NumberOfSection, TopTools_ListOfShape& Sections);
165   
166   //! Builds the resulting shape (redefined from MakeShape).
167   Standard_EXPORT Standard_Boolean Build();
168   
169   //! Transform the sweeping Shell in Solid.
170   //! If the section are not closed returns False
171   Standard_EXPORT Standard_Boolean MakeSolid();
172   
173   //! Returns the result Shape.
174   Standard_EXPORT const TopoDS_Shape& Shape() const;
175   
176   Standard_EXPORT Standard_Real ErrorOnSurface() const;
177   
178   //! Returns the  TopoDS  Shape of the bottom of the sweep.
179   Standard_EXPORT const TopoDS_Shape& FirstShape() const;
180   
181   //! Returns the TopoDS Shape of the top of the sweep.
182   Standard_EXPORT const TopoDS_Shape& LastShape() const;
183   
184   //! Returns the list of original profiles
185   void Profiles(TopTools_ListOfShape& theProfiles)
186   {
187     for (Standard_Integer i = 1; i <= mySeq.Length(); ++i)
188       theProfiles.Append(mySeq(i).OriginalShape());
189   }
190
191   //! Returns the spine
192   const TopoDS_Wire& Spine()
193   {
194     return mySpine;
195   }
196
197   //! Returns the  list   of shapes generated   from the
198   //! shape <S>.
199   Standard_EXPORT void Generated (const TopoDS_Shape& S, TopTools_ListOfShape& L);
200
201
202
203
204   DEFINE_STANDARD_RTTIEXT(BRepFill_PipeShell,Standard_Transient)
205
206 protected:
207
208
209
210
211 private:
212
213   
214   Standard_EXPORT void Prepare();
215   
216   Standard_EXPORT void Place (const BRepFill_Section& Sec, TopoDS_Wire& W, gp_Trsf& Trsf, Standard_Real& param);
217   
218   Standard_EXPORT void ResetLoc();
219   
220   Standard_EXPORT void BuildHistory (const BRepFill_Sweep& theSweep);
221
222   TopoDS_Wire mySpine;
223   TopoDS_Shape myFirst;
224   TopoDS_Shape myLast;
225   TopoDS_Shape myShape;
226   BRepFill_SequenceOfSection mySeq;
227   TopTools_SequenceOfShape WSeq;
228   TColStd_SequenceOfInteger  myIndOfSec;
229   TopTools_DataMapOfShapeListOfShape myEdgeNewEdges;
230   TopTools_DataMapOfShapeListOfShape myGenMap;
231   Standard_Real myTol3d;
232   Standard_Real myBoundTol;
233   Standard_Real myTolAngular;
234   Standard_Real angmin;
235   Standard_Real angmax;
236   Standard_Integer myMaxDegree;
237   Standard_Integer myMaxSegments;
238   Standard_Boolean myForceApproxC1;
239   Handle(Law_Function) myLaw;
240   Standard_Boolean myIsAutomaticLaw;
241   Handle(BRepFill_LocationLaw) myLocation;
242   Handle(BRepFill_SectionLaw) mySection;
243   Handle(TopTools_HArray2OfShape) myFaces;
244   GeomFill_Trihedron myTrihedron;
245   BRepFill_TransitionStyle myTransition;
246   GeomFill_PipeError myStatus;
247   Standard_Real myErrorOnSurf;
248
249
250 };
251
252
253
254
255
256
257
258 #endif // _BRepFill_PipeShell_HeaderFile