1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00
occt/src/BRepFill/BRepFill_Edge3DLaw.cxx
abv 92efcf78a6 0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
Automatic restore of IMPLEMENT_STANDARD_RTTIEXT macro (upgrade -rtti)
2015-12-04 14:15:06 +03:00

78 lines
2.3 KiB
C++

// Created on: 1998-07-27
// Created by: Philippe MANGIN
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRep_Tool.hxx>
#include <BRepFill_Edge3DLaw.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <Geom_Curve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <GeomFill_HArray1OfLocationLaw.hxx>
#include <GeomFill_LocationLaw.hxx>
#include <Standard_Type.hxx>
#include <TopExp.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Wire.hxx>
#include <TopTools_HArray1OfShape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BRepFill_Edge3DLaw,BRepFill_LocationLaw)
BRepFill_Edge3DLaw::BRepFill_Edge3DLaw(const TopoDS_Wire& Path,
const Handle(GeomFill_LocationLaw)& Law)
{
Init(Path);
Standard_Integer ipath;
TopAbs_Orientation Or;
BRepTools_WireExplorer wexp;
// Class BRep_Tool without fields and without Constructor :
// BRep_Tool B;
TopoDS_Edge E;
Handle(Geom_Curve) C;
Handle(GeomAdaptor_HCurve) AC;
Standard_Real First, Last;
for (ipath=0, wexp.Init(myPath);
wexp.More(); wexp.Next()) {
E = wexp.Current();
// if (!B.Degenerated(E)) {
if (!BRep_Tool::Degenerated(E)) {
ipath++;
myEdges->SetValue(ipath, E);
C = BRep_Tool::Curve(E,First,Last);
Or = E.Orientation();
if (Or == TopAbs_REVERSED) {
Handle(Geom_TrimmedCurve) CBis =
new (Geom_TrimmedCurve) (C, First, Last);
CBis->Reverse(); // Pour eviter de deteriorer la topologie
C = CBis;
First = C->FirstParameter();
Last = C->LastParameter();
}
AC = new (GeomAdaptor_HCurve) (C,First, Last);
myLaws->SetValue(ipath, Law->Copy());
myLaws->ChangeValue(ipath)->SetCurve(AC);
}
}
}