aOutTol, theContext);
}
//
- if (aC3DE->IsPeriodic()) {
+ if (aC3DE->IsPeriodic111()) {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D,
aC2DA, theContext);
}
GeomAdaptor_Curve aGACurve(aCurve);
GeomAbs_CurveType aType = aGACurve.GetType();
- Handle(Geom_Curve) aBasisCurve = aGACurve.Curve();
Standard_Boolean isFwd = (wexp.Orientation() != TopAbs_REVERSED);
- if (aBasisCurve->IsPeriodic()) {
- ElCLib::AdjustPeriodic
- (aBasisCurve->FirstParameter(), aBasisCurve->LastParameter(),
- Precision::PConfusion(), fpar, lpar);
+ if (aGACurve.IsPeriodic())
+ {
+ const Handle(Geom_Curve) &aBasisCurve = aGACurve.Curve();
+ ElCLib::AdjustPeriodic(aBasisCurve->FirstParameter(), aBasisCurve->LastParameter(),
+ Precision::PConfusion(), fpar, lpar);
}
if (CurveSeq.IsEmpty()) {
if (isSameCurve) {
const Standard_Boolean isSameDir = (isFwd == IsFwdSeq.Last());
- if (aBasisCurve->IsPeriodic()) {
+ if (aGACurve.IsPeriodic())
+ {
// Treat periodic curves.
- const Standard_Real aPeriod = aBasisCurve->Period();
+ const Standard_Real aPeriod = aGACurve.Period();
if (isSameDir) {
// Check if first parameter is greater then the last one.
TopTools_ListIteratorOfListOfShape it,it2;
Standard_Integer sens = 0;
+ // Almost all curves in scur are trimmed curve (e.g. see LocOpe_DPrism::Curves(...))
TColGeom_SequenceOfCurve scur;
Curves(scur);
}
mu = ASI2.Point(jj,1).Parameter();
Mu = ASI2.Point(jj,ASI2.NbPoints(jj)).Parameter();
- if (!scur(jj)->IsPeriodic()) {
+ if (!scur(jj)->IsPeriodic111()) {
Standard_Integer ku, kf;
if (! (mu > Mf || mf > Mu)) { //overlapping intervals
sens = 1;
prmin2, prmax2, prbmin2, prbmax2, flag1);
// case of revolutions
- if (C->IsPeriodic()) {
+ if (C->IsPeriodic111()) {
Standard_Real period = C->Period();
prmax = prmax2;
if (flag1) {
Standard_Real min, max, pmin, pmax;
Standard_Boolean flag2;
for (it.Initialize(lshape); it.More(); it.Next()) {
- if (C->IsPeriodic()) {
+ if (C->IsPeriodic111()) {
Standard_Real period = C->Period();
Standard_Real pr, prb;
BRepFeat::ParametricMinMax(it.Value(),C, pr, prmax1,
// try duplication
GeomAdaptor_Surface GAS1(S);
- GeomAbs_SurfaceType Type1 = GAS1.GetType();
- if ( UU1->IsPeriodic()) {
+ if (UU1->IsPeriodic111() && UU1->IsClosed())
+ {
ElCLib::AdjustPeriodic(UU1->FirstParameter(),
UU1->LastParameter(),
Precision::PConfusion(),
Umin, Umax);
}
- if ( VV1->IsPeriodic()) {
+ if (VV1->IsPeriodic111() && VV1->IsClosed())
+ {
ElCLib::AdjustPeriodic(VV1->FirstParameter(),
VV1->LastParameter(),
Precision::PConfusion(),
// try duplication
GeomAdaptor_Surface GAS2(S);
- GeomAbs_SurfaceType Type2 = GAS2.GetType();
- if ( UU2->IsPeriodic()) {
+ if (UU2->IsPeriodic111() && UU2->IsClosed())
+ {
ElCLib::AdjustPeriodic(UU2->FirstParameter(),
UU2->LastParameter(),
Precision::PConfusion(),
Umin, Umax);
}
- if ( VV2->IsPeriodic()) {
+ if (VV2->IsPeriodic111() && VV2->IsClosed())
+ {
ElCLib::AdjustPeriodic(VV2->FirstParameter(),
VV2->LastParameter(),
Precision::PConfusion(),
if ( myKPart == 1)
myCont = GeomAbs_G1;
- if ( (Type1 == GeomAbs_Plane) && (Type2 == GeomAbs_Plane)) {
+ if ((GAS1.GetType() == GeomAbs_Plane) && (GAS2.GetType() == GeomAbs_Plane))
+ {
myKPart = 2;
}
}
Geom2dAdaptor_Curve& GAC2d = HC2d->ChangeCurve2d();
GeomAdaptor_Surface& GAS = HS->ChangeSurface();
- // modified by NIZHNY-OCC486 Tue Aug 27 17:15:13 2002 :
- Standard_Boolean m_TrimmedPeriodical = Standard_False;
- Handle(Standard_Type) TheType = C3d->DynamicType();
- if( TheType == STANDARD_TYPE(Geom_TrimmedCurve))
+ if (!C3d->IsPeriodic111())
{
- Handle(Geom_Curve) gtC (Handle(Geom_TrimmedCurve)::DownCast (C3d)->BasisCurve());
- m_TrimmedPeriodical = gtC->IsPeriodic();
- }
- // modified by NIZHNY-OCC486 Tue Aug 27 17:15:17 2002 .
-
-
- if(!C3d->IsPeriodic()) {
Standard_Real Udeb = C3d->FirstParameter();
Standard_Real Ufin = C3d->LastParameter();
// modified by NIZHNY-OCC486 Tue Aug 27 17:17:14 2002 :
//if (Udeb > f3d) f3d = Udeb;
//if (l3d > Ufin) l3d = Ufin;
- if(!m_TrimmedPeriodical)
- {
- if (Udeb > f3d) f3d = Udeb;
- if (l3d > Ufin) l3d = Ufin;
- }
+ if (Udeb > f3d) f3d = Udeb;
+ if (l3d > Ufin) l3d = Ufin;
// modified by NIZHNY-OCC486 Tue Aug 27 17:17:55 2002 .
}
if(!L3d.IsIdentity()){
const Standard_Real pp1,
const Standard_Real pp2)
{
- // kill trimmed curves
- Handle(Geom_Curve) C = CC;
- Handle(Geom_TrimmedCurve) CT = Handle(Geom_TrimmedCurve)::DownCast(C);
- while (!CT.IsNull()) {
- C = CT->BasisCurve();
- CT = Handle(Geom_TrimmedCurve)::DownCast(C);
- }
+ // kill trimmed curves to obtain First/Last-parameters of basis curve
+ const Handle(Geom_Curve) C = (CC->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) ?
+ Handle(Geom_TrimmedCurve)::DownCast(CC)->BasisCurve() : CC;
// check parameters
Standard_Real p1 = pp1;
Standard_Real cf = C->FirstParameter();
Standard_Real cl = C->LastParameter();
Standard_Real epsilon = Precision::PConfusion();
- Standard_Boolean periodic = C->IsPeriodic();
GeomAdaptor_Curve aCA(C);
TopoDS_Vertex V1,V2;
- if (periodic) {
+ if (C->IsPeriodic111())
+ {
// adjust in period
ElCLib::AdjustPeriodic(cf,cl,epsilon,p1,p2);
V1 = VV1;
V2 = VV2;
}
else {
- // reordonate
+ // reordinate
if (p1 < p2) {
V1 = VV1;
V2 = VV2;
else {
V2 = VV1;
V1 = VV2;
- Standard_Real x = p1;
- p1 = p2;
- p2 = x;
+ std::swap(p1, p2);
}
// check range
f = FirstParOnPC;
l = LastParOnPC;
}
- else if (C3d->IsPeriodic())
+ else if (C3d->IsPeriodic111())
{
Standard_Real delta = (C3d->Period() - (l - f))*0.5;
delta *= 0.95;
LastPar = C3d->LastParameter();
BB.UpdateEdge(NE, C3d, Precision::Confusion());
}
- else if (C3d->IsPeriodic())
+ else if (C3d->IsPeriodic111())
{
Standard_Real delta = (C3d->Period() - (anEl - anEf))*0.5;
delta *= 0.95;
Standard_Real aF, aL;
const Handle(Geom_Curve) aC = BRep_Tool::Curve(anEdge, aF, aL);
if (!aC.IsNull() &&
- (!aC->IsClosed() && !aC->IsPeriodic()))
+ (!aC->IsClosed() && !aC->IsPeriodic111()))
{
gp_Pnt aPntF = BRep_Tool::Pnt(V1);
gp_Pnt aPntL = BRep_Tool::Pnt(V2);
if (V11.IsSame(V21) || V11.IsSame(V22) ||
V12.IsSame(V21) || V12.IsSame(V22))
- return Standard_True;
+ return Standard_True;
return Standard_False;
}
//=======================================================================
static void CheckIntersFF(const BOPDS_PDS& pDS,
- const TopoDS_Edge& RefEdge,
- TopTools_IndexedMapOfShape& TrueEdges)
+ const TopoDS_Edge& RefEdge,
+ TopTools_IndexedMapOfShape& TrueEdges)
{
BOPDS_VectorOfInterfFF& aFFs = pDS->InterfFF();
Standard_Integer aNb = aFFs.Length();
BB.MakeCompound(Edges);
for (i = 0; i < aNb; ++i)
- {
- BOPDS_InterfFF& aFFi=aFFs(i);
- const BOPDS_VectorOfCurve& aBCurves=aFFi.Curves();
- Standard_Integer aNbCurves = aBCurves.Length();
-
- for (j = 0; j < aNbCurves; ++j)
{
- const BOPDS_Curve& aBC=aBCurves(j);
- const BOPDS_ListOfPaveBlock& aSectEdges = aBC.PaveBlocks();
-
- BOPDS_ListIteratorOfListOfPaveBlock aPBIt;
- aPBIt.Initialize(aSectEdges);
+ BOPDS_InterfFF& aFFi=aFFs(i);
+ const BOPDS_VectorOfCurve& aBCurves=aFFi.Curves();
+ Standard_Integer aNbCurves = aBCurves.Length();
- for (; aPBIt.More(); aPBIt.Next())
- {
- const Handle(BOPDS_PaveBlock)& aPB = aPBIt.Value();
- Standard_Integer nSect = aPB->Edge();
- const TopoDS_Edge& anEdge = *(TopoDS_Edge*)&pDS->Shape(nSect);
+ for (j = 0; j < aNbCurves; ++j)
+ {
+ const BOPDS_Curve& aBC=aBCurves(j);
+ const BOPDS_ListOfPaveBlock& aSectEdges = aBC.PaveBlocks();
+
+ BOPDS_ListIteratorOfListOfPaveBlock aPBIt;
+ aPBIt.Initialize(aSectEdges);
+
+ for (; aPBIt.More(); aPBIt.Next())
+ {
+ const Handle(BOPDS_PaveBlock)& aPB = aPBIt.Value();
+ Standard_Integer nSect = aPB->Edge();
+ const TopoDS_Edge& anEdge = *(TopoDS_Edge*)&pDS->Shape(nSect);
BB.Add(Edges, anEdge);
- nbe++;
- }
+ nbe++;
+ }
+ }
}
- }
if (nbe == 0)
return;
-
+
TopTools_ListOfShape CompList;
BOPTools_AlgoTools::MakeConnexityBlocks(Edges, TopAbs_VERTEX, TopAbs_EDGE, CompList);
if (CompList.Extent() == 1)
NearestCompound = CompList.First();
else
- {
+ {
BRepAdaptor_Curve BAcurve(RefEdge);
gp_Pnt Pref = BAcurve.Value((BAcurve.FirstParameter()+BAcurve.LastParameter())/2);
TopoDS_Vertex Vref = BRepLib_MakeVertex(Pref);
Standard_Real MinDist = RealLast();
TopTools_ListIteratorOfListOfShape itl(CompList);
for (; itl.More(); itl.Next())
- {
+ {
const TopoDS_Shape& aCompound = itl.Value();
-
+
BRepExtrema_DistShapeShape Projector(Vref, aCompound);
if (!Projector.IsDone() || Projector.NbSolution() == 0)
continue;
-
+
Standard_Real aDist = Projector.Value();
if (aDist < MinDist)
- {
+ {
MinDist = aDist;
NearestCompound = aCompound;
}
}
- }
+ }
TopExp::MapShapes(NearestCompound, TopAbs_EDGE, TrueEdges);
-}
-
+ }
+
//=======================================================================
//function : AssembleEdge
//purpose :
//=======================================================================
static TopoDS_Edge AssembleEdge(const BOPDS_PDS& pDS,
- const TopoDS_Face& F1,
- const TopoDS_Face& F2,
- const Standard_Boolean addPCurve1,
- const Standard_Boolean addPCurve2,
- const TopTools_SequenceOfShape& EdgesForConcat)
+ const TopoDS_Face& F1,
+ const TopoDS_Face& F2,
+ const Standard_Boolean addPCurve1,
+ const Standard_Boolean addPCurve2,
+ const TopTools_SequenceOfShape& EdgesForConcat)
{
TopoDS_Edge NullEdge;
TopoDS_Edge CurEdge = TopoDS::Edge( EdgesForConcat(1) );
Standard_Real aGlueTol = Precision::Confusion();
for (Standard_Integer j = 2; j <= EdgesForConcat.Length(); j++)
- {
- TopoDS_Edge anEdge = TopoDS::Edge( EdgesForConcat(j) );
- Standard_Boolean After = Standard_False;
- TopoDS_Vertex Vfirst, Vlast;
+ {
+ TopoDS_Edge anEdge = TopoDS::Edge( EdgesForConcat(j) );
+ Standard_Boolean After = Standard_False;
+ TopoDS_Vertex Vfirst, Vlast;
Standard_Boolean AreClosedWire = AreClosed( CurEdge, anEdge );
if (AreClosedWire)
- {
- TopoDS_Vertex V1, V2;
- TopExp::Vertices( CurEdge, V1, V2 );
+ {
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices( CurEdge, V1, V2 );
Standard_Boolean IsAutonomV1 = IsAutonomVertex( V1, pDS, F1, F2 );
Standard_Boolean IsAutonomV2 = IsAutonomVertex( V2, pDS, F1, F2 );
if (IsAutonomV1)
- {
- After = Standard_False;
- Vfirst = Vlast = V2;
- }
+ {
+ After = Standard_False;
+ Vfirst = Vlast = V2;
+ }
else if (IsAutonomV2)
- {
- After = Standard_True;
- Vfirst = Vlast = V1;
- }
+ {
+ After = Standard_True;
+ Vfirst = Vlast = V1;
+ }
else
return NullEdge;
- }
- else
- {
- TopoDS_Vertex CV, V11, V12, V21, V22;
- TopExp::CommonVertex( CurEdge, anEdge, CV );
+ }
+ else
+ {
+ TopoDS_Vertex CV, V11, V12, V21, V22;
+ TopExp::CommonVertex( CurEdge, anEdge, CV );
Standard_Boolean IsAutonomCV = IsAutonomVertex( CV, pDS, F1, F2 );
if (IsAutonomCV)
{
- aGlueTol = BRep_Tool::Tolerance(CV);
- TopExp::Vertices( CurEdge, V11, V12 );
- TopExp::Vertices( anEdge, V21, V22 );
- if (V11.IsSame(CV) && V21.IsSame(CV))
- {
- Vfirst = V22;
- Vlast = V12;
- }
- else if (V11.IsSame(CV) && V22.IsSame(CV))
- {
- Vfirst = V21;
- Vlast = V12;
- }
- else if (V12.IsSame(CV) && V21.IsSame(CV))
- {
- Vfirst = V11;
- Vlast = V22;
- }
- else
- {
- Vfirst = V11;
- Vlast = V21;
- }
+ aGlueTol = BRep_Tool::Tolerance(CV);
+ TopExp::Vertices( CurEdge, V11, V12 );
+ TopExp::Vertices( anEdge, V21, V22 );
+ if (V11.IsSame(CV) && V21.IsSame(CV))
+ {
+ Vfirst = V22;
+ Vlast = V12;
+ }
+ else if (V11.IsSame(CV) && V22.IsSame(CV))
+ {
+ Vfirst = V21;
+ Vlast = V12;
+ }
+ else if (V12.IsSame(CV) && V21.IsSame(CV))
+ {
+ Vfirst = V11;
+ Vlast = V22;
+ }
+ else
+ {
+ Vfirst = V11;
+ Vlast = V21;
+ }
}
else
return NullEdge;
- } //end of else (open wire)
-
- TopoDS_Edge NewEdge = Glue(CurEdge, anEdge, Vfirst, Vlast, After,
- F1, addPCurve1, F2, addPCurve2, aGlueTol);
+ } //end of else (open wire)
+
+ TopoDS_Edge NewEdge = Glue(CurEdge, anEdge, Vfirst, Vlast, After,
+ F1, addPCurve1, F2, addPCurve2, aGlueTol);
if (NewEdge.IsNull())
return NullEdge;
else
CurEdge = NewEdge;
- } //end of for (Standard_Integer j = 2; j <= EdgesForConcat.Length(); j++)
+ } //end of for (Standard_Integer j = 2; j <= EdgesForConcat.Length(); j++)
return CurEdge;
}
if(!aC3DETrim.IsNull()) {
Handle(Geom2d_Curve) aC2dNew;
- if(aC3DE->IsPeriodic()) {
+ if(aC3DE->IsPeriodic111()) {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F1, f, l, aC2d, aC2dNew, aContext);
}
else {
if(!aC3DETrim.IsNull()) {
Handle(Geom2d_Curve) aC2dNew;
- if(aC3DE->IsPeriodic()) {
+ if(aC3DE->IsPeriodic111()) {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F2, f, l, aC2d, aC2dNew, aContext);
}
else {
if (L1.Extent() > 1 && (!isEl1 || !isEl2)) {
TopTools_SequenceOfShape eseq;
TopTools_SequenceOfShape EdgesForConcat;
-
+
if (!TrueEdges.IsEmpty())
- {
- for (i = TrueEdges.Extent(); i >= 1; i--)
- EdgesForConcat.Append( TrueEdges(i) );
+ {
+ for (i = TrueEdges.Extent(); i >= 1; i--)
+ EdgesForConcat.Append( TrueEdges(i) );
TopoDS_Edge AssembledEdge =
AssembleEdge( pDS, F1, F2, addPCurve1, addPCurve2, EdgesForConcat );
if (AssembledEdge.IsNull())
eseq.Append( TrueEdges(i) );
else
eseq.Append(AssembledEdge);
- }
+ }
else
- {
- TopTools_SequenceOfShape wseq;
- TopTools_SequenceOfShape edges;
- TopTools_ListIteratorOfListOfShape itl(L1);
- for (; itl.More(); itl.Next())
- edges.Append( itl.Value() );
- while (!edges.IsEmpty())
{
- TopoDS_Edge anEdge = TopoDS::Edge( edges.First() );
+ TopTools_SequenceOfShape wseq;
+ TopTools_SequenceOfShape edges;
+ TopTools_ListIteratorOfListOfShape itl(L1);
+ for (; itl.More(); itl.Next())
+ edges.Append( itl.Value() );
+ while (!edges.IsEmpty())
+ {
+ TopoDS_Edge anEdge = TopoDS::Edge( edges.First() );
TopoDS_Wire aWire, resWire;
BB.MakeWire(aWire);
BB.Add( aWire, anEdge );
- TColStd_SequenceOfInteger Candidates;
- for (k = 1; k <= wseq.Length(); k++)
- {
- resWire = TopoDS::Wire(wseq(k));
+ TColStd_SequenceOfInteger Candidates;
+ for (k = 1; k <= wseq.Length(); k++)
+ {
+ resWire = TopoDS::Wire(wseq(k));
if (AreConnex( resWire, aWire ))
- {
- Candidates.Append( 1 );
- break;
- }
- }
- if (Candidates.IsEmpty())
- {
- wseq.Append( aWire );
- edges.Remove(1);
- }
- else
- {
- for (j = 2; j <= edges.Length(); j++)
- {
- anEdge = TopoDS::Edge( edges(j) );
+ {
+ Candidates.Append( 1 );
+ break;
+ }
+ }
+ if (Candidates.IsEmpty())
+ {
+ wseq.Append( aWire );
+ edges.Remove(1);
+ }
+ else
+ {
+ for (j = 2; j <= edges.Length(); j++)
+ {
+ anEdge = TopoDS::Edge( edges(j) );
aWire.Nullify();
BB.MakeWire(aWire);
BB.Add( aWire, anEdge );
if (AreConnex( resWire, aWire ))
- Candidates.Append( j );
- }
- Standard_Integer minind = 1;
- if (Candidates.Length() > 1)
- {
- Standard_Real MinAngle = RealLast();
- for (j = 1; j <= Candidates.Length(); j++)
- {
- anEdge = TopoDS::Edge( edges(Candidates(j)) );
- Standard_Real anAngle = AngleWireEdge( resWire, anEdge );
- if (anAngle < MinAngle)
- {
- MinAngle = anAngle;
- minind = j;
- }
- }
- }
+ Candidates.Append( j );
+ }
+ Standard_Integer minind = 1;
+ if (Candidates.Length() > 1)
+ {
+ Standard_Real MinAngle = RealLast();
+ for (j = 1; j <= Candidates.Length(); j++)
+ {
+ anEdge = TopoDS::Edge( edges(Candidates(j)) );
+ Standard_Real anAngle = AngleWireEdge( resWire, anEdge );
+ if (anAngle < MinAngle)
+ {
+ MinAngle = anAngle;
+ minind = j;
+ }
+ }
+ }
BB.Add( resWire, TopoDS::Edge(edges(Candidates(minind))) );
wseq(k) = resWire;
- edges.Remove(Candidates(minind));
- }
- } //end of while (!edges.IsEmpty())
-
- for (i = 1; i <= wseq.Length(); i++)
- {
- TopoDS_Wire aWire = TopoDS::Wire(wseq(i));
- TopTools_SequenceOfShape aLocalEdgesForConcat;
- if (aWire.Closed())
- {
- TopoDS_Vertex StartVertex;
- TopoDS_Edge StartEdge;
- Standard_Boolean StartFound = Standard_False;
- TopTools_ListOfShape Elist;
-
- TopoDS_Iterator itw(aWire);
- for (; itw.More(); itw.Next())
- {
- TopoDS_Edge anEdge = TopoDS::Edge(itw.Value());
- if (StartFound)
- Elist.Append(anEdge);
- else
- {
- TopoDS_Vertex V1, V2;
- TopExp::Vertices( anEdge, V1, V2 );
- if (!IsAutonomVertex( V1, pDS ))
- {
- StartVertex = V2;
- StartEdge = anEdge;
- StartFound = Standard_True;
- }
- else if (!IsAutonomVertex( V2, pDS ))
- {
- StartVertex = V1;
- StartEdge = anEdge;
- StartFound = Standard_True;
- }
- else
- Elist.Append(anEdge);
- }
- } //end of for (; itw.More(); itw.Next())
- if (!StartFound)
- {
- itl.Initialize(Elist);
- StartEdge = TopoDS::Edge(itl.Value());
- Elist.Remove(itl);
- TopoDS_Vertex V1, V2;
- TopExp::Vertices( StartEdge, V1, V2 );
- StartVertex = V1;
- }
- aLocalEdgesForConcat.Append( StartEdge );
- while (!Elist.IsEmpty())
- {
- for (itl.Initialize(Elist); itl.More(); itl.Next())
- {
- TopoDS_Edge anEdge = TopoDS::Edge(itl.Value());
- TopoDS_Vertex V1, V2;
- TopExp::Vertices( anEdge, V1, V2 );
- if (V1.IsSame(StartVertex))
- {
- StartVertex = V2;
- aLocalEdgesForConcat.Append( anEdge );
- Elist.Remove(itl);
- break;
- }
- else if (V2.IsSame(StartVertex))
- {
- StartVertex = V1;
- aLocalEdgesForConcat.Append( anEdge );
- Elist.Remove(itl);
- break;
- }
- }
- } //end of while (!Elist.IsEmpty())
- } //end of if (aWire.Closed())
- else
- {
- BRepTools_WireExplorer Wexp( aWire );
- for (; Wexp.More(); Wexp.Next())
- aLocalEdgesForConcat.Append( Wexp.Current() );
- }
+ edges.Remove(Candidates(minind));
+ }
+ } //end of while (!edges.IsEmpty())
+ for (i = 1; i <= wseq.Length(); i++)
+ {
+ TopoDS_Wire aWire = TopoDS::Wire(wseq(i));
+ TopTools_SequenceOfShape aLocalEdgesForConcat;
+ if (aWire.Closed())
+ {
+ TopoDS_Vertex StartVertex;
+ TopoDS_Edge StartEdge;
+ Standard_Boolean StartFound = Standard_False;
+ TopTools_ListOfShape Elist;
+
+ TopoDS_Iterator itw(aWire);
+ for (; itw.More(); itw.Next())
+ {
+ TopoDS_Edge anEdge = TopoDS::Edge(itw.Value());
+ if (StartFound)
+ Elist.Append(anEdge);
+ else
+ {
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices( anEdge, V1, V2 );
+ if (!IsAutonomVertex( V1, pDS ))
+ {
+ StartVertex = V2;
+ StartEdge = anEdge;
+ StartFound = Standard_True;
+ }
+ else if (!IsAutonomVertex( V2, pDS ))
+ {
+ StartVertex = V1;
+ StartEdge = anEdge;
+ StartFound = Standard_True;
+ }
+ else
+ Elist.Append(anEdge);
+ }
+ } //end of for (; itw.More(); itw.Next())
+ if (!StartFound)
+ {
+ itl.Initialize(Elist);
+ StartEdge = TopoDS::Edge(itl.Value());
+ Elist.Remove(itl);
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices( StartEdge, V1, V2 );
+ StartVertex = V1;
+ }
+ aLocalEdgesForConcat.Append( StartEdge );
+ while (!Elist.IsEmpty())
+ {
+ for (itl.Initialize(Elist); itl.More(); itl.Next())
+ {
+ TopoDS_Edge anEdge = TopoDS::Edge(itl.Value());
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices( anEdge, V1, V2 );
+ if (V1.IsSame(StartVertex))
+ {
+ StartVertex = V2;
+ aLocalEdgesForConcat.Append( anEdge );
+ Elist.Remove(itl);
+ break;
+ }
+ else if (V2.IsSame(StartVertex))
+ {
+ StartVertex = V1;
+ aLocalEdgesForConcat.Append( anEdge );
+ Elist.Remove(itl);
+ break;
+ }
+ }
+ } //end of while (!Elist.IsEmpty())
+ } //end of if (aWire.Closed())
+ else
+ {
+ BRepTools_WireExplorer Wexp( aWire );
+ for (; Wexp.More(); Wexp.Next())
+ aLocalEdgesForConcat.Append( Wexp.Current() );
+ }
+
TopoDS_Edge AssembledEdge =
AssembleEdge( pDS, F1, F2, addPCurve1, addPCurve2, aLocalEdgesForConcat );
if (AssembledEdge.IsNull())
eseq.Append( aLocalEdgesForConcat(j) );
else
eseq.Append( AssembledEdge );
- }
- } //end of else (when TrueEdges is empty)
+ }
+ } //end of else (when TrueEdges is empty)
if (eseq.Length() < L1.Extent())
- {
- L1.Clear();
- L2.Clear();
- for (i = 1; i <= eseq.Length(); i++)
{
+ L1.Clear();
+ L2.Clear();
+ for (i = 1; i <= eseq.Length(); i++)
+ {
TopoDS_Shape aShape = eseq(i);
- TopoDS_Edge anEdge = TopoDS::Edge(eseq(i));
- BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
- Standard_Real EdgeTol = BRep_Tool::Tolerance(anEdge);
+ TopoDS_Edge anEdge = TopoDS::Edge(eseq(i));
+ BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
+ Standard_Real EdgeTol = BRep_Tool::Tolerance(anEdge);
#ifdef OCCT_DEBUG
- cout<<"Tolerance of glued E = "<<EdgeTol<<endl;
+ cout<<"Tolerance of glued E = "<<EdgeTol<<endl;
#endif
- if (EdgeTol > 1.e-2)
- continue;
-
- if (EdgeTol >= 1.e-4)
- {
- ReconstructPCurves(anEdge);
- BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
+ if (EdgeTol > 1.e-2)
+ continue;
+
+ if (EdgeTol >= 1.e-4)
+ {
+ ReconstructPCurves(anEdge);
+ BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
#ifdef OCCT_DEBUG
- cout<<"After projection tol of E = "<<BRep_Tool::Tolerance(anEdge)<<endl;
+ cout<<"After projection tol of E = "<<BRep_Tool::Tolerance(anEdge)<<endl;
#endif
- }
-
- OrientSection( anEdge, F1, F2, O1, O2 );
- if (Side == TopAbs_OUT)
- {
- O1 = TopAbs::Reverse(O1);
- O2 = TopAbs::Reverse(O2);
- }
-
- L1.Append( anEdge.Oriented(O1) );
- L2.Append( anEdge.Oriented(O2) );
+ }
+
+ OrientSection( anEdge, F1, F2, O1, O2 );
+ if (Side == TopAbs_OUT)
+ {
+ O1 = TopAbs::Reverse(O1);
+ O2 = TopAbs::Reverse(O2);
+ }
+
+ L1.Append( anEdge.Oriented(O1) );
+ L2.Append( anEdge.Oriented(O2) );
+ }
}
- }
} //end of if (L1.Extent() > 1)
-
+
else
- {
- TopTools_ListIteratorOfListOfShape itl(L1);
- for (; itl.More(); itl.Next())
{
- const TopoDS_Edge& anEdge = TopoDS::Edge( itl.Value() );
- BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
+ TopTools_ListIteratorOfListOfShape itl(L1);
+ for (; itl.More(); itl.Next())
+ {
+ const TopoDS_Edge& anEdge = TopoDS::Edge( itl.Value() );
+ BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
+ }
}
- }
}
//=======================================================================
Standard_Real coeff;
if (ExtensionMode == 1)
{
- UU1 = VV1 = - TheInfini;
- UU2 = VV2 = TheInfini;
+ UU1 = VV1 = - TheInfini;
+ UU2 = VV2 = TheInfini;
coeff = 0.25;
}
else
//Set first, last to avoid ErrosStatus = 2 because of
//too strong checking of limits in class CheckCurveOnSurface
//
- if(!C3d->IsPeriodic())
+ if(!C3d->IsPeriodic111())
{
first = Max(first, C3d->FirstParameter());
last = Min(last, C3d->LastParameter());
else
{
if(CT.ErrorStatus() == 3 || (CT.ErrorStatus() == 2 &&
- (C3d->IsPeriodic() || C2d->IsPeriodic111())))
+ (C3d->IsPeriodic111() || C2d->IsPeriodic111())))
{
//Try to estimate by sample points
Standard_Integer nbint = 22;
Standard_Real TolPar = Tol *.1;
- if(C->IsPeriodic()) {
+ if(C->IsPeriodic111()) {
Standard_Real p = C->Period();
Standard_Real d = Abs(l - f);
if(Abs(d - p) <= TolPar && l <= p) {}
Handle(Geom_BSplineCurve) BC = Handle(Geom_BSplineCurve)::DownCast(C) ;
- if(!BC->IsPeriodic()) {
+ if(!BC->IsPeriodic111()) {
BC->Resolution(Tol, UTol) ;
if(Abs(f - fnew) > UTol || Abs(l - lnew) > UTol) {
TColStd_Array1OfReal knots(1,BC->NbKnots()) ;
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;
Handle(Geom_BSplineCurve) Bsaux (Handle(Geom_BSplineCurve)::DownCast (G));
Standard_Real u1 = U1, u2 = U2;
//// modified by jgv, 24.10.01 for BUC61031 ////
- if (Bsaux->IsPeriodic())
+ if (Bsaux->IsPeriodic111())
ElCLib::AdjustPeriodic( Bsaux->FirstParameter(), Bsaux->LastParameter(), Precision::PConfusion(), u1, u2 );
else {
////////////////////////////////////////////////
tolreached = tol3d;
if (Abs(UV1.X()-UV2.X()) <= tol2d) {
- if (IFlag == 0) {
+ if (IFlag == 0)
+ {
Pardeb = UV1.Y();
Parfin = UV2.Y();
C3d = Surf->UIso(UV1.X());
- if(Pardeb > Parfin) {
+ if (Pardeb > Parfin)
+ {
Pardeb = C3d->ReversedParameter(Pardeb);
Parfin = C3d->ReversedParameter(Parfin);
C3d->Reverse();
}
- Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C3d);
- if(!tc.IsNull()) {
- C3d = tc->BasisCurve();
- if (C3d->IsPeriodic()) {
- ElCLib::AdjustPeriodic(C3d->FirstParameter(),C3d->LastParameter(),
- tol2d,Pardeb,Parfin);
- }
+
+ if (C3d->IsPeriodic111())
+ {
+ Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C3d);
+ if (!tc.IsNull()) C3d = tc->BasisCurve();
+ ElCLib::AdjustPeriodic(C3d->FirstParameter(), C3d->LastParameter(),
+ tol2d, Pardeb, Parfin);
}
}
if(IFlag != 1) {
}
else if (Abs(UV1.Y()-UV2.Y())<=tol2d) {
//iso v
- if (IFlag == 0) {
+ if (IFlag == 0)
+ {
Pardeb = UV1.X();
Parfin = UV2.X();
C3d = Surf->VIso(UV1.Y());
- if(Pardeb > Parfin) {
+ if (Pardeb > Parfin)
+ {
Pardeb = C3d->ReversedParameter(Pardeb);
Parfin = C3d->ReversedParameter(Parfin);
C3d->Reverse();
}
- Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C3d);
- if(!tc.IsNull()) {
- C3d = tc->BasisCurve();
- if (C3d->IsPeriodic()) {
- ElCLib::AdjustPeriodic(C3d->FirstParameter(),C3d->LastParameter(),
- tol2d,Pardeb,Parfin);
- }
+
+ if (C3d->IsPeriodic111())
+ {
+ Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C3d);
+ if (!tc.IsNull()) C3d = tc->BasisCurve();
+ ElCLib::AdjustPeriodic(C3d->FirstParameter(), C3d->LastParameter(),
+ tol2d, Pardeb, Parfin);
}
}
if(IFlag != 1) {
}
ptestdeb = C3d->Value(Uf);
ptestfin = C3d->Value(Ul);
- if (C3d->IsPeriodic() && !(failedF && failedL)) {
+ if (C3d->IsPeriodic111() && !(failedF && failedL)) {
// assure the same order of ends, otherwise TrimmedCurve will take
// the other part of C3d
gp_Pnt Ptmp;
//
fk = 2;
lk = BSpline->NbKnots()-1;
- if(BSpline->IsPeriodic()) {
+ if(BSpline->IsPeriodic111()) {
fk = 1;
}
if(caredeb) {
}
// elspine periodic => BSpline Periodic
if(ES.IsPeriodic()) {
- if(!BSpline->IsPeriodic()) {
+ if(!BSpline->IsPeriodic111()) {
BSpline->SetPeriodic();
//modified by NIZNHY-PKV Fri Dec 10 12:20:22 2010ft
if (iToApproxByC2) {
Standard_Real uf = FIop.FirstParameter();
Standard_Real ul = FIop.LastParameter();
Handle(GeomAdaptor_HCurve) Hc3df;
- if (c3dFI->IsPeriodic()) Hc3df = new GeomAdaptor_HCurve(c3dFI);
+ if (c3dFI->IsPeriodic111()) Hc3df = new GeomAdaptor_HCurve(c3dFI);
else Hc3df = new GeomAdaptor_HCurve(c3dFI,uf,ul);
if ( Update(HBs,Hc3df,FIop,CPop,FprolUV,isFirst,c3dU) )
Standard_Real Utrim,Vtrim;
Utrim=Ctrim->BasisCurve()->FirstParameter();
Vtrim=Ctrim->BasisCurve()->LastParameter();
- if (Ctrim->IsPeriodic()) {
+ if (Ctrim->IsPeriodic111()) {
if (Ubid>Ctrim->Period()) {
Ubid=(Utrim+Vtrim)/2;
Vbid= Vtrim;
Standard_Real uf = FiopArc.FirstParameter();
Standard_Real ul = FiopArc.LastParameter();
Handle(GeomAdaptor_HCurve) Hc3df;
- if(c3df->IsPeriodic()){
+ if(c3df->IsPeriodic111()){
Hc3df = new GeomAdaptor_HCurve(c3df);
}
else{
P = myVMap.ChangeFromKey(V).Parameter(E);
Handle(Geom_Curve) GC = myEMap.FindFromKey(E).Geometry();
- Handle(Standard_Type) typc = GC->DynamicType();
- if (typc == STANDARD_TYPE(Geom_TrimmedCurve)) {
- GC = Handle(Geom_TrimmedCurve)::DownCast(GC);
- typc = GC->DynamicType();
- }
if (GC->IsClosed()) {
TopoDS_Vertex FV = TopExp::FirstVertex(E);
FV.Orientation(E.Orientation());
if (!V.IsEqual(FV) && P <= paramf) {
- if (GC->IsPeriodic()) {
+ if (GC->IsPeriodic111()) {
P += GC->Period();
}
else {
}
}
- if (cbase->IsPeriodic()) {
- Standard_Real Per = cbase->Period();
+ if (C->IsPeriodic111())
+ {
+ Standard_Real Per = C->Period();
Standard_Real Tolp = Precision::Parametric(Precision::Confusion());
if (Abs(Per-param) <= Tolp) {
param = 0.;
for (Standard_Integer i = 2; i <= NbPoles; i++) {
dis.DrawTo(CPoles(i));
}
- if (C->IsPeriodic())
+ if (C->IsPeriodic111())
dis.DrawTo(CPoles(1));
}
deltaU = LastU - FirstU;
deltaV = LastV - FirstV;
- if (VCurve->IsPeriodic() && Abs( deltaU ) > VCurve->Period()/2)
+ if (VCurve->IsPeriodic111() && Abs( deltaU ) > VCurve->Period()/2)
{
Standard_Real Sign = (deltaU > 0.0)? -1.0 : 1.0;
deltaU = VCurve->Period() - Abs( deltaU );
deltaU *= Sign;
}
- if (UCurve->IsPeriodic() && Abs( deltaV ) > UCurve->Period()/2)
+ if (UCurve->IsPeriodic111() && Abs( deltaV ) > UCurve->Period()/2)
{
Standard_Real Sign = (deltaV > 0.0)? -1.0 : 1.0;
deltaV = UCurve->Period() - Abs( deltaV );
Standard_Integer& ErrorStatus)
{
Standard_Integer ii ;
- if (IsPeriodic()) {
+ if (IsPeriodic111()) {
//
// for the time being do not deal with periodic curves
//
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.
return Standard_False;
}
- if(!IsPeriodic())
+ if(!IsPeriodic111())
return Standard_True;
const Standard_Real aFirstParam = FirstParameter(),
//purpose :
//=======================================================================
-Standard_Boolean Geom_BSplineCurve::IsPeriodic () const
+Standard_Boolean Geom_BSplineCurve::IsPeriodic111 () const
{ return periodic; }
//=======================================================================
//purpose :
//=======================================================================
-Standard_Boolean Geom_BezierCurve::IsPeriodic () const
+Standard_Boolean Geom_BezierCurve::IsPeriodic111 () const
{
return Standard_False;
}
//! Returns True if the parametrization of a curve is periodic.
//! (P(u) = P(u + T) T = constante)
- 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
//purpose :
//=======================================================================
-Standard_Boolean Geom_Circle::IsPeriodic () const { return Standard_True; }
+Standard_Boolean Geom_Circle::IsPeriodic111 () const { return Standard_True; }
//=======================================================================
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
//! returns 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 + R * Cos (U) * XDir + R * Sin (U) * YDir
Standard_Real Geom_Curve::Period() const
{
Standard_NoSuchObject_Raise_if
- ( !IsPeriodic(),"Geom_Curve::Period");
+ ( !IsPeriodic111(),"Geom_Curve::Period");
return ( LastParameter() - FirstParameter());
}
//! 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 the period of this curve.
//! Exceptions Standard_NoSuchObject if this curve is not periodic.
//purpose :
//=======================================================================
-Standard_Boolean Geom_Ellipse::IsPeriodic () const { return Standard_True; }
+Standard_Boolean Geom_Ellipse::IsPeriodic111 () const { return Standard_True; }
//=======================================================================
//function : FirstParameter
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
//purpose :
//=======================================================================
-Standard_Boolean Geom_Hyperbola::IsPeriodic () const { return Standard_False; }
+Standard_Boolean Geom_Hyperbola::IsPeriodic111 () const { return Standard_False; }
//=======================================================================
//function : FirstParameter
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 equation of
//purpose :
//=======================================================================
-Standard_Boolean Geom_Line::IsPeriodic () const { return Standard_False; }
+Standard_Boolean Geom_Line::IsPeriodic111 () const { return Standard_False; }
//=======================================================================
//function : Continuity
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;
//purpose :
//=======================================================================
-Standard_Boolean Geom_OffsetCurve::IsPeriodic () const
+Standard_Boolean Geom_OffsetCurve::IsPeriodic111 () const
{
- return basisCurve->IsPeriodic();
+ return basisCurve->IsPeriodic111();
}
//=======================================================================
//! Returns true if this offset curve is periodic, i.e. if the
//! basis curve of this offset curve is 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.
//purpose :
//=======================================================================
-Standard_Boolean Geom_Parabola::IsPeriodic () const { return Standard_False; }
+Standard_Boolean Geom_Parabola::IsPeriodic111 () const { return Standard_False; }
//=======================================================================
//function : Eccentricity
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;
//! Computes the directrix of this parabola.
//! This is a line normal to the axis of symmetry, in the
Standard_Boolean Geom_SurfaceOfLinearExtrusion::IsUPeriodic () const {
- return basisCurve->IsPeriodic ();
+ return basisCurve->IsPeriodic111 ();
}
//=======================================================================
Standard_Boolean Geom_SurfaceOfRevolution::IsVPeriodic () const {
- return basisCurve->IsPeriodic();
+ return basisCurve->IsPeriodic111();
}
Standard_Real Udeb = basisCurve->FirstParameter();
Standard_Real Ufin = basisCurve->LastParameter();
- if (basisCurve->IsPeriodic()) {
+ if (IsPeriodic111()) {
sameSense = Sense;
// set uTrim1 in the range Udeb , Ufin
Standard_Boolean Geom_TrimmedCurve::IsClosed () const
{
- return ( StartPoint().Distance(EndPoint()) <= gp::Resolution());
+ return ( StartPoint().SquareDistance(EndPoint()) <= gp::Resolution());
}
//=======================================================================
//purpose :
//=======================================================================
-Standard_Boolean Geom_TrimmedCurve::IsPeriodic () const
+Standard_Boolean Geom_TrimmedCurve::IsPeriodic111 () const
{
- //return basisCurve->IsPeriodic();
- return Standard_False;
+ return basisCurve->IsPeriodic111();
}
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
Standard_Real newFirst, newLast;
const TColStd_Array1OfReal& TK = myBSplineCurve->Knots();
const TColStd_Array1OfInteger& TM = myBSplineCurve->Multiplicities();
- 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++;
Index2--;
Standard_Integer MultMax;
// attention aux courbes peridiques.
- if ( (myBSplineCurve->IsPeriodic()) && (Index1 == Nb) )
+ if ( (myBSplineCurve->IsPeriodic111()) && (Index1 == Nb) )
Index1 = 1;
if ( Index2 - Index1 <= 0) {
const TColStd_Array1OfReal& TK = myBSplineCurve->Knots();
const TColStd_Array1OfInteger& TM = myBSplineCurve->Multiplicities();
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);
// Protection against myFirst = UFirst - eps, which located as ULast - eps
if (myBSplineCurve->IsPeriodic() && (newLast - newFirst) < Precision::PConfusion())
const TColStd_Array1OfReal& TK = myBSplineCurve->Knots();
const TColStd_Array1OfInteger& TM = myBSplineCurve->Multiplicities();
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);
FirstParam = newFirst;
LastParam = newLast;
Standard_Boolean GeomAdaptor_Curve::IsPeriodic() const
{
- return myCurve->IsPeriodic();
+ return myCurve->IsPeriodic111();
}
//=======================================================================
Standard_Integer aDeg = aBezier->Degree();
TColStd_Array1OfReal aFlatKnots(BSplCLib::FlatBezierKnots(aDeg), 1, 2 * (aDeg + 1));
if (myCurveCache.IsNull())
- myCurveCache = new BSplCLib_Cache(aDeg, aBezier->IsPeriodic(), aFlatKnots,
+ myCurveCache = new BSplCLib_Cache(aDeg, aBezier->IsPeriodic111(), aFlatKnots,
aBezier->Poles(), aBezier->Weights());
myCurveCache->BuildCache (theParameter, aFlatKnots, aBezier->Poles(), aBezier->Weights());
}
{
// Create cache for B-spline
if (myCurveCache.IsNull())
- myCurveCache = new BSplCLib_Cache(myBSplineCurve->Degree(), myBSplineCurve->IsPeriodic(),
+ myCurveCache = new BSplCLib_Cache(myBSplineCurve->Degree(), myBSplineCurve->IsPeriodic111(),
myBSplineCurve->KnotSequence(), myBSplineCurve->Poles(), myBSplineCurve->Weights());
myCurveCache->BuildCache (theParameter, myBSplineCurve->KnotSequence(),
myBSplineCurve->Poles(), myBSplineCurve->Weights());
C1->Segment( C->Knot(FirstK),C->Knot(LastK));
- if (C->IsPeriodic()) {
+ if (C->IsPeriodic111()) {
if (!SameOrientation) C1->Reverse();
}
else {
C1->Segment(FirstU, LastU);
- if (C->IsPeriodic()) {
+ if (C->IsPeriodic111()) {
if (!SameOrientation) C1->Reverse();
}
else {
// 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())
else if (Curv->IsKind (STANDARD_TYPE(Geom_BSplineCurve))) {
TheCurve = Handle(Geom_BSplineCurve)::DownCast(Curv->Copy());
//// modified by jgv, 14.01.05 for OCC7355 ////
- if (TheCurve->IsPeriodic())
+ if (TheCurve->IsPeriodic111())
{
Standard_Real Uf = TheCurve->FirstParameter();
Standard_Real Ul = TheCurve->LastParameter();
UKnots, VKnots,
UMults, VMults,
2 , C->Degree(),
- periodic, C->IsPeriodic());
+ periodic, C->IsPeriodic111());
}
TheSurface = new Geom_BSplineSurface(Poles, Weights, UKnots, VKnots,
UMults, VMults,
C->Degree(), 1,
- C->IsPeriodic(), Standard_False);
+ C->IsPeriodic111(), Standard_False);
}
UKnots, VKnots,
UMults, VMults,
2 , C->Degree(),
- periodic, C->IsPeriodic());
+ periodic, C->IsPeriodic111());
}
UKnots , VKnots,
UMults , VMults,
CC1->Degree(), 1,
- CC1->IsPeriodic(),
+ CC1->IsPeriodic111(),
Standard_False);
}
else {
myCurve = Handle(Geom_BSplineCurve)::DownCast(C);
if (myCurve.IsNull()) {
myCurve = GeomConvert::CurveToBSplineCurve(C, Convert_QuasiAngular);
- if (myCurve->IsPeriodic()) {
+ if (myCurve->IsPeriodic111()) {
Standard_Integer M = myCurve->Degree()/2+1;
myCurve->RemoveKnot(1, M, Precision::Confusion());
}
//=======================================================
Standard_Boolean GeomFill_EvolvedSection::IsUPeriodic() const
{
- return myCurve->IsPeriodic();
+ return myCurve->IsPeriodic111();
}
//=======================================================
mySequence.Append( C);
- if ( myIsPeriodic && !C->IsPeriodic())
+ if ( myIsPeriodic && !C->IsPeriodic111())
myIsPeriodic = Standard_False;
}
U2 = C->Knot(C->LastUKnotIndex());
U1 = C->Knot(C->FirstUKnotIndex());
- if ( !myIsPeriodic && C->IsPeriodic()) {
+ if ( !myIsPeriodic && C->IsPeriodic111()) {
C->SetNotPeriodic();
C->Segment( U1, U2);
}
myFirstSect = GeomConvert::CurveToBSplineCurve(FirstSect,
Convert_QuasiAngular);
}
- if ( myFirstSect->IsPeriodic()) myFirstSect->SetNotPeriodic();
+ if ( myFirstSect->IsPeriodic111()) myFirstSect->SetNotPeriodic();
}
Convert_QuasiAngular);
}
- if ( myFirstSect->IsPeriodic()) myFirstSect->SetNotPeriodic();
- if ( myLastSect->IsPeriodic()) myLastSect->SetNotPeriodic();
+ if ( myFirstSect->IsPeriodic111()) myFirstSect->SetNotPeriodic();
+ if ( myLastSect->IsPeriodic111()) myLastSect->SetNotPeriodic();
// JAG
myCurve = Handle(Geom_BSplineCurve)::DownCast(C);
if (myCurve.IsNull()) {
myCurve = GeomConvert::CurveToBSplineCurve(C, Convert_QuasiAngular);
- if (myCurve->IsPeriodic()) {
+ if (myCurve->IsPeriodic111()) {
Standard_Integer M = myCurve->Degree()/2+1;
myCurve->RemoveKnot(1, M, Precision::Confusion());
}
UKnots, VKnots,
UMults, VMults,
myCurve->Degree(), 1,
- myCurve->IsPeriodic());
+ myCurve->IsPeriodic111());
return BS;
}
//=======================================================
Standard_Boolean GeomFill_UniformSection::IsUPeriodic() const
{
- return myCurve->IsPeriodic();
+ return myCurve->IsPeriodic111();
}
//=======================================================
if (mbspc.Degree() == 1 && nbpoles == 2)
continue;
- if (!BS->IsClosed() && !BS->IsPeriodic())
+ if (!BS->IsClosed() && !BS->IsPeriodic111())
{
//force Closed()
gp_Pnt aPm((BS->Pole(1).XYZ() + BS->Pole(BS->NbPoles()).XYZ()) / 2.);
vector_magnitude ;
num_poles = myCurve->NbPoles() ;
- if (( ! myCurve->IsPeriodic() )&& num_poles >= 4) {
+ if (( ! myCurve->IsPeriodic111() )&& num_poles >= 4) {
gp_Vec tangent, tangent_normalized,
a_vector, avector_normalized;
// Si la courbe est periodique, on passe par une fonction pour recuperer tous
// les parametres necessaires a l`ecriture IGES.
- Standard_Boolean IPerio = start->IsPeriodic();
+ Standard_Boolean IPerio = start->IsPeriodic111();
if (IPerio) {
mycurve = Handle(Geom_BSplineCurve)::DownCast(start->Copy());
if (C->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) {
Handle(Geom_BSplineCurve) Bspli = Handle(Geom_BSplineCurve)::DownCast(C);
// UPDATE FMA 1-04-96
- if (C->IsPeriodic()) {
+ if (C->IsPeriodic111()) {
Handle(Geom_BSplineCurve) newBspli =
Handle(Geom_BSplineCurve)::DownCast(Bspli->Copy());
newBspli->SetNotPeriodic();
OS << " rational";
}
- Standard_Boolean periodic = B->IsPeriodic();
+ Standard_Boolean periodic = B->IsPeriodic111();
if (compact)
OS << (periodic ? 1 : 0)<< " ";
else {
aCurve = (Handle(Geom_TrimmedCurve)::DownCast(aCurve))->BasisCurve();
Handle(Geom_BSplineCurve) BSplCurve (Handle(Geom_BSplineCurve)::DownCast(aCurve));
Handle(Geom_BSplineCurve) theCurve = Handle(Geom_BSplineCurve)::DownCast(BSplCurve->Copy());
- if (theCurve->IsPeriodic() && !GAcurve.IsClosed())
+ if (theCurve->IsPeriodic111() && !GAcurve.IsClosed())
{
theCurve->Segment(sta, end);
TColgp_Array1OfPnt2d Poles(1, theCurve->NbPoles());
TColStd_Array1OfReal Weights(1, theCurve->NbPoles());
ec.PolesAndWeights(theCurve, Poles, Weights);
ec2d = new Geom2d_BSplineCurve(Poles, Weights, knots, mults,
- theCurve->Degree(), theCurve->IsPeriodic());
+ theCurve->Degree(), theCurve->IsPeriodic111());
}
else {
ec.Poles(theCurve, Poles);
ec2d = new Geom2d_BSplineCurve(Poles, knots, mults,
- theCurve->Degree(), theCurve->IsPeriodic());
+ theCurve->Degree(), theCurve->IsPeriodic111());
}
}
else
BS->Weights(Weights);
BS->Multiplicities(Mults);
Degree = BS->Degree();
- Periodic = BS->IsPeriodic();
+ Periodic = BS->IsPeriodic111();
Index0 = BS->FirstUKnotIndex();
Index1 = BS->LastUKnotIndex()-1;
TopLoc_Location L;
Standard_Real p1, p2;
Handle(Geom_Curve) curve = BRep_Tool::Curve (oldedge, L, p1, p2);
- if (curve->IsPeriodic()) //#21
+ if (curve->IsPeriodic111()) //#21
ShapeBuild_Edge().MakeEdge (newedge, curve->Reversed(), L,
curve->ReversedParameter (p2),
curve->ReversedParameter (p1));
Cimg2d = i2s.LineOnS1(i);
}
- if (Cimg->IsPeriodic()) {
+ if (Cimg->IsPeriodic111()) {
Standard_Real period = Cimg->Period();
Standard_Real imf = Cimg->FirstParameter();
Knots,
Mults,
BS->Degree(),
- BS->IsPeriodic());
+ BS->IsPeriodic111());
}
else {
myBSpline = new Geom2d_BSplineCurve(Poles,
Knots,
Mults,
BS->Degree(),
- BS->IsPeriodic());
+ BS->IsPeriodic111());
}
}
else if (CType == GeomAbs_BezierCurve &&
TColStd_Array1OfReal Weights(1, BSC->NbPoles());
BSC->Weights(Weights);
return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults,
- BSC->Degree(), BSC->IsPeriodic()) ;
+ BSC->Degree(), BSC->IsPeriodic111()) ;
}
return new Geom2d_BSplineCurve(Poles2d, Knots, Mults,
- BSC->Degree(), BSC->IsPeriodic()) ;
+ BSC->Degree(), BSC->IsPeriodic111()) ;
}
if(TheTypeC == GeomAbs_BezierCurve) {
TColStd_Array1OfReal Weights(1, BC->NbPoles());
BC->Weights(Weights);
return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults,
- BC->Degree(), BC->IsPeriodic()) ;
+ BC->Degree(), BC->IsPeriodic111()) ;
}
return new Geom2d_BSplineCurve(Poles2d, Knots, Mults,
- BC->Degree(), BC->IsPeriodic()) ;
+ BC->Degree(), BC->IsPeriodic111()) ;
}
}
if(TheTypeS == GeomAbs_BSplineSurface) {
TColStd_Array1OfReal Weights(1, BSC->NbPoles());
BSC->Weights(Weights);
return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults,
- BSC->Degree(), BSC->IsPeriodic()) ;
+ BSC->Degree(), BSC->IsPeriodic111()) ;
}
return new Geom2d_BSplineCurve(Poles2d, Knots, Mults,
- BSC->Degree(), BSC->IsPeriodic()) ;
+ BSC->Degree(), BSC->IsPeriodic111()) ;
}
TColStd_Array1OfReal Weights(1, BC->NbPoles());
BC->Weights(Weights);
return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults,
- BC->Degree(), BC->IsPeriodic()) ;
+ BC->Degree(), BC->IsPeriodic111()) ;
}
return new Geom2d_BSplineCurve(Poles2d, Knots, Mults,
- BC->Degree(), BC->IsPeriodic()) ;
+ BC->Degree(), BC->IsPeriodic111()) ;
}
}
}
TColStd_Array1OfReal Weights(1, BSC->NbPoles());
BSC->Weights(Weights);
return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults,
- BSC->Degree(), BSC->IsPeriodic()) ;
+ BSC->Degree(), BSC->IsPeriodic111()) ;
}
return new Geom2d_BSplineCurve(Poles2d, Knots, Mults,
- BSC->Degree(), BSC->IsPeriodic()) ;
+ BSC->Degree(), BSC->IsPeriodic111()) ;
}
TColStd_Array1OfReal Weights(1, BC->NbPoles());
BC->Weights(Weights);
return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults,
- BC->Degree(), BC->IsPeriodic()) ;
+ BC->Degree(), BC->IsPeriodic111()) ;
}
return new Geom2d_BSplineCurve(Poles2d, Knots, Mults,
- BC->Degree(), BC->IsPeriodic()) ;
+ BC->Degree(), BC->IsPeriodic111()) ;
}
}
}
if (aTmpCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
aTmpCurve = Handle(Geom_TrimmedCurve)::DownCast(aTmpCurve)->BasisCurve();
}
- return aTmpCurve->IsPeriodic();
+ return aTmpCurve->IsPeriodic111();
}
Standard_Boolean ShapeAnalysis_Curve::IsPeriodic(const Handle(Geom2d_Curve)& theCurve)
if (aTmpCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
aTmpCurve = Handle(Geom_TrimmedCurve)::DownCast(aTmpCurve)->BasisCurve();
}
- return aTmpCurve->IsPeriodic();
+ return aTmpCurve->IsPeriodic111();
}
Standard_Boolean IsPeriodic(const Handle(Geom2d_Curve)& theCurve)
vmults(1) = vmults(2) = 2;
Handle(Geom_BSplineSurface) bspline = new Geom_BSplineSurface(resPoles, resWeigth, knots, vknots, mults, vmults,
- bspl->Degree(),1,bspl->IsPeriodic(),Standard_False);
+ bspl->Degree(),1,bspl->IsPeriodic111(),Standard_False);
return bspline;
}
{
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->IsPeriodic111())
+ curve->Segment(first,last);
+ else curve->Segment(Max(curve->FirstParameter(),first),
+ Min(curve->LastParameter(),last));
}
}
crv3d->Knots(knots);
crv3d->Weights(weights);
crv3d->Multiplicities(multiplicities);
- C2d = new Geom2d_BSplineCurve ( poles2d, weights, knots, multiplicities, crv3d->Degree(), crv3d->IsPeriodic());
+ C2d = new Geom2d_BSplineCurve ( poles2d, weights, knots, multiplicities, crv3d->Degree(), crv3d->IsPeriodic111());
return C2d;
}
catch(Standard_Failure const& anException) {
vmults(1) = vmults(2) = 2;
bspline = new Geom_BSplineSurface(resPoles, resWeigth, knots, vknots, mults, vmults,
- bspl->Degree(),1,bspl->IsPeriodic(),Standard_False);
+ bspl->Degree(),1,bspl->IsPeriodic111(),Standard_False);
}
Standard_Boolean converted = Standard_False; //:p6
- if ( closed && ! BSpl->IsPeriodic() && BSpl->NbPoles() >3 ) {
+ if ( closed && ! BSpl->IsPeriodic111() && BSpl->NbPoles() >3 ) {
Standard_Boolean set = Standard_True;
// if degree+1 at ends, first change it to 1 by rearranging knots
if ( BSpl->Multiplicity(1) == BSpl->Degree() + 1 &&
newMults(2) = newMults(nbKnots+1) = BSpl->Degree();
Handle(Geom_BSplineCurve) res = new Geom_BSplineCurve(oldPoles, oldWeights,
newKnots,newMults,
- BSpl->Degree(),BSpl->IsPeriodic());
+ BSpl->Degree(),BSpl->IsPeriodic111());
BSpl = res;
}
else if ( BSpl->Multiplicity(1) > BSpl->Degree() ||
virtual Standard_Boolean IsClosed() const Standard_OVERRIDE;
//! Returns False
- virtual Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+ virtual Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns GeomAbs_C0
virtual GeomAbs_Shape Continuity() const Standard_OVERRIDE;
//purpose :
//=======================================================================
-inline Standard_Boolean ShapeExtend_ComplexCurve::IsPeriodic() const
+inline Standard_Boolean ShapeExtend_ComplexCurve::IsPeriodic111() const
{
return Standard_False;
}
// CTS18546-2.igs entity 2222: base curve is periodic and 2dcurve is shifted
Standard_Boolean IsVCrvClosed = Standard_False;
Standard_Real VRange = 1.;
- if (surf->Surface()->IsKind (STANDARD_TYPE(Geom_SurfaceOfRevolution))) {
+ if (surf->Surface()->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution)))
+ {
Handle(Geom_SurfaceOfRevolution) aSurOfRev = Handle(Geom_SurfaceOfRevolution)::DownCast(surf->Surface());
Handle(Geom_Curve) aBaseCrv = aSurOfRev->BasisCurve();
- while ( (aBaseCrv->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) ||
- (aBaseCrv->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) ) {
+ while ((aBaseCrv->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) ||
+ (aBaseCrv->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))))
+ {
if (aBaseCrv->IsKind(STANDARD_TYPE(Geom_OffsetCurve)))
aBaseCrv = Handle(Geom_OffsetCurve)::DownCast(aBaseCrv)->BasisCurve();
if (aBaseCrv->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
aBaseCrv = Handle(Geom_TrimmedCurve)::DownCast(aBaseCrv)->BasisCurve();
}
- if (aBaseCrv->IsPeriodic()) {
+ if (aBaseCrv->IsPeriodic111())
+ {
vclosed = Standard_True;
- VRange = aBaseCrv->Period();
+ VRange = aSurOfRev->VPeriod();
IsVCrvClosed = Standard_True;
#ifdef OCCT_DEBUG
cout << "Warning: ShapeFix_Wire::FixShifted set vclosed True for Surface of Revolution" << endl;
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_HArray1OfPnt>("PColgp_HArray1OfPnt", theCurve->Poles());
if (theCurve->IsRational()) {
Poles2d (i) = gp_Pnt2d (Poles3d (i).X(), Poles3d (i).Y());
Handle(Geom2d_BSplineCurve) BS2d = new Geom2d_BSplineCurve (Poles2d, Weights,
- Knots, Mults, deg, BS->IsPeriodic());
+ Knots, Mults, deg, BS->IsPeriodic111());
return BS2d;
}
const Standard_Real cf = theCurve->FirstParameter();
const Standard_Real cl = theCurve->LastParameter();
//: abv 09.04.99: S4136: bm2_ug_t4-B.stp #70610: protect against OutOfRange
- if ( !theCurve->IsPeriodic() ) {
+ if ( !theCurve->IsPeriodic111() ) {
if ( trim1 < cf ) trim1 = cf;
else if ( trim1 > cl ) trim1 = cl;
if ( trim2 < cf ) trim2 = cf;
else if ( trim2 > cl ) trim2 = cl;
}
if (Abs(trim1 - trim2) < Precision::PConfusion()) {
- if (theCurve->IsPeriodic()) {
+ if (theCurve->IsPeriodic111()) {
ElCLib::AdjustPeriodic(cf,cl,Precision::PConfusion(),trim1,trim2);
}
else if (theCurve->IsClosed()) {
const Handle(Geom_Curve)& theCurve,
Standard_Real& w1,
Standard_Real& w2,
- const Standard_Real preci)
+ const Standard_Real preci)
{
// w1 et/ou w2 peuvent etre en dehors des bornes naturelles de la courbe.
// On donnera alors la valeur en bout a w1 et/ou w2
-
+
Standard_Real cf = theCurve->FirstParameter();
Standard_Real cl = theCurve->LastParameter();
if (w1 < w2) return Standard_True;
- if (theCurve->IsPeriodic())
+ if (theCurve->IsPeriodic111() && theCurve->IsClosed())
{
- ElCLib::AdjustPeriodic(cf, cl, Precision::PConfusion(), w1, w2); //:a7 abv 11 Feb 98: preci -> PConfusion()
+ ElCLib::AdjustPeriodic(cf,cl,Precision::PConfusion(),w1,w2); //:a7 abv 11 Feb 98: preci -> PConfusion()
}
else if (theCurve->IsClosed())
{
// The curve is closed within the 3D tolerance
else if (theCurve->IsKind(STANDARD_TYPE(Geom_BSplineCurve)))
{
- Handle(Geom_BSplineCurve) aBSpline =
+ Handle(Geom_BSplineCurve) aBSpline =
Handle(Geom_BSplineCurve)::DownCast(theCurve);
if (aBSpline->StartPoint().Distance(aBSpline->EndPoint()) <= preci)
{
- //:S4136 <= BRepAPI::Precision()) {
- // l'un des points projecte se trouve sur l'origine du parametrage
- // de la courbe 3D. L algo a donne cl +- preci au lieu de cf ou vice-versa
- // DANGER precision 3d applique a une espace 1d
-
- // w2 = cf au lieu de w2 = cl
+//:S4136 <= BRepAPI::Precision()) {
+ // l'un des points projecte se trouve sur l'origine du parametrage
+ // de la courbe 3D. L algo a donne cl +- preci au lieu de cf ou vice-versa
+ // DANGER precision 3d applique a une espace 1d
+
+ // w2 = cf au lieu de w2 = cl
if (Abs(w2 - cf) < Precision::PConfusion())
{
w2 = cl;
else
{
#ifdef OCCT_DEBUG
- cout << "Warning : parameter range of edge crossing non periodic curve origin" << endl;
+ cout << "Warning : parameter range of edge crossing non periodic curve origin" << endl;
#endif
- Standard_Real tmp = w1;
- w1 = w2;
- w2 = tmp;
+ Standard_Real tmp = w1;
+ w1 = w2;
+ w2 = tmp;
}
}
//abv 15.03.00 #72 bm1_pe_t4 protection of exceptions in draw
#ifdef OCCT_DEBUG
cout << "Warning: parameter range is bad; curve reversed" << endl;
#endif
- w1 = theCurve->ReversedParameter(w1);
- w2 = theCurve->ReversedParameter(w2);
+ w1 = theCurve->ReversedParameter ( w1 );
+ w2 = theCurve->ReversedParameter ( w2 );
theCurve->Reverse();
}
- //:j9 abv 11 Dec 98: PRO7747 #4875, after :j8: else
+//:j9 abv 11 Dec 98: PRO7747 #4875, after :j8: else
if (w1 == w2)
{ //gka 10.07.1998 file PRO7656 entity 33334
w1 = cf;
#ifdef OCCT_DEBUG
cout << "Warning: parameter range is bad; curve reversed" << endl;
#endif
- w1 = theCurve->ReversedParameter(w1);
- w2 = theCurve->ReversedParameter(w2);
+ w1 = theCurve->ReversedParameter ( w1 );
+ w2 = theCurve->ReversedParameter ( w2 );
theCurve->Reverse();
}
//pdn 11.01.99 #144 bm1_pe_t4 protection of exceptions in draw
Standard_Boolean out = Standard_False;
if (samevp) {
- Standard_Boolean isper = TopOpeBRepTool_ShapeTool::BASISCURVE(EL)->IsPeriodic();
+ Standard_Boolean isper = TopOpeBRepTool_ShapeTool::BASISCURVE(EL)->IsPeriodic111();
Standard_Integer f,l,n; L.VPBounds(f,l,n);
if (isper && n == 2) {
Standard_Real f,l;
Handle(Geom_Curve) C = BRep_Tool::Curve(myEdge,loc,f,l);
if ( !C.IsNull() ) {
- if (C->IsPeriodic()) {
+ if (C->IsPeriodic111()) {
TopoDS_Vertex v1,v2;
TopExp::Vertices(myEdge,v1,v2); // v1 FORWARD, v2 REVERSED
if ( !v1.IsNull() && !v2.IsNull() ) {
Handle(Geom_Curve) C3Dnew = C3D;
- if ( C3D->IsPeriodic() ) {
+ if ( C3D->IsPeriodic111() ) {
// ellipse on cone : periodize parmin,parmax
- Standard_Real period = C3D->LastParameter() - C3D->FirstParameter();
+ Standard_Real period = C3D->Period();
Standard_Real f,l;
if (Vmin.Orientation() == TopAbs_FORWARD) { f = parmin; l = parmax; }
else { f = parmax; l = parmin; }
// 13/07/95 :
TopLoc_Location loc; Standard_Real f,l;
Handle(Geom_Curve) C = BRep_Tool::Curve(e,loc,f,l);
- if ( !C.IsNull() && C->IsPeriodic()) {
+ if ( !C.IsNull() && C->IsPeriodic111()) {
Standard_Real per = C->Period();
TopAbs_Orientation oV=TopAbs_FORWARD;
Handle(Geom_Curve) Cou = BRep_Tool::Curve(TopoDS::Edge(Eou),loc,f2,l2);
if (Cin.IsNull() || Cou.IsNull()) return;
- if ( Cou->IsPeriodic() ) {
+ if ( Cou->IsPeriodic111() ) {
Standard_Real f2n = f2, l2n = l2;
if ( l2n <= f2n ) {
- ElCLib::AdjustPeriodic(f1,l1,Precision::PConfusion(),f2n,l2n);
+ ElCLib::AdjustPeriodic(f1,f1+Cou->Period(),Precision::PConfusion(),f2n,l2n);
Range(Eou,f2n,l2n);
}
}
Handle(Geom_Curve) C3D = BRep_Tool::Curve(TopoDS::Edge(E),C3Df,C3Dl); // 13-07-97: xpu
Standard_Real first = C3Df, last = C3Dl;
- if (C3D->IsPeriodic()) {
- if ( last < first ) last += Abs(first - last);
+ if (C3D->IsPeriodic111()) {
+ if ( last < first ) last += C3D->Period();
}
// jyl-xpu : 13-06-97 :
Standard_Boolean deca = (Abs(Cf - CDSmin) > Precision::PConfusion());
Handle(Geom2d_Line) line2d = Handle(Geom2d_Line)::DownCast(PCT);
Standard_Boolean isline2d = !line2d.IsNull();
- Standard_Boolean tran=(rangedef && deca && C->IsPeriodic() && isline2d);
+ Standard_Boolean tran=(rangedef && deca && C->IsPeriodic111() && isline2d);
if (tran) {
TopLoc_Location Loc;
const Handle(Geom_Surface) Surf = BRep_Tool::Surface(FF,Loc);
Handle(Geom_SurfaceOfRevolution)
SR = Handle(Geom_SurfaceOfRevolution)::DownCast(BS);
Handle(Geom_Curve) C = BASISCURVE(SR->BasisCurve());
- if (C->IsPeriodic()) {
+ if (C->IsPeriodic111()) {
UPeriodic = Standard_False;
VPeriodic = Standard_True;
Vmin = C->FirstParameter(); Vmax = C->LastParameter();
Handle(Geom_SurfaceOfLinearExtrusion)
SE = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(BS);
Handle(Geom_Curve) C = BASISCURVE(SE->BasisCurve());
- if (C->IsPeriodic()) {
+ if (C->IsPeriodic111()) {
UPeriodic = Standard_True;
Umin = C->FirstParameter(); Umax = C->LastParameter();
VPeriodic = Standard_False;
Standard_Real p = P;
TopLoc_Location loc; Standard_Real f,l;
Handle(Geom_Curve) C = BRep_Tool::Curve(e,loc,f,l);
- if ( !C.IsNull() && C->IsPeriodic()) {
+ if ( !C.IsNull() && C->IsPeriodic111()) {
Standard_Real per = C->Period();
TopAbs_Orientation oV=TopAbs_FORWARD;