1 // Created on: 1998-01-07
2 // Created by: Philippe MANGIN
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <BRep_Tool.hxx>
19 #include <BRepAdaptor_Curve.hxx>
20 #include <BRepFill_SectionLaw.hxx>
21 #include <BRepLProp.hxx>
22 #include <BRepTools_WireExplorer.hxx>
23 #include <Geom_BSplineCurve.hxx>
24 #include <Geom_Curve.hxx>
25 #include <Geom_Line.hxx>
26 #include <Geom_TrimmedCurve.hxx>
27 #include <GeomFill_SectionLaw.hxx>
28 #include <GeomFill_UniformSection.hxx>
29 #include <Precision.hxx>
30 #include <Standard_Type.hxx>
31 #include <TColgp_HArray1OfPnt.hxx>
32 #include <TColStd_HArray1OfInteger.hxx>
33 #include <TColStd_HArray1OfReal.hxx>
36 #include <TopoDS_Edge.hxx>
37 #include <TopoDS_Shape.hxx>
38 #include <TopoDS_Vertex.hxx>
39 #include <TopoDS_Wire.hxx>
41 IMPLEMENT_STANDARD_RTTIEXT(BRepFill_SectionLaw,Standard_Transient)
43 //=======================================================================
45 //purpose : Gives the number of elementary (or Geometric) law
46 //=======================================================================
47 Standard_Integer BRepFill_SectionLaw::NbLaw() const
49 return myLaws->Length();
53 //=======================================================================
56 //=======================================================================
57 const Handle(GeomFill_SectionLaw)&
58 BRepFill_SectionLaw::Law(const Standard_Integer Index) const
60 return myLaws->Value(Index);
63 //=======================================================================
66 //=======================================================================
67 Standard_Integer BRepFill_SectionLaw::IndexOfEdge(const TopoDS_Shape& anEdge) const
69 return myIndices(anEdge);
72 //=======================================================================
73 //function : IsUClosed
75 //=======================================================================
76 Standard_Boolean BRepFill_SectionLaw::IsUClosed() const
81 //=======================================================================
82 //function : IsVClosed
84 //=======================================================================
85 Standard_Boolean BRepFill_SectionLaw::IsVClosed() const
90 //=======================================================================
93 //=======================================================================
94 Standard_Boolean BRepFill_SectionLaw::IsDone() const
99 //=======================================================================
101 //purpose : Prepare the parsing of a wire
102 //=======================================================================
103 void BRepFill_SectionLaw::Init(const TopoDS_Wire& W)
108 //=======================================================================
110 //purpose : Parses the wire omitting the degenerated Edges
111 //=======================================================================
112 TopoDS_Edge BRepFill_SectionLaw::CurrentEdge()
115 // Class BRep_Tool without fields and without Constructor :
117 Standard_Boolean Suivant = Standard_False;
118 if (myIterator.More()) {
119 E = myIterator.Current();
120 // Next = (B.Degenerated(E));
121 Suivant = (BRep_Tool::Degenerated(E));
126 E = myIterator.Current();
127 // Next = (B.Degenerated(E) && myIterator.More());
128 Suivant = (BRep_Tool::Degenerated(E) && myIterator.More());
131 if (myIterator.More()) myIterator.Next();