1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Geom2d_TrimmedCurve

This commit is contained in:
nbv
2017-10-25 16:51:39 +03:00
parent 2ebb10988d
commit 9c55cd84c9
64 changed files with 156 additions and 138 deletions

View File

@@ -1375,12 +1375,12 @@ Handle(Geom_BSplineCurve) Adaptor3d_CurveOnSurface::BSpline() const
Bsp2d->Weights(Weights);
Bsp = new Geom_BSplineCurve(Poles,Weights,Knots,Mults,
Bsp2d->Degree(),
Bsp2d->IsPeriodic());
Bsp2d->IsPeriodic111());
}
else {
Bsp = new Geom_BSplineCurve(Poles,Knots,Mults,
Bsp2d->Degree(),
Bsp2d->IsPeriodic());
Bsp2d->IsPeriodic111());
}
return Bsp;
}

View File

@@ -217,9 +217,9 @@ static Standard_Boolean IsClosedByIsos(const Handle(Geom_Surface)& thesurf,
{
Standard_Boolean isClosed = Standard_False;
gp_Pnt2d psurf1 = (acrv2d->IsPeriodic() ?
gp_Pnt2d psurf1 = (acrv2d->IsPeriodic111() ?
acrv2d->Value(f2d) : acrv2d->Value(Max(f2d,acrv2d->FirstParameter())));
gp_Pnt2d psurf2 = (acrv2d->IsPeriodic() ?
gp_Pnt2d psurf2 = (acrv2d->IsPeriodic111() ?
acrv2d->Value(l2d) : acrv2d->Value(Min(l2d,acrv2d->LastParameter())));
Handle(Geom_Curve) aCrv1;
Handle(Geom_Curve) aCrv2;

View File

@@ -142,13 +142,6 @@ void BRepClass_Intersector::Perform(const gp_Lin2d& L,
}
IntRes2d_Domain DE(pdeb,deb,toldeb,pfin,fin,tolfin);
// temporary periodic domain
if (C.Curve()->IsPeriodic()) {
DE.SetEquivalentParameters(C.FirstParameter(),
C.FirstParameter() +
C.Curve()->LastParameter() -
C.Curve()->FirstParameter());
}
Handle(Geom2d_Line) GL= new Geom2d_Line(L);
Geom2dAdaptor_Curve CGA(GL);

View File

@@ -100,6 +100,7 @@
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <GeomLib.hxx>
#include <stdio.h>
#ifdef OCCT_DEBUG
@@ -1292,14 +1293,8 @@ void BRepFill_OffsetWire::UpdateDetromp (BRepFill_DataMapOfOrientedShapeListOfSh
TopoDS_Vertex V1,V2;
const Handle(Geom2d_Curve)& Bis = Bisec.Value();
Standard_Boolean ForceAdd = Standard_False;
Handle(Geom2d_TrimmedCurve) aTC = Handle(Geom2d_TrimmedCurve)::DownCast(Bis);
if(!aTC.IsNull() && aTC->BasisCurve()->IsPeriodic())
{
gp_Pnt2d Pf = Bis->Value(Bis->FirstParameter());
gp_Pnt2d Pl = Bis->Value(Bis->LastParameter());
ForceAdd = Pf.Distance(Pl) <= Precision::Confusion();
}
const Standard_Boolean ForceAdd = (Bis->IsPeriodic111() &&
GeomLib::IsClosed(Bis, Precision::Confusion()));
U1 = Bis->FirstParameter();

View File

@@ -1384,7 +1384,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge,
Geom2dConvert::C0BSplineToC1BSplineCurve(bs2d, Tol2d);
isBSP = Standard_True;
if(bs2d->IsPeriodic()) { // -------- IFV, Jan 2000
if(bs2d->IsPeriodic111()) { // -------- IFV, Jan 2000
gp_Pnt2d NewOriginPoint;
bs2d->D0(bs2d->FirstParameter(), NewOriginPoint);
if(Abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() ||
@@ -1429,7 +1429,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge,
Geom2dConvert::C0BSplineToC1BSplineCurve(bs2d,Tol2dbail);
if(bs2d->IsPeriodic()) { // -------- IFV, Jan 2000
if(bs2d->IsPeriodic111()) { // -------- IFV, Jan 2000
gp_Pnt2d NewOriginPoint;
bs2d->D0(bs2d->FirstParameter(), NewOriginPoint);
if(Abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() ||

View File

@@ -1059,7 +1059,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom2d_Curve)& CC,
Standard_Real cf = C->FirstParameter();
Standard_Real cl = C->LastParameter();
Standard_Real epsilon = Precision::PConfusion();
Standard_Boolean periodic = C->IsPeriodic();
Standard_Boolean periodic = C->IsPeriodic111();
TopoDS_Vertex V1,V2;

View File

@@ -594,7 +594,7 @@ void BRepLib_MakeEdge2d::Init(const Handle(Geom2d_Curve)& CC,
Standard_Real cf = C->FirstParameter();
Standard_Real cl = C->LastParameter();
Standard_Real epsilon = Precision::Confusion();
Standard_Boolean periodic = C->IsPeriodic();
Standard_Boolean periodic = C->IsPeriodic111();
TopoDS_Vertex V1,V2;

View File

@@ -951,6 +951,9 @@ void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const
if (theCurve->IsKind(STANDARD_TYPE(Geom2d_BoundedCurve)) &&
(FirstPar > anEf - a2Offset || LastPar < anEl + a2Offset))
{
// Trimmed curves or periodic B-spline curves are processed
// in this branch.
Handle(Geom2d_Curve) NewPCurve;
if (ExtendPCurve(theCurve, anEf, anEl, a2Offset, NewPCurve))
{
@@ -965,7 +968,7 @@ void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const
}
}
}
else if (theCurve->IsPeriodic())
else if (theCurve->IsPeriodic111())
{
Standard_Real delta = (theCurve->Period() - (anEl - anEf))*0.5;
delta *= 0.95;

View File

@@ -1025,7 +1025,7 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE,
first = Max(first, C3d->FirstParameter());
last = Min(last, C3d->LastParameter());
}
if(!C2d->IsPeriodic())
if(!C2d->IsPeriodic111())
{
first = Max(first, C2d->FirstParameter());
last = Min(last, C2d->LastParameter());
@@ -1040,7 +1040,7 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE,
else
{
if(CT.ErrorStatus() == 3 || (CT.ErrorStatus() == 2 &&
(C3d->IsPeriodic() || C2d->IsPeriodic())))
(C3d->IsPeriodic() || C2d->IsPeriodic111())))
{
//Try to estimate by sample points
Standard_Integer nbint = 22;

View File

@@ -212,7 +212,7 @@ public:
//! Evals real tolerance of edge <theE>.
//! <theC3d>, <theC2d>, <theS>, <theF>, <theL> are
//! correspondently 3d curve of edge, 2d curve on surface <theS> and
//! correspondingly 3d curve of edge, 2d curve on surface <theS> and
//! rang of edge
//! If calculated tolerance is more then current edge tolerance, edge is updated.
//! Method returns actual tolerance of edge

View File

@@ -388,7 +388,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
Standard_Real fc = C2d->FirstParameter(), lc = C2d->LastParameter();
if(!C2d->IsPeriodic()) {
if(!C2d->IsPeriodic111()) {
if(fc - f2d > Precision::PConfusion()) f2d = fc;
if(l2d - lc > Precision::PConfusion()) l2d = lc;
}

View File

@@ -177,7 +177,7 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d
Standard_Real fc = NewC->FirstParameter(), lc = NewC->LastParameter();
if(!NewC->IsPeriodic()) {
if(!NewC->IsPeriodic111()) {
if(fc - f > Precision::PConfusion()) f = fc;
if(l - lc > Precision::PConfusion()) l = lc;
if(Abs(l - f) < Precision::PConfusion())

View File

@@ -239,7 +239,7 @@ static Standard_OStream& operator <<(Standard_OStream& OS, const Handle(Geom2d_B
OS << (Standard_Byte)BSPLINE;
Standard_Boolean aRational = B->IsRational() ? 1:0;
BinTools::PutBool(OS, aRational); //rational
Standard_Boolean aPeriodic = B->IsPeriodic() ? 1:0;
Standard_Boolean aPeriodic = B->IsPeriodic111() ? 1:0;
BinTools::PutBool(OS, aPeriodic); //periodic
// poles and weights
Standard_Integer i,aDegree,aNbPoles,aNbKnots;

View File

@@ -1396,9 +1396,9 @@ Standard_Boolean Bisector_BisecAna::IsClosed() const
//function : IsPeriodic
//purpose :
//=============================================================================
Standard_Boolean Bisector_BisecAna::IsPeriodic() const
Standard_Boolean Bisector_BisecAna::IsPeriodic111() const
{
return thebisector->BasisCurve()->IsPeriodic();
return thebisector->IsPeriodic111();
}
//=============================================================================

View File

@@ -104,7 +104,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;

View File

@@ -540,7 +540,7 @@ Standard_Boolean Bisector_BisecCC::IsClosed() const
//function : IsPeriodic
//purpose :
//=============================================================================
Standard_Boolean Bisector_BisecCC::IsPeriodic() const
Standard_Boolean Bisector_BisecCC::IsPeriodic111() const
{
return Standard_False;
}

View File

@@ -127,7 +127,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns the point of parameter U.
//! Computes the distance between the current point and

View File

@@ -313,7 +313,7 @@ Standard_Boolean Bisector_BisecPC::IsClosed() const
//function : IsPeriodic
//purpose :
//=============================================================================
Standard_Boolean Bisector_BisecPC::IsPeriodic() const
Standard_Boolean Bisector_BisecPC::IsPeriodic111() const
{
return Standard_False;
}
@@ -703,11 +703,11 @@ void Bisector_BisecPC::ComputeIntervals ()
//------------------------------------------------------------------------
// Eventual offset of the parameter on the curve correspondingly to the one
// on the curve. The offset can be done if the curve is periodical and the
// point of initial parameter is less then the interval of continuity.
// point of initial parameter is less than the interval of continuity.
//------------------------------------------------------------------------
if (curve->IsPeriodic()) {
if (curve->IsPeriodic111()) {
if (startIntervals.Length() > 1) { // Plusieurs intervals.
if (endIntervals .Last() == curve->LastParameter() &&
if (endIntervals.Last() == curve->LastParameter() &&
startIntervals.First() == curve->FirstParameter() ) {
//---------------------------------------------------------------
// the bissectrice is defined at the origin.
@@ -716,7 +716,7 @@ void Bisector_BisecPC::ComputeIntervals ()
// => offset of parameter on all limits of intervals.
//---------------------------------------------------------------
startIntervals.Remove(1);
endIntervals .Remove(endIntervals.Length());
endIntervals.Remove(endIntervals.Length());
shiftParameter = Period() - startIntervals.First() ;
for (Standard_Integer k = 1; k <= startIntervals.Length(); k++) {

View File

@@ -132,7 +132,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns the distance between the point of
//! parameter U on <me> and my point or my curve.

View File

@@ -116,16 +116,22 @@ void ChFi2d_FilletAlgo::Init(const TopoDS_Edge& theEdge1,
myEdge2 = theEdge2;
}
// Trimmed curve cannot be returned
Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(myEdge1, myStart1, myEnd1);
Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(myEdge2, myStart2, myEnd2);
myCurve1 = GeomProjLib::Curve2d(aCurve1, myStart1, myEnd1, myPlane);
myCurve2 = GeomProjLib::Curve2d(aCurve2, myStart2, myEnd2, myPlane);
while (myCurve1->IsPeriodic() && myStart1 >= myEnd1)
myEnd1 += myCurve1->Period();
while (myCurve2->IsPeriodic() && myStart2 >= myEnd2)
myEnd2 += myCurve2->Period();
if(myCurve1->IsPeriodic111() && myStart1 >= myEnd1)
{
myEnd1 = ElCLib::InPeriod(myEnd1, myStart1, myStart1 + myCurve1->Period());
}
if(myCurve2->IsPeriodic111() && myStart2 >= myEnd2)
{
myEnd2 = ElCLib::InPeriod(myEnd2, myStart2, myStart2 + myCurve2->Period());
}
if (aBAC1.GetType() == aBAC2.GetType())
{
@@ -267,8 +273,10 @@ void ChFi2d_FilletAlgo::FillPoint(FilletPoint* thePoint, const Standard_Real the
// checking the right parameter
Standard_Real aParamProj = aProj.Parameter(a);
while(myCurve2->IsPeriodic() && aParamProj < myStart2)
aParamProj += myCurve2->Period();
if(myCurve2->IsPeriodic111() && aParamProj < myStart2)
{
aParamProj = ElCLib::InPeriod(aParamProj, myStart2, myStart2 + myCurve2->Period());
}
const Standard_Real d = aProj.Distance(a);
thePoint->appendValue(d * d - myRadius * myRadius, (aParamProj >= myStart2 && aParamProj <= myEnd2 && aValid2));

View File

@@ -983,13 +983,19 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1,
if(enlarge) delta = Min(0.1,0.05*(last-first));
Handle(Geom2d_Curve) pcf1 = fd1->Interference(jf1).PCurveOnFace();
if(pcf1.IsNull()) return Standard_False;
Standard_Boolean isper1 = pcf1->IsPeriodic();
if(isper1) {
Standard_Boolean isper1 = pcf1->IsPeriodic111();
if(isper1)
{
// Extract basis curve to obtain its First and Last parameters.
Handle(Geom2d_TrimmedCurve) tr1 = Handle(Geom2d_TrimmedCurve)::DownCast(pcf1);
if(!tr1.IsNull()) pcf1 = tr1->BasisCurve();
C1.Load(pcf1);
}
else C1.Load(pcf1,first-delta,last+delta);
else
{
C1.Load(pcf1, first - delta, last + delta);
}
Standard_Real first1 = pcf1->FirstParameter(), last1 = pcf1->LastParameter();
first = fd2->Interference(jf2).FirstParameter();
@@ -999,13 +1005,19 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1,
if(enlarge) delta = Min(0.1,0.05*(last-first));
Handle(Geom2d_Curve) pcf2 = fd2->Interference(jf2).PCurveOnFace();
if(pcf2.IsNull()) return Standard_False;
Standard_Boolean isper2 = pcf2->IsPeriodic();
if(isper2) {
Standard_Boolean isper2 = pcf2->IsPeriodic111();
if(isper2)
{
// Extract basis curve to obtain its First and Last parameters.
Handle(Geom2d_TrimmedCurve) tr2 = Handle(Geom2d_TrimmedCurve)::DownCast(pcf2);
if(!tr2.IsNull()) pcf2 = tr2->BasisCurve();
C2.Load(pcf2);
}
else C2.Load(fd2->Interference(jf2).PCurveOnFace(),first-delta,last+delta);
else
{
C2.Load(pcf2, first - delta, last + delta);
}
Standard_Real first2 = pcf2->FirstParameter(), last2 = pcf2->LastParameter();
IntRes2d_IntersectionPoint int2d;

View File

@@ -384,9 +384,10 @@ static Standard_Boolean Update(const Handle(Adaptor3d_HSurface)& face,
if (!PConF.IsNull())
{
Handle(Geom2d_TrimmedCurve) aTrCurve = Handle(Geom2d_TrimmedCurve)::DownCast(PConF);
// Extract basis curve to obtain its first/last parameters.
if (!aTrCurve.IsNull())
PConF = aTrCurve->BasisCurve();
if (!PConF->IsPeriodic())
if (!PConF->IsPeriodic111())
{
if (isfirst)
{

View File

@@ -138,7 +138,7 @@ Geom2dHatch_Hatcher (Geom2dHatch_Intersector (IntersectorConfusion,
}
else
{
if (!PCurve->IsPeriodic())
if (!PCurve->IsPeriodic111())
{
Handle (Geom2d_TrimmedCurve) TrimPCurve = Handle(Geom2d_TrimmedCurve)::DownCast (PCurve);
if (!TrimPCurve.IsNull())

View File

@@ -71,7 +71,7 @@ void DrawTrSurf_BSplineCurve2d::DrawOn (Draw_Display& dis) const
for (Standard_Integer i = 2; i <= NbPoles; i++) {
dis.DrawTo(CPoles(i));
}
if (C->IsPeriodic())
if (C->IsPeriodic111() && C->IsClosed())
dis.DrawTo(CPoles(1));
}

View File

@@ -1185,7 +1185,7 @@ MovePointAndTangent(const Standard_Real U,
Standard_Integer& ErrorStatus)
{
Standard_Integer ii ;
if (IsPeriodic()) {
if (IsPeriodic111()) {
//
// for the time being do not deal with periodic curves
//

View File

@@ -537,7 +537,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
//! Returns True if the curve is periodic.
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns True if the weights are not identical.

View File

@@ -113,7 +113,7 @@ Standard_Boolean Geom2d_BSplineCurve::IsG1 ( const Standard_Real theTf,
return Standard_False;
}
if(!IsPeriodic())
if(!IsPeriodic111())
return Standard_True;
const Standard_Real aFirstParam = FirstParameter(),
@@ -164,7 +164,7 @@ Standard_Boolean Geom2d_BSplineCurve::IsClosed () const
//purpose :
//=======================================================================
Standard_Boolean Geom2d_BSplineCurve::IsPeriodic () const
Standard_Boolean Geom2d_BSplineCurve::IsPeriodic111 () const
{ return periodic; }
//=======================================================================

View File

@@ -493,7 +493,7 @@ Standard_Boolean Geom2d_BezierCurve::IsCN (const Standard_Integer ) const
//purpose :
//=======================================================================
Standard_Boolean Geom2d_BezierCurve::IsPeriodic () const
Standard_Boolean Geom2d_BezierCurve::IsPeriodic111 () const
{
return Standard_False;
}

View File

@@ -216,7 +216,7 @@ public:
//! Returns False. A BezierCurve cannot be periodic in this
//! package
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns false if all the weights are identical. The tolerance

View File

@@ -187,7 +187,7 @@ Standard_Boolean Geom2d_Circle::IsClosed () const
//purpose :
//=======================================================================
Standard_Boolean Geom2d_Circle::IsPeriodic () const
Standard_Boolean Geom2d_Circle::IsPeriodic111 () const
{
return Standard_True;
}

View File

@@ -122,7 +122,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
//! returns True. The period of a circle is 2.*Pi.
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns in P the point of parameter U.
//! P = C + R * Cos (U) * XDir + R * Sin (U) * YDir

View File

@@ -71,7 +71,7 @@ Standard_Real Geom2d_Curve::ParametricTransformation(const gp_Trsf2d& ) const
Standard_Real Geom2d_Curve::Period() const
{
Standard_NoSuchObject_Raise_if
( !IsPeriodic(),"Geom2d_Curve::Period");
( !IsPeriodic111(),"Geom2d_Curve::Period");
return ( LastParameter() - FirstParameter());
}

View File

@@ -151,7 +151,7 @@ public:
//! periodic or not the default periodicity set is non periodic
//! and you have to turn (explicitly) the curve into a periodic
//! curve if you want the curve to be periodic.
Standard_EXPORT virtual Standard_Boolean IsPeriodic() const = 0;
Standard_EXPORT virtual Standard_Boolean IsPeriodic111() const = 0;
//! Returns thne period of this curve.
//! raises if the curve is not periodic

View File

@@ -309,7 +309,7 @@ Standard_Boolean Geom2d_Ellipse::IsClosed () const
//purpose :
//=======================================================================
Standard_Boolean Geom2d_Ellipse::IsPeriodic () const
Standard_Boolean Geom2d_Ellipse::IsPeriodic111 () const
{
return Standard_True;
}

View File

@@ -210,7 +210,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
//! return True.
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns in P the point of parameter U.
//! P = C + MajorRadius * Cos (U) * XDir + MinorRadius * Sin (U) * YDir

View File

@@ -199,7 +199,7 @@ Standard_Boolean Geom2d_Hyperbola::IsClosed () const
//purpose :
//=======================================================================
Standard_Boolean Geom2d_Hyperbola::IsPeriodic () const
Standard_Boolean Geom2d_Hyperbola::IsPeriodic111 () const
{
return Standard_False;
}

View File

@@ -149,7 +149,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
//! return False for an hyperbola.
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! In the local coordinate system of the hyperbola the

View File

@@ -171,7 +171,7 @@ Standard_Boolean Geom2d_Line::IsClosed () const { return Standard_False
//purpose :
//=======================================================================
Standard_Boolean Geom2d_Line::IsPeriodic () const { return Standard_False; }
Standard_Boolean Geom2d_Line::IsPeriodic111 () const { return Standard_False; }
//=======================================================================
//function : Continuity

View File

@@ -123,7 +123,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
//! Returns False
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns GeomAbs_CN, which is the global continuity of any line.
Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;

View File

@@ -330,9 +330,9 @@ Standard_Boolean Geom2d_OffsetCurve::IsCN (const Standard_Integer N) const
//purpose :
//=======================================================================
Standard_Boolean Geom2d_OffsetCurve::IsPeriodic () const
Standard_Boolean Geom2d_OffsetCurve::IsPeriodic111 () const
{
return basisCurve->IsPeriodic();
return basisCurve->IsPeriodic111();
}
//=======================================================================

View File

@@ -242,7 +242,7 @@ public:
//! If the basis curve is a circle or an ellipse the corresponding
//! OffsetCurve is periodic. If the basis curve can't be periodic
//! (for example BezierCurve) the OffsetCurve can't be periodic.
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns the period of this offset curve, i.e. the period
//! of the basis curve of this offset curve.

View File

@@ -185,7 +185,7 @@ Standard_Boolean Geom2d_Parabola::IsClosed () const
//purpose :
//=======================================================================
Standard_Boolean Geom2d_Parabola::IsPeriodic () const
Standard_Boolean Geom2d_Parabola::IsPeriodic111 () const
{
return Standard_False;
}

View File

@@ -128,7 +128,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
//! Returns False
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! The directrix is parallel to the "YAxis" of the parabola.
//! The "Location" point of the directrix is the intersection

View File

@@ -123,7 +123,7 @@ void Geom2d_TrimmedCurve::SetTrim (const Standard_Real U1,
Standard_Real Udeb = basisCurve->FirstParameter();
Standard_Real Ufin = basisCurve->LastParameter();
if (basisCurve->IsPeriodic()) {
if (IsPeriodic111()) {
sameSense = Sense;
// set uTrim1 in the range Udeb , Ufin
@@ -209,12 +209,10 @@ Standard_Real Geom2d_TrimmedCurve::FirstParameter () const { return uTrim1
//function : IsClosed
//purpose :
//=======================================================================
Standard_Boolean Geom2d_TrimmedCurve::IsClosed () const
Standard_Boolean Geom2d_TrimmedCurve::IsClosed() const
{
Standard_Real Dist =
Value(FirstParameter()).Distance(Value(LastParameter()));
return ( Dist <= gp::Resolution());
return
(Value(FirstParameter()).SquareDistance(Value(LastParameter())) < gp::Resolution());
}
//=======================================================================
@@ -222,10 +220,9 @@ Standard_Boolean Geom2d_TrimmedCurve::IsClosed () const
//purpose :
//=======================================================================
Standard_Boolean Geom2d_TrimmedCurve::IsPeriodic () const
Standard_Boolean Geom2d_TrimmedCurve::IsPeriodic111() const
{
//return basisCurve->IsPeriodic();
return Standard_False;
return basisCurve->IsPeriodic111();
}
//=======================================================================

View File

@@ -173,7 +173,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
//! Always returns FALSE (independently of the type of basis curve).
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns the period of the basis curve of this trimmed curve.
//! Exceptions

View File

@@ -86,9 +86,9 @@ GeomAbs_Shape Geom2dAdaptor_Curve::LocalContinuity(const Standard_Real U1,
TColStd_Array1OfInteger TM(1,Nb);
myBSplineCurve->Knots(TK);
myBSplineCurve->Multiplicities(TM);
BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U1,myBSplineCurve->IsPeriodic(),
BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U1,myBSplineCurve->IsPeriodic111(),
1,Nb,Index1,newFirst);
BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U2,myBSplineCurve->IsPeriodic(),
BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U2,myBSplineCurve->IsPeriodic111(),
1,Nb,Index2,newLast);
if ( Abs(newFirst-TK(Index1+1))<Precision::PConfusion()) {
if (Index1 < Nb)Index1++;
@@ -97,7 +97,7 @@ GeomAbs_Shape Geom2dAdaptor_Curve::LocalContinuity(const Standard_Real U1,
Index2--;
Standard_Integer MultMax;
// attention aux courbes peridiques.
if ( myBSplineCurve->IsPeriodic() && Index1 == Nb )
if ( myBSplineCurve->IsPeriodic111() && Index1 == Nb )
Index1 = 1;
if ( Index2 - Index1 <= 0) {
@@ -343,10 +343,10 @@ Standard_Integer Geom2dAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const
myBSplineCurve->Knots(TK);
myBSplineCurve->Multiplicities(TM);
BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myFirst,
myBSplineCurve->IsPeriodic(),
myBSplineCurve->IsPeriodic111(),
1,Nb,Index1,newFirst);
BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myLast,
myBSplineCurve->IsPeriodic(),
myBSplineCurve->IsPeriodic111(),
1,Nb,Index2,newLast);
// On decale eventuellement les indices
@@ -447,10 +447,10 @@ void Geom2dAdaptor_Curve::Intervals(TColStd_Array1OfReal& T,
myBSplineCurve->Knots(TK);
myBSplineCurve->Multiplicities(TM);
BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myFirst,
myBSplineCurve->IsPeriodic(),
myBSplineCurve->IsPeriodic111(),
1,Nb,Index1,newFirst);
BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myLast,
myBSplineCurve->IsPeriodic(),
myBSplineCurve->IsPeriodic111(),
1,Nb,Index2,newLast);
@@ -543,7 +543,7 @@ Standard_Boolean Geom2dAdaptor_Curve::IsClosed() const
Standard_Boolean Geom2dAdaptor_Curve::IsPeriodic() const
{
return myCurve->IsPeriodic();
return myCurve->IsPeriodic111();
}
//=======================================================================

View File

@@ -142,7 +142,7 @@ const Standard_Boolean SameOrientation
NewCurve->Segment(C->Knot(FirstK),C->Knot(LastK));
if (C->IsPeriodic()) {
if (C->IsPeriodic111()) {
if (!SameOrientation) NewCurve->Reverse();
}
else {
@@ -174,7 +174,7 @@ const Standard_Boolean SameOrientation
C1->Segment(FirstU, LastU);
if (C->IsPeriodic()) {
if (C->IsPeriodic111()) {
if (!SameOrientation) C1->Reverse();
}
else {
@@ -207,7 +207,7 @@ const Convert_ParameterisationType Parameterisation)
// Si la courbe n'est pas vraiment restreinte, on ne risque pas
// le Raise dans le BS->Segment.
if (!Curv->IsPeriodic()) {
if (!Curv->IsPeriodic111()) {
if (U1 < Curv->FirstParameter())
U1 = Curv->FirstParameter();
if (U2 > Curv->LastParameter())

View File

@@ -34,7 +34,7 @@ Geom2dConvert_BSplineCurveToBezierCurve::Geom2dConvert_BSplineCurveToBezierCurve
// periodic curve can't be converted correctly by two main reasons:
// last pole (equal to first one) is missing;
// poles recomputation using default boor scheme is fails.
if(myCurve->IsPeriodic()) myCurve->SetNotPeriodic();
if(myCurve->IsPeriodic111()) myCurve->SetNotPeriodic();
Standard_Real Uf = myCurve->FirstParameter();
Standard_Real Ul = myCurve->LastParameter();
myCurve->Segment(Uf,Ul);
@@ -63,7 +63,7 @@ Geom2dConvert_BSplineCurveToBezierCurve::Geom2dConvert_BSplineCurveToBezierCurve
Standard_Integer I1, I2;
myCurve = Handle(Geom2d_BSplineCurve)::DownCast(BasisCurve->Copy());
if(myCurve->IsPeriodic()) myCurve->SetNotPeriodic();
if(myCurve->IsPeriodic111()) myCurve->SetNotPeriodic();
myCurve->LocateU(U1, PTol, I1, I2);
if (I1==I2) { // On est sur le noeud

View File

@@ -641,7 +641,7 @@ Handle(Geom_Curve) GeomLib::To3d (const gp_Ax2& Position,
Standard_Integer Nbpoles = CBSpl2d->NbPoles ();
Standard_Integer Nbknots = CBSpl2d->NbKnots ();
Standard_Integer TheDegree = CBSpl2d->Degree ();
Standard_Boolean IsPeriodic = CBSpl2d->IsPeriodic();
Standard_Boolean IsPeriodic = CBSpl2d->IsPeriodic111();
TColgp_Array1OfPnt2d Poles2d (1, Nbpoles);
CBSpl2d->Poles (Poles2d);
TColgp_Array1OfPnt Poles3d (1, Nbpoles);
@@ -962,14 +962,7 @@ void GeomLib::SameRange(const Standard_Real Tolerance,
else
{ // On segmente le resultat
Handle(Geom2d_TrimmedCurve) TC;
Handle(Geom2d_Curve) aCCheck = CurvePtr;
if(aCCheck->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
{
aCCheck = Handle(Geom2d_TrimmedCurve)::DownCast(aCCheck)->BasisCurve();
}
if(aCCheck->IsPeriodic())
if (CurvePtr->IsPeriodic111())
{
if(Abs(LastOnCurve - FirstOnCurve) > Precision::PConfusion())
{

View File

@@ -193,6 +193,21 @@ public:
Standard_EXPORT static void IsClosed(const Handle(Geom_Surface)& S, const Standard_Real Tol,
Standard_Boolean& isUClosed, Standard_Boolean& isVClosed);
//! This method defines if the ends of the given curve are
//! coincided with given tolerance.
//! This is a template-method. Therefore, it can be applied to
//! 2D- and 3D-curve and to Adaptor-HCurve.
template <typename TypeCurve>
Standard_EXPORT static Standard_Boolean IsClosed(const Handle(TypeCurve)& theCur,
const Standard_Real theTol)
{
const Standard_Real aFPar = theCur->FirstParameter(),
aLPar = theCur->LastParameter();
return (theCur->Value(aFPar).SquareDistance(theCur->Value(aLPar)) < theTol*theTol);
}
//! Returns true if the poles of U1 isoline and the poles of
//! U2 isoline of surface are identical according to tolerance criterion.
//! For rational surfaces Weights(i)*Poles(i) are checked.

View File

@@ -46,7 +46,7 @@ GeomLib_Check2dBSplineCurve::GeomLib_Check2dBSplineCurve(const Handle(Geom2d_BSp
vector_magnitude ;
num_poles = myCurve->NbPoles() ;
if (( ! myCurve->IsPeriodic() )&& num_poles >= 4) {
if (( ! myCurve->IsPeriodic111() )&& num_poles >= 4) {
gp_Vec2d tangent, tangent_normalized,
a_vector, avector_normalized;

View File

@@ -145,10 +145,9 @@ Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
}
if ( C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)) ) {
Handle(Geom_TrimmedCurve) CTrim = Handle(Geom_TrimmedCurve)::DownCast(C);
Standard_Real U1 = CTrim->FirstParameter();
Standard_Real U2 = CTrim->LastParameter();
if (!G2dC->IsPeriodic())
Standard_Real U1 = C->FirstParameter();
Standard_Real U2 = C->LastParameter();
if (!G2dC->IsPeriodic111())
{
U1 = Max(U1, G2dC->FirstParameter());
U2 = Min(U2, G2dC->LastParameter());

View File

@@ -89,7 +89,7 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_B
Handle(Geom2d_BSplineCurve) Bspli =
Handle(Geom2d_BSplineCurve)::DownCast(C);
// UPDATE FMA 1-04-96
if (C->IsPeriodic()) {
if (C->IsPeriodic111()) {
Handle(Geom2d_BSplineCurve) newBspli =
Handle(Geom2d_BSplineCurve)::DownCast(Bspli->Copy());
newBspli->SetNotPeriodic();

View File

@@ -343,7 +343,7 @@ static void Print(const Handle(Geom2d_BSplineCurve)& B,
OS << " rational";
}
Standard_Boolean periodic = B->IsPeriodic();
Standard_Boolean periodic = B->IsPeriodic111();
if (compact)
OS << (periodic ? 1 : 0) << " ";
else {

View File

@@ -90,7 +90,7 @@ static void HermiteCoeff(const Handle(Geom2d_BSplineCurve)& BS,
BS->Weights(Weights);
BS->Multiplicities(Mults);
Degree = BS->Degree();
Periodic = BS->IsPeriodic();
Periodic = BS->IsPeriodic111();
Index0 = BS->FirstUKnotIndex();
Index1 = BS->LastUKnotIndex()-1;

View File

@@ -320,10 +320,12 @@ void IGESToBRep_IGESBoundary::ReverseCurves3d (const Handle(ShapeExtend_WireData
for (Standard_Integer i = 1; i <= sewd->NbEdges(); i++) {
TopoDS_Edge oldedge = sewd->Edge (i), newedge;
Standard_Real p1, p2;
// Trimmed curve is never returned
Handle(Geom2d_Curve) curve = BRep_Tool::CurveOnSurface (oldedge, face, p1, p2);
// skl 24.04.2002 for OCC314
if(curve->IsPeriodic())
if(curve->IsPeriodic111())
ShapeBuild_Edge().MakeEdge (newedge, curve->Reversed(), face,
curve->ReversedParameter (p2),
curve->ReversedParameter (p1));

View File

@@ -2093,7 +2093,7 @@ Standard_Boolean IsCurveValid (const Handle(Geom2d_Curve)& thePCurve)
Standard_Real pf = 0., pl = 0.;
gp_Pnt2d pntf, pntl;
if(!thePCurve->IsClosed() && !thePCurve->IsPeriodic()) {
if(!thePCurve->IsClosed() && !thePCurve->IsPeriodic111()) {
pf = thePCurve->FirstParameter();
pl = thePCurve->LastParameter();
pntf = thePCurve->Value(pf);

View File

@@ -506,11 +506,11 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector
Handle(Geom2d_TrimmedCurve) bisector =
ChangeGeomBis(abisector->BisectorNumber()).ChangeValue();
if(bisector->BasisCurve()->IsPeriodic() && param == Precision::Infinite()) {
param = bisector->FirstParameter() + 2*M_PI;
if(bisector->IsPeriodic111()) {
param = Min(bisector->FirstParameter() + bisector->Period(), param);
}
if (param > bisector->BasisCurve()->LastParameter()) {
param = bisector->BasisCurve()->LastParameter();
if (param > bisector->LastParameter()) {
param = bisector->LastParameter();
}
if(bisector->FirstParameter() == param) return Standard_False;
@@ -527,8 +527,8 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector
const Standard_Integer apoint)
{
Standard_Real Param;
Handle(Geom2d_TrimmedCurve) Bisector =
ChangeGeomBis(abisector->BisectorNumber()).ChangeValue();
const Handle(Geom2d_TrimmedCurve) &Bisector =
ChangeGeomBis(abisector->BisectorNumber()).ChangeValue();
Handle(Bisector_Curve) Bis = Handle(Bisector_Curve)::
DownCast(Bisector->BasisCurve());
@@ -536,8 +536,8 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector
// Param = ParameterOnCurve(Bisector,theGeomPnts.Value(apoint));
Param = Bis->Parameter(GeomPnt (apoint));
if (Bisector->BasisCurve()->IsPeriodic()) {
if (Bisector->FirstParameter() > Param) Param = Param + 2*M_PI;
if (Bisector->IsPeriodic111()) {
if (Bisector->FirstParameter() > Param) Param += Bisector->Period();
}
if(Bisector->FirstParameter() >= Param)return Standard_False;
if(Bisector->LastParameter() < Param)return Standard_False;
@@ -587,7 +587,7 @@ Standard_Boolean MAT2d_Tool2d::Projection (const Standard_Integer IEdge ,
INext = (IEdge == theCircuit->NumberOfItems()) ? 1 : (IEdge + 1);
if (theCircuit->ConnexionOn(INext)) {
ParamMax = theCircuit->Connexion(INext)->ParameterOnFirst();
if (Curve->BasisCurve()->IsPeriodic()){
if (Curve->IsPeriodic111()){
ElCLib::AdjustPeriodic(0.,2*M_PI,Eps,ParamMin,ParamMax);
}
}
@@ -1316,7 +1316,7 @@ IntRes2d_Domain Domain(const Handle(Geom2d_TrimmedCurve)& Bisector1,
IntRes2d_Domain Domain1(Bisector1->Value(Param1),Param1,Tolerance,
Bisector1->Value(Param2),Param2,Tolerance);
if(Bisector1->BasisCurve()->IsPeriodic()) {
if(Bisector1->IsPeriodic111()) {
Domain1.SetEquivalentParameters(0.,2.*M_PI);
}
return Domain1;

View File

@@ -1239,5 +1239,5 @@ Standard_Boolean ShapeAnalysis_Curve::IsPeriodic(const Handle(Geom2d_Curve)& the
if (aTmpCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
aTmpCurve = Handle(Geom2d_TrimmedCurve)::DownCast(aTmpCurve)->BasisCurve();
}
return aTmpCurve->IsPeriodic();
return aTmpCurve->IsPeriodic111();
}

View File

@@ -172,7 +172,7 @@ Standard_Boolean IsPeriodic(const Handle(Geom2d_Curve)& theCurve)
if (aTmpCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
aTmpCurve = Handle(Geom2d_TrimmedCurve)::DownCast(aTmpCurve)->BasisCurve();
}
return aTmpCurve->IsPeriodic();
return aTmpCurve->IsPeriodic111();
}
void ShapeBuild_Edge::CopyRanges (const TopoDS_Edge& toedge,

View File

@@ -398,10 +398,10 @@ static inline void SegmentCurve (HCurve& curve,
{
if(curve->FirstParameter() < first - Precision::PConfusion() ||
curve->LastParameter() > last + Precision::PConfusion()) {
if(curve->IsPeriodic())
curve->Segment(first,last);
else curve->Segment(Max(curve->FirstParameter(),first),
Min(curve->LastParameter(),last));
//if(curve->IsPeriodic())
// curve->Segment(first,last);
//else curve->Segment(Max(curve->FirstParameter(),first),
// Min(curve->LastParameter(),last));
}
}

View File

@@ -935,7 +935,7 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
gp_Pnt2d lastPnt2d = C2d->Value(lastPar);
gp_Pnt prevPnt = myGrid->Value ( prevPnt2d );
gp_Pnt lastPnt = myGrid->Value ( lastPnt2d );
Standard_Boolean isPeriodic = C2d->IsPeriodic();
Standard_Boolean isPeriodic = C2d->IsPeriodic111();
Standard_Real aPeriod = (isPeriodic ? C2d->Period() :0.);
// Splitting edge

View File

@@ -318,7 +318,7 @@ ShapePersistent_Geom2d_Curve::Translate(const Handle(Geom2d_BSplineCurve)& theCu
Handle(BSpline) aPBSC = new BSpline;
Handle(pBSpline) aPpBSC = new pBSpline;
aPpBSC->myRational = theCurve->IsRational();
aPpBSC->myPeriodic = theCurve->IsPeriodic();
aPpBSC->myPeriodic = theCurve->IsPeriodic111();
aPpBSC->mySpineDegree = theCurve->Degree();
aPpBSC->myPoles = StdLPersistent_HArray1::Translate<TColgp_HArray1OfPnt2d>("PColgp_HArray1OfPnt2d", theCurve->Poles());
if (theCurve->IsRational()) {

View File

@@ -149,7 +149,7 @@ static Handle(Geom_BSplineCurve) BSplineCurve2dTo3d (const Handle(Geom2d_BSpline
Poles3d (i) = gp_Pnt (Poles2d (i).X(), Poles2d (i).Y(), 0);
Handle(Geom_BSplineCurve) BS3d = new Geom_BSplineCurve (Poles3d, Weights,
Knots, Mults, deg, BS->IsPeriodic());
Knots, Mults, deg, BS->IsPeriodic111());
return BS3d;
}