BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
Handle(BRep_CurveRepresentation) cr;
Handle(BRep_GCurve) GC;
- Standard_Real f = 0.,l = 0.;
- Standard_Boolean rangeFound = Standard_False;
-
+ Standard_Real f = -Precision::Infinite(), l = Precision::Infinite();
// search the range of the 3d curve
// and remove any existing representation
// see lbo & flo, to determine whether range is defined
// compare first and last parameters with default values.
GC->Range(f, l);
- //lvt 15/6/99: On enleve la comparaison de reels infinis.
- Standard_Boolean undefined = (Precision::IsPositiveInfinite(l) ||
- Precision::IsNegativeInfinite(f));
-
- if (!undefined) {
- rangeFound = Standard_True;
- }
}
if (GC->IsCurveOnSurface(S,L)) {
// remove existing curve on surface
}
}
- if (! C.IsNull()) {
- Handle(BRep_CurveOnSurface) COS = new BRep_CurveOnSurface(C,S,L);
- // test if there is already a range
- if (rangeFound) {
- COS->SetRange(f,l);
+ if (!C.IsNull()) {
+ Handle(BRep_CurveOnSurface) COS = new BRep_CurveOnSurface(C, S, L);
+ Standard_Real aFCur = 0.0, aLCur = 0.0;
+ COS->Range(aFCur, aLCur);
+ if (!Precision::IsInfinite(f))
+ {
+ aFCur = f;
+ }
+
+ if (!Precision::IsInfinite(l))
+ {
+ aLCur = l;
}
+
+ COS->SetRange(aFCur, aLCur);
lcr.Append(COS);
}
}
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
Handle(BRep_CurveRepresentation) cr;
Handle(BRep_GCurve) GC;
- Standard_Real f = 0.,l = 0.;
- Standard_Boolean rangeFound = Standard_False;
+ Standard_Real f = -Precision::Infinite(), l = Precision::Infinite();
// search the range of the 3d curve
// and remove any existing representation
// see lbo & flo, to determine whether range is defined
// compare first and last parameters with default values.
GC->Range(f, l);
- //lvt 15/6/99: On enleve la comparaison de reels infinis.
- Standard_Boolean undefined = (Precision::IsPositiveInfinite(l) ||
- Precision::IsNegativeInfinite(f));
-
- if (!undefined) {
- rangeFound = Standard_True;
- }
}
if (GC->IsCurveOnSurface(S,L)) {
// remove existing curve on surface
if (! C.IsNull()) {
Handle(BRep_CurveOnSurface) COS = new BRep_CurveOnSurface(C,S,L);
- // test if there is already a range
- if (rangeFound) {
- COS->SetRange(f,l);
+ Standard_Real aFCur = 0.0, aLCur = 0.0;
+ COS->Range(aFCur, aLCur);
+ if (!Precision::IsInfinite(f))
+ {
+ aFCur = f;
+ }
+
+ if (!Precision::IsInfinite(l))
+ {
+ aLCur = l;
}
- COS->SetUVPoints(Pf,Pl);
+
+ COS->SetRange(aFCur, aLCur);
+ COS->SetUVPoints(Pf, Pl);
lcr.Append(COS);
}
}
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
Handle(BRep_CurveRepresentation) cr;
Handle(BRep_GCurve) GC;
- Standard_Real f = 0.,l = 0.;
- Standard_Boolean rangeFound = Standard_False;
+ Standard_Real f = -Precision::Infinite(), l = Precision::Infinite();
while (itcr.More()) {
GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
if ( !GC.IsNull() ) {
if (GC->IsCurve3D()) {
GC->Range(f,l);
- Standard_Boolean undefined = (Precision::IsPositiveInfinite(l) ||
- Precision::IsNegativeInfinite(f));
-
- if (!undefined) {
- rangeFound = Standard_True;
- }
}
Standard_Boolean iscos = GC->IsCurveOnSurface(S,L);
if (iscos) break;
}
if ( !C1.IsNull() && !C2.IsNull() ) {
- Handle(BRep_CurveOnClosedSurface) COS =
- new BRep_CurveOnClosedSurface(C1,C2,S,L,GeomAbs_C0);
- // test if there is already a range
- if (rangeFound) {
- COS->SetRange(f,l);
+ Handle(BRep_CurveOnClosedSurface) COS = new
+ BRep_CurveOnClosedSurface(C1,C2,S,L,GeomAbs_C0);
+ Standard_Real aFCur = 0.0, aLCur = 0.0;
+ COS->Range(aFCur, aLCur);
+ if (!Precision::IsInfinite(f))
+ {
+ aFCur = f;
}
+
+ if (!Precision::IsInfinite(l))
+ {
+ aLCur = l;
+ }
+
+ COS->SetRange(aFCur, aLCur);
lcr.Append(COS);
}
}
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
Handle(BRep_CurveRepresentation) cr;
Handle(BRep_GCurve) GC;
- Standard_Real f = 0.,l = 0.;
- Standard_Boolean rangeFound = Standard_False;
+ Standard_Real f = -Precision::Infinite(), l = Precision::Infinite();
while (itcr.More()) {
GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
if ( !GC.IsNull() ) {
if (GC->IsCurve3D()) {
GC->Range(f,l);
- Standard_Boolean undefined = (Precision::IsPositiveInfinite(l) ||
- Precision::IsNegativeInfinite(f));
-
- if (!undefined) {
- rangeFound = Standard_True;
- }
}
Standard_Boolean iscos = GC->IsCurveOnSurface(S,L);
if (iscos) break;
}
if ( !C1.IsNull() && !C2.IsNull() ) {
- Handle(BRep_CurveOnClosedSurface) COS =
- new BRep_CurveOnClosedSurface(C1,C2,S,L,GeomAbs_C0);
- // test if there is already a range
- if (rangeFound) {
- COS->SetRange(f,l);
+ Handle(BRep_CurveOnClosedSurface) COS = new
+ BRep_CurveOnClosedSurface(C1,C2,S,L,GeomAbs_C0);
+ Standard_Real aFCur = 0.0, aLCur = 0.0;
+ COS->Range(aFCur, aLCur);
+ if (!Precision::IsInfinite(f))
+ {
+ aFCur = f;
}
- COS->SetUVPoints2(Pf,Pl);
+
+ if (!Precision::IsInfinite(l))
+ {
+ aLCur = l;
+ }
+
+ COS->SetRange(aFCur, aLCur);
+ COS->SetUVPoints2(Pf, Pl);
lcr.Append(COS);
}
}