b311480e |
1 | // Created on: 1998-01-07 |
2 | // Created by: Philippe MANGIN |
3 | // Copyright (c) 1998-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
7fd59977 |
17 | |
7fd59977 |
18 | #include <BRep_Tool.hxx> |
19 | #include <BRepAdaptor_Curve.hxx> |
42cf5bc1 |
20 | #include <BRepFill_SectionLaw.hxx> |
7fd59977 |
21 | #include <BRepLProp.hxx> |
42cf5bc1 |
22 | #include <BRepTools_WireExplorer.hxx> |
23 | #include <Geom_BSplineCurve.hxx> |
7fd59977 |
24 | #include <Geom_Curve.hxx> |
25 | #include <Geom_Line.hxx> |
26 | #include <Geom_TrimmedCurve.hxx> |
42cf5bc1 |
27 | #include <GeomFill_SectionLaw.hxx> |
7fd59977 |
28 | #include <GeomFill_UniformSection.hxx> |
42cf5bc1 |
29 | #include <Precision.hxx> |
30 | #include <Standard_Type.hxx> |
7fd59977 |
31 | #include <TColgp_HArray1OfPnt.hxx> |
7fd59977 |
32 | #include <TColStd_HArray1OfInteger.hxx> |
42cf5bc1 |
33 | #include <TColStd_HArray1OfReal.hxx> |
34 | #include <TopExp.hxx> |
35 | #include <TopoDS.hxx> |
36 | #include <TopoDS_Edge.hxx> |
37 | #include <TopoDS_Shape.hxx> |
38 | #include <TopoDS_Vertex.hxx> |
39 | #include <TopoDS_Wire.hxx> |
7fd59977 |
40 | |
41 | //======================================================================= |
42 | //function : NbLaw |
0d969553 |
43 | //purpose : Gives the number of elementary (or Geometric) law |
7fd59977 |
44 | //======================================================================= |
b311480e |
45 | Standard_Integer BRepFill_SectionLaw::NbLaw() const |
7fd59977 |
46 | { |
47 | return myLaws->Length(); |
48 | } |
49 | |
50 | |
51 | //======================================================================= |
52 | //function : Law |
53 | //purpose : |
54 | //======================================================================= |
55 | const Handle(GeomFill_SectionLaw)& |
56 | BRepFill_SectionLaw::Law(const Standard_Integer Index) const |
57 | { |
58 | return myLaws->Value(Index); |
59 | } |
60 | |
61 | //======================================================================= |
62 | //function : IsUClosed |
63 | //purpose : |
64 | //======================================================================= |
65 | Standard_Boolean BRepFill_SectionLaw::IsUClosed() const |
66 | { |
67 | return uclosed; |
68 | } |
69 | |
70 | //======================================================================= |
71 | //function : IsVClosed |
72 | //purpose : |
73 | //======================================================================= |
74 | Standard_Boolean BRepFill_SectionLaw::IsVClosed() const |
75 | { |
76 | return vclosed; |
77 | } |
78 | |
79 | //======================================================================= |
80 | //function : Init |
0d969553 |
81 | //purpose : Prepare the parsing of a wire |
7fd59977 |
82 | //======================================================================= |
83 | void BRepFill_SectionLaw::Init(const TopoDS_Wire& W) |
84 | { |
85 | myIterator.Init(W); |
86 | } |
87 | |
88 | //======================================================================= |
89 | //function : |
0d969553 |
90 | //purpose : Parses the wire omitting the degenerated Edges |
7fd59977 |
91 | //======================================================================= |
92 | TopoDS_Edge BRepFill_SectionLaw::CurrentEdge() |
93 | { |
94 | TopoDS_Edge E; |
95 | // Class BRep_Tool without fields and without Constructor : |
96 | // BRep_Tool B; |
97 | Standard_Boolean Suivant = Standard_False; |
98 | if (myIterator.More()) { |
99 | E = myIterator.Current(); |
0d969553 |
100 | // Next = (B.Degenerated(E)); |
7fd59977 |
101 | Suivant = (BRep_Tool::Degenerated(E)); |
102 | } |
103 | |
104 | while (Suivant) { |
105 | myIterator.Next(); |
106 | E = myIterator.Current(); |
0d969553 |
107 | // Next = (B.Degenerated(E) && myIterator.More()); |
7fd59977 |
108 | Suivant = (BRep_Tool::Degenerated(E) && myIterator.More()); |
109 | } |
110 | |
111 | if (myIterator.More()) myIterator.Next(); |
112 | return E; |
113 | } |
114 | |