1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00
occt/src/IntPatch/IntPatch_RLine.lxx
nbv b8f67cc236 0027302: Invalid curves number in intersection result
1. In frame of the fix for #27282 issue, we have obtained several prolonged curves, which have common point(s). Fix for this issue joins these curves if it is possible.

2. ElCLib::InPeriod(...) method has been improved. Now it has become more faster (in general cases) and more reliable (in frame of  FLT_OVERFLOW and DIVISION_BY_ZERO cases processing).

Creation of test case for issue #27302
Test case tests\bugs\modalg_6\bug27282_2 has been adjusted in accordance with its new behavior.
2016-04-22 15:21:57 +03:00

142 lines
3.4 KiB
Plaintext

// Created on: 1992-04-06
// Created by: Jacques GOUSSARD
// Copyright (c) 1992-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 <Standard_DomainError.hxx>
#include <IntSurf_LineOn2S.hxx>
#include <IntPatch_Point.hxx>
inline const Handle(Adaptor2d_HCurve2d)& IntPatch_RLine::ArcOnS1() const
{
return theArcOnS1;
}
inline const Handle(Adaptor2d_HCurve2d)& IntPatch_RLine::ArcOnS2() const
{
return theArcOnS2;
}
//-- Il faut mettre cet include ici , car l include fait un define Handle(Adaptor2d_HCurve2d) ...
//-- et en fin de fichier un undef Handle(Adaptor2d_HCurve2d) ...
inline void IntPatch_RLine::AddVertex (const IntPatch_Point& thePnt,
const Standard_Boolean theIsPrepend)
{
if(theIsPrepend)
svtx.Prepend(thePnt);
else
svtx.Append(thePnt);
}
inline void IntPatch_RLine::Replace (const Standard_Integer Index,
const IntPatch_Point& Pnt)
{
svtx(Index) = Pnt;
}
inline void IntPatch_RLine::SetFirstPoint (const Standard_Integer IndFirst)
{
fipt = Standard_True;
indf = IndFirst;
}
inline void IntPatch_RLine::SetLastPoint (const Standard_Integer IndLast)
{
lapt = Standard_True;
indl = IndLast;
}
inline void IntPatch_RLine::Add(const Handle(IntSurf_LineOn2S)& L)
{
curv = L;
}
inline Standard_Boolean IntPatch_RLine::IsArcOnS1() const
{
return onS1;
}
inline Standard_Boolean IntPatch_RLine::IsArcOnS2() const
{
return onS2;
}
inline Standard_Boolean IntPatch_RLine::HasFirstPoint () const
{
return fipt;
}
inline Standard_Boolean IntPatch_RLine::HasLastPoint () const
{
return lapt;
}
inline const IntPatch_Point& IntPatch_RLine::FirstPoint () const
{
if (!fipt) {Standard_DomainError::Raise();}
return svtx(indf);
}
inline const IntPatch_Point& IntPatch_RLine::LastPoint () const
{
if (!lapt) {Standard_DomainError::Raise();}
return svtx(indl);
}
inline Standard_Integer IntPatch_RLine::NbVertex () const
{
return svtx.Length();
}
inline const IntPatch_Point& IntPatch_RLine::Vertex (const Standard_Integer Index) const
{
return svtx(Index);
}
inline IntPatch_Point& IntPatch_RLine::ChangeVertex (const Standard_Integer Index)
{
return svtx(Index);
}
inline void IntPatch_RLine::RemoveVertex(const Standard_Integer theIndex)
{
if((theIndex < 1) || (theIndex > NbVertex()))
Standard_OutOfRange::Raise("Cannot delete not existing vertex");
svtx.Remove(theIndex);
}
inline Standard_Boolean IntPatch_RLine::HasPolygon () const
{
return (!curv.IsNull());
}
inline Standard_Integer IntPatch_RLine::NbPnts () const
{
if (curv.IsNull()) {Standard_DomainError::Raise();}
return curv->NbPoints();
}
inline const IntSurf_PntOn2S& IntPatch_RLine::Point (const Standard_Integer Index) const
{
if (curv.IsNull()) {Standard_DomainError::Raise();}
return curv->Value(Index);
}
inline Handle(IntSurf_LineOn2S) IntPatch_RLine::Curve() const
{
return(curv);
}