0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / BRepFill / BRepFill_Edge3DLaw.cxx
CommitLineData
b311480e 1// Created on: 1998-07-27
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>
42cf5bc1 19#include <BRepFill_Edge3DLaw.hxx>
20#include <BRepTools_WireExplorer.hxx>
7fd59977 21#include <Geom_Curve.hxx>
22#include <Geom_TrimmedCurve.hxx>
c22b52d6 23#include <GeomAdaptor_Curve.hxx>
42cf5bc1 24#include <GeomFill_HArray1OfLocationLaw.hxx>
25#include <GeomFill_LocationLaw.hxx>
26#include <Standard_Type.hxx>
27#include <TopExp.hxx>
42cf5bc1 28#include <TopoDS_Edge.hxx>
29#include <TopoDS_Wire.hxx>
30#include <TopTools_HArray1OfShape.hxx>
7fd59977 31
92efcf78 32IMPLEMENT_STANDARD_RTTIEXT(BRepFill_Edge3DLaw,BRepFill_LocationLaw)
33
7fd59977 34BRepFill_Edge3DLaw::BRepFill_Edge3DLaw(const TopoDS_Wire& Path,
35 const Handle(GeomFill_LocationLaw)& Law)
36{
37 Init(Path);
38
39 Standard_Integer ipath;
40 TopAbs_Orientation Or;
41 BRepTools_WireExplorer wexp;
42// Class BRep_Tool without fields and without Constructor :
43// BRep_Tool B;
44 TopoDS_Edge E;
45 Handle(Geom_Curve) C;
c22b52d6 46 Handle(GeomAdaptor_Curve) AC;
7fd59977 47 Standard_Real First, Last;
48
49 for (ipath=0, wexp.Init(myPath);
50 wexp.More(); wexp.Next()) {
51 E = wexp.Current();
52// if (!B.Degenerated(E)) {
53 if (!BRep_Tool::Degenerated(E)) {
54 ipath++;
55 myEdges->SetValue(ipath, E);
56 C = BRep_Tool::Curve(E,First,Last);
57 Or = E.Orientation();
58 if (Or == TopAbs_REVERSED) {
59 Handle(Geom_TrimmedCurve) CBis =
60 new (Geom_TrimmedCurve) (C, First, Last);
61 CBis->Reverse(); // Pour eviter de deteriorer la topologie
62 C = CBis;
63 First = C->FirstParameter();
64 Last = C->LastParameter();
65 }
66
c22b52d6 67 AC = new (GeomAdaptor_Curve) (C,First, Last);
7fd59977 68 myLaws->SetValue(ipath, Law->Copy());
69 myLaws->ChangeValue(ipath)->SetCurve(AC);
70 }
71 }
72}
73
74
75
76