1 // File: BRepFill_Edge3DLaw.cxx
2 // Created: Mon Jul 27 14:13:11 1998
3 // Author: Philippe MANGIN
7 #include <BRepFill_Edge3DLaw.ixx>
9 #include <BRepTools_WireExplorer.hxx>
10 #include <BRep_Tool.hxx>
12 #include <TopoDS_Edge.hxx>
14 #include <TopTools_HArray1OfShape.hxx>
16 #include <GeomFill_LocationLaw.hxx>
17 #include <GeomFill_HArray1OfLocationLaw.hxx>
18 #include <Geom_Curve.hxx>
19 #include <Geom_TrimmedCurve.hxx>
20 #include <GeomAdaptor_HCurve.hxx>
22 BRepFill_Edge3DLaw::BRepFill_Edge3DLaw(const TopoDS_Wire& Path,
23 const Handle(GeomFill_LocationLaw)& Law)
27 Standard_Integer ipath;
28 TopAbs_Orientation Or;
29 BRepTools_WireExplorer wexp;
30 // Class BRep_Tool without fields and without Constructor :
34 Handle(GeomAdaptor_HCurve) AC;
35 Standard_Real First, Last;
37 for (ipath=0, wexp.Init(myPath);
38 wexp.More(); wexp.Next()) {
40 // if (!B.Degenerated(E)) {
41 if (!BRep_Tool::Degenerated(E)) {
43 myEdges->SetValue(ipath, E);
44 C = BRep_Tool::Curve(E,First,Last);
46 if (Or == TopAbs_REVERSED) {
47 Handle(Geom_TrimmedCurve) CBis =
48 new (Geom_TrimmedCurve) (C, First, Last);
49 CBis->Reverse(); // Pour eviter de deteriorer la topologie
51 First = C->FirstParameter();
52 Last = C->LastParameter();
55 AC = new (GeomAdaptor_HCurve) (C,First, Last);
56 myLaws->SetValue(ipath, Law->Copy());
57 myLaws->ChangeValue(ipath)->SetCurve(AC);