// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Standard_Stream.hxx>
-#include <GeomTools_Curve2dSet.ixx>
-#include <GeomTools.hxx>
-#include <GeomTools_UndefinedTypeHandler.hxx>
+#include <Geom2d_BezierCurve.hxx>
+#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_Circle.hxx>
-#include <Geom2d_Line.hxx>
+#include <Geom2d_Curve.hxx>
#include <Geom2d_Ellipse.hxx>
-#include <Geom2d_Parabola.hxx>
#include <Geom2d_Hyperbola.hxx>
-#include <Geom2d_BezierCurve.hxx>
-#include <Geom2d_BSplineCurve.hxx>
-#include <Geom2d_TrimmedCurve.hxx>
+#include <Geom2d_Line.hxx>
#include <Geom2d_OffsetCurve.hxx>
-
-#include <gp_Lin2d.hxx>
+#include <Geom2d_Parabola.hxx>
+#include <Geom2d_TrimmedCurve.hxx>
+#include <GeomTools.hxx>
+#include <GeomTools_Curve2dSet.hxx>
+#include <GeomTools_UndefinedTypeHandler.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Elips2d.hxx>
-#include <gp_Parab2d.hxx>
#include <gp_Hypr2d.hxx>
-
-#include <TColStd_Array1OfReal.hxx>
-#include <TColStd_Array1OfInteger.hxx>
-#include <TColgp_Array1OfPnt2d.hxx>
-#include <Standard_Failure.hxx>
-#include <Standard_ErrorHandler.hxx>
+#include <gp_Lin2d.hxx>
+#include <gp_Parab2d.hxx>
+#include <Message_ProgressIndicator.hxx>
#include <Message_ProgressSentry.hxx>
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_Failure.hxx>
+#include <Standard_OutOfRange.hxx>
+#include <Standard_Stream.hxx>
+#include <TColgp_Array1OfPnt2d.hxx>
+#include <TColStd_Array1OfInteger.hxx>
+#include <TColStd_Array1OfReal.hxx>
#define LINE 1
#define CIRCLE 2
OS << degree << " ";
for (i = 1; i <= degree+1; i++) {
- if (!compact) OS << "\n "<<setw(2)<<i<<" : ";
+ if (!compact) OS << "\n "<<std::setw(2)<<i<<" : ";
Print(B->Pole(i),OS,compact);
if (rational)
OS << " " << B->Weight(i);
if (!compact) OS << "Poles :\n";
for (i = 1; i <= nbpoles; i++) {
- if (!compact) OS << "\n "<<setw(2)<<i<<" : ";
+ if (!compact) OS << "\n "<<std::setw(2)<<i<<" : ";
else OS << " ";
Print(B->Pole(i),OS,compact);
if (rational)
if (!compact) OS << "Knots :\n";
for (i = 1; i <= nbknots; i++) {
- if (!compact) OS << "\n "<<setw(2)<<i<<" : ";
+ if (!compact) OS << "\n "<<std::setw(2)<<i<<" : ";
else OS << " ";
OS << B->Knot(i) << " " << B->Multiplicity(i);
}
//if (!compact)
// OS << "****** UNKNOWN CURVE2d TYPE ******\n";
//else
- // cout << "****** UNKNOWN CURVE2d TYPE ******" << endl;
+ // std::cout << "****** UNKNOWN CURVE2d TYPE ******" << std::endl;
}
}
OS << "\n -------\n\n";
for (i = 1; i <= nbsurf; i++) {
- OS << setw(4) << i << " : ";
+ OS << std::setw(4) << i << " : ";
PrintCurve2d(Handle(Geom2d_Curve)::DownCast(myMap(i)),OS,Standard_False);
}
}
static Standard_IStream& operator>>(Standard_IStream& IS, gp_Pnt2d& P)
{
Standard_Real X=0.,Y=0.;
- IS >> X >> Y;
+ GeomTools::GetReal(IS, X);
+ GeomTools::GetReal(IS, Y);
P.SetCoord(X,Y);
return IS;
}
static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir2d& D)
{
Standard_Real X=0.,Y=0.;
- IS >> X >> Y;
+ GeomTools::GetReal(IS, X);
+ GeomTools::GetReal(IS, Y);
D.SetCoord(X,Y);
return IS;
}
gp_Pnt2d P(0.,0.);
gp_Dir2d AX(1.,0.),AY(1.,0.);
Standard_Real R=0.;
- IS >> P >> AX >> AY >> R;
+ IS >> P >> AX >> AY;
+ GeomTools::GetReal(IS, R);
C = new Geom2d_Circle(gp_Ax22d(P,AX,AY),R);
return IS;
}
gp_Pnt2d P(0.,0.);
gp_Dir2d AX(1.,0.),AY(1.,0.);
Standard_Real R1=0.,R2=0.;
- IS >> P >> AX >> AY >> R1 >> R2;
+ IS >> P >> AX >> AY;
+ GeomTools::GetReal(IS, R1);
+ GeomTools::GetReal(IS, R2);
E = new Geom2d_Ellipse(gp_Ax22d(P,AX,AY),R1,R2);
return IS;
}
gp_Pnt2d P(0.,0.);
gp_Dir2d AX(1.,0.),AY(1.,0.);
Standard_Real R1=0.;
- IS >> P >> AX >> AY >> R1;
+ IS >> P >> AX >> AY;
+ GeomTools::GetReal(IS, R1);
C = new Geom2d_Parabola(gp_Ax22d(P,AX,AY),R1);
return IS;
}
gp_Pnt2d P(0.,0.);
gp_Dir2d AX(1.,0.),AY(1.,0.);
Standard_Real R1=0.,R2=0.;
- IS >> P >> AX >> AY >> R1 >> R2;
+ IS >> P >> AX >> AY;
+ GeomTools::GetReal(IS, R1);
+ GeomTools::GetReal(IS, R2);
H = new Geom2d_Hyperbola(gp_Ax22d(P,AX,AY),R1,R2);
return IS;
}
for (i = 1; i <= degree+1; i++) {
IS >> poles(i);
if (rational)
- IS >> weights(i);
+ GeomTools::GetReal(IS, weights(i));
}
if (rational)
for (i = 1; i <= nbpoles; i++) {
IS >> poles(i);
if (rational)
- IS >> weights(i);
+ GeomTools::GetReal(IS, weights(i));
}
TColStd_Array1OfReal knots(1,nbknots);
TColStd_Array1OfInteger mults(1,nbknots);
for (i = 1; i <= nbknots; i++) {
- IS >> knots(i) >> mults(i);
+ GeomTools::GetReal(IS, knots(i));
+ IS >> mults(i);
}
if (rational)
Handle(Geom2d_TrimmedCurve)& C)
{
Standard_Real p1=0.,p2=0.;
- IS >> p1 >> p2;
- Handle(Geom2d_Curve) BC;
- GeomTools_Curve2dSet::ReadCurve2d(IS,BC);
+ GeomTools::GetReal(IS, p1);
+ GeomTools::GetReal(IS, p2);
+ Handle(Geom2d_Curve) BC = GeomTools_Curve2dSet::ReadCurve2d(IS);
C = new Geom2d_TrimmedCurve(BC,p1,p2);
return IS;
}
Handle(Geom2d_OffsetCurve)& C)
{
Standard_Real p=0.;
- IS >> p;
- Handle(Geom2d_Curve) BC;
- GeomTools_Curve2dSet::ReadCurve2d(IS,BC);
+ GeomTools::GetReal(IS, p);
+ Handle(Geom2d_Curve) BC = GeomTools_Curve2dSet::ReadCurve2d(IS);
C = new Geom2d_OffsetCurve(BC,p);
return IS;
}
//purpose :
//=======================================================================
-Standard_IStream& GeomTools_Curve2dSet::ReadCurve2d(Standard_IStream& IS,
- Handle(Geom2d_Curve)& C)
+Handle(Geom2d_Curve) GeomTools_Curve2dSet::ReadCurve2d(Standard_IStream& IS)
{
Standard_Integer ctype;
+ Handle(Geom2d_Curve) C;
try {
OCC_CATCH_SIGNALS
IS >> ctype;
break;
}
}
- catch(Standard_Failure) {
-#ifdef DEB
- Handle(Standard_Failure) anExc = Standard_Failure::Caught();
- cout <<"EXCEPTION in GeomTools_Curve2dSet::ReadCurve2d(..)!!!" << endl;
- cout << anExc << endl;
+ catch(Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+ std::cout <<"EXCEPTION in GeomTools_Curve2dSet::ReadCurve2d(..)!!!" << std::endl;
+ std::cout << anException << std::endl;
#endif
- C = NULL;
+ (void)anException;
}
- return IS;
+ return C;
}
//=======================================================================
char buffer[255];
IS >> buffer;
if (strcmp(buffer,"Curve2ds")) {
- cout << "Not a Curve2d table"<<endl;
+ std::cout << "Not a Curve2d table"<<std::endl;
return;
}
- Handle(Geom2d_Curve) C;
Standard_Integer i, nbcurve;
IS >> nbcurve;
//OCC19559
Handle(Message_ProgressIndicator) progress = GetProgress();
Message_ProgressSentry PS(progress, "2D Curves", 0, nbcurve, 1);
for (i = 1; i <= nbcurve && PS.More(); i++, PS.Next()) {
- GeomTools_Curve2dSet::ReadCurve2d(IS,C);
+ Handle(Geom2d_Curve) C = GeomTools_Curve2dSet::ReadCurve2d (IS);
myMap.Add(C);
}
}