1 // Created on: 1998-07-27
2 // Created by: Philippe MANGIN
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
23 #include <BRepFill_Edge3DLaw.ixx>
25 #include <BRepTools_WireExplorer.hxx>
26 #include <BRep_Tool.hxx>
28 #include <TopoDS_Edge.hxx>
30 #include <TopTools_HArray1OfShape.hxx>
32 #include <GeomFill_LocationLaw.hxx>
33 #include <GeomFill_HArray1OfLocationLaw.hxx>
34 #include <Geom_Curve.hxx>
35 #include <Geom_TrimmedCurve.hxx>
36 #include <GeomAdaptor_HCurve.hxx>
38 BRepFill_Edge3DLaw::BRepFill_Edge3DLaw(const TopoDS_Wire& Path,
39 const Handle(GeomFill_LocationLaw)& Law)
43 Standard_Integer ipath;
44 TopAbs_Orientation Or;
45 BRepTools_WireExplorer wexp;
46 // Class BRep_Tool without fields and without Constructor :
50 Handle(GeomAdaptor_HCurve) AC;
51 Standard_Real First, Last;
53 for (ipath=0, wexp.Init(myPath);
54 wexp.More(); wexp.Next()) {
56 // if (!B.Degenerated(E)) {
57 if (!BRep_Tool::Degenerated(E)) {
59 myEdges->SetValue(ipath, E);
60 C = BRep_Tool::Curve(E,First,Last);
62 if (Or == TopAbs_REVERSED) {
63 Handle(Geom_TrimmedCurve) CBis =
64 new (Geom_TrimmedCurve) (C, First, Last);
65 CBis->Reverse(); // Pour eviter de deteriorer la topologie
67 First = C->FirstParameter();
68 Last = C->LastParameter();
71 AC = new (GeomAdaptor_HCurve) (C,First, Last);
72 myLaws->SetValue(ipath, Law->Copy());
73 myLaws->ChangeValue(ipath)->SetCurve(AC);