// Created on: 1993-11-08 // Created by: lbr // Copyright (c) 1993-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 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. ApproxInt_WLine::ApproxInt_WLine(const TheCurve& CurveXYZ, const TheCurve2d& CurveUV1, const TheCurve2d& CurveUV2) { curvxyz = CurveXYZ; curvuv1 = CurveUV1; curvuv2 = CurveUV2; } ApproxInt_WLine::ApproxInt_WLine(const Handle(IntSurf_LineOn2S)& lin, const Standard_Boolean ) :linon2s(lin) { } Standard_Integer ApproxInt_WLine::NbPnts() const { if(!curvxyz.IsNull()) return(curvxyz->NbPoles()); if(!curvuv1.IsNull()) return(curvuv1->NbPoles()); if(!curvuv2.IsNull()) return(curvuv2->NbPoles()); return(linon2s->NbPoints()); } IntSurf_PntOn2S ApproxInt_WLine::Point(const Standard_Integer Index) { if(!linon2s.IsNull()) { if(linon2s->NbPoints()) { return(linon2s->Value(Index)); } } gp_Pnt2d P1,P2; gp_Pnt P; if(!curvxyz.IsNull()) P = curvxyz->Pole(Index); if(!curvuv1.IsNull()) P1 = curvuv1->Pole(Index); if(!curvuv2.IsNull()) P2 = curvuv2->Pole(Index); pnton2s.SetValue(P, P1.X(), P1.Y(), P2.X(), P2.Y()); return(pnton2s); }