0027232: Configuration - fix mblen missing building issue on Android
[occt.git] / src / BRepFill / BRepFill_SectionLaw.cxx
CommitLineData
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
92efcf78 41IMPLEMENT_STANDARD_RTTIEXT(BRepFill_SectionLaw,MMgt_TShared)
42
7fd59977 43//=======================================================================
44//function : NbLaw
0d969553 45//purpose : Gives the number of elementary (or Geometric) law
7fd59977 46//=======================================================================
b311480e 47Standard_Integer BRepFill_SectionLaw::NbLaw() const
7fd59977 48{
49 return myLaws->Length();
50}
51
52
53//=======================================================================
54//function : Law
55//purpose :
56//=======================================================================
57 const Handle(GeomFill_SectionLaw)&
58 BRepFill_SectionLaw::Law(const Standard_Integer Index) const
59{
60 return myLaws->Value(Index);
61}
62
63//=======================================================================
64//function : IsUClosed
65//purpose :
66//=======================================================================
67 Standard_Boolean BRepFill_SectionLaw::IsUClosed() const
68{
69 return uclosed;
70}
71
72//=======================================================================
73//function : IsVClosed
74//purpose :
75//=======================================================================
76 Standard_Boolean BRepFill_SectionLaw::IsVClosed() const
77{
78 return vclosed;
79}
80
81//=======================================================================
82//function : Init
0d969553 83//purpose : Prepare the parsing of a wire
7fd59977 84//=======================================================================
85 void BRepFill_SectionLaw::Init(const TopoDS_Wire& W)
86{
87 myIterator.Init(W);
88}
89
90//=======================================================================
91//function :
0d969553 92//purpose : Parses the wire omitting the degenerated Edges
7fd59977 93//=======================================================================
94 TopoDS_Edge BRepFill_SectionLaw::CurrentEdge()
95{
96 TopoDS_Edge E;
97// Class BRep_Tool without fields and without Constructor :
98// BRep_Tool B;
99 Standard_Boolean Suivant = Standard_False;
100 if (myIterator.More()) {
101 E = myIterator.Current();
0d969553 102// Next = (B.Degenerated(E));
7fd59977 103 Suivant = (BRep_Tool::Degenerated(E));
104 }
105
106 while (Suivant) {
107 myIterator.Next();
108 E = myIterator.Current();
0d969553 109// Next = (B.Degenerated(E) && myIterator.More());
7fd59977 110 Suivant = (BRep_Tool::Degenerated(E) && myIterator.More());
111 }
112
113 if (myIterator.More()) myIterator.Next();
114 return E;
115}
116