1 // Created on: 1998-07-27
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 <BRepFill_Edge3DLaw.hxx>
20 #include <BRepTools_WireExplorer.hxx>
21 #include <Geom_Curve.hxx>
22 #include <Geom_TrimmedCurve.hxx>
23 #include <GeomAdaptor_HCurve.hxx>
24 #include <GeomFill_HArray1OfLocationLaw.hxx>
25 #include <GeomFill_LocationLaw.hxx>
26 #include <Standard_Type.hxx>
29 #include <TopoDS_Edge.hxx>
30 #include <TopoDS_Wire.hxx>
31 #include <TopTools_HArray1OfShape.hxx>
33 IMPLEMENT_STANDARD_RTTIEXT(BRepFill_Edge3DLaw,BRepFill_LocationLaw)
35 BRepFill_Edge3DLaw::BRepFill_Edge3DLaw(const TopoDS_Wire& Path,
36 const Handle(GeomFill_LocationLaw)& Law)
40 Standard_Integer ipath;
41 TopAbs_Orientation Or;
42 BRepTools_WireExplorer wexp;
43 // Class BRep_Tool without fields and without Constructor :
47 Handle(GeomAdaptor_HCurve) AC;
48 Standard_Real First, Last;
50 for (ipath=0, wexp.Init(myPath);
51 wexp.More(); wexp.Next()) {
53 // if (!B.Degenerated(E)) {
54 if (!BRep_Tool::Degenerated(E)) {
56 myEdges->SetValue(ipath, E);
57 C = BRep_Tool::Curve(E,First,Last);
59 if (Or == TopAbs_REVERSED) {
60 Handle(Geom_TrimmedCurve) CBis =
61 new (Geom_TrimmedCurve) (C, First, Last);
62 CBis->Reverse(); // Pour eviter de deteriorer la topologie
64 First = C->FirstParameter();
65 Last = C->LastParameter();
68 AC = new (GeomAdaptor_HCurve) (C,First, Last);
69 myLaws->SetValue(ipath, Law->Copy());
70 myLaws->ChangeValue(ipath)->SetCurve(AC);