0024023: Revamp the OCCT Handle -- ambiguity
[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
17#include <BRepFill_SectionLaw.ixx>
18
19#include <BRepTools_WireExplorer.hxx>
20#include <BRep_Tool.hxx>
21#include <BRepAdaptor_Curve.hxx>
22#include <BRepLProp.hxx>
23#include <TopExp.hxx>
24#include <TopoDS.hxx>
25#include <TopoDS_Vertex.hxx>
26
27#include <Geom_Curve.hxx>
28#include <Geom_Line.hxx>
29#include <Geom_TrimmedCurve.hxx>
30#include <Geom_BSplineCurve.hxx>
31#include <GeomFill_UniformSection.hxx>
32
33#include <TColgp_HArray1OfPnt.hxx>
34#include <TColStd_HArray1OfReal.hxx>
35#include <TColStd_HArray1OfInteger.hxx>
36
37
38#include <Precision.hxx>
39
40
41//=======================================================================
42//function : NbLaw
0d969553 43//purpose : Gives the number of elementary (or Geometric) law
7fd59977 44//=======================================================================
b311480e 45Standard_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