//
// This file is part of Open CASCADE Technology software library.
//
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public version 2.1 as published
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Standard_Stream.hxx>
-#include <GeomTools_SurfaceSet.ixx>
-#include <GeomTools.hxx>
-#include <GeomTools_UndefinedTypeHandler.hxx>
-#include <GeomTools_CurveSet.hxx>
-#include <Geom_Plane.hxx>
-#include <Geom_CylindricalSurface.hxx>
+#include <Geom_BezierSurface.hxx>
+#include <Geom_BSplineSurface.hxx>
#include <Geom_ConicalSurface.hxx>
+#include <Geom_CylindricalSurface.hxx>
+#include <Geom_OffsetSurface.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_SphericalSurface.hxx>
-#include <Geom_ToroidalSurface.hxx>
+#include <Geom_Surface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
-#include <Geom_BezierSurface.hxx>
-#include <Geom_BSplineSurface.hxx>
-#include <Geom_RectangularTrimmedSurface.hxx>
-#include <Geom_OffsetSurface.hxx>
-
-#include <gp_Pln.hxx>
-#include <gp_Cylinder.hxx>
+#include <Geom_ToroidalSurface.hxx>
+#include <GeomTools.hxx>
+#include <GeomTools_CurveSet.hxx>
+#include <GeomTools_SurfaceSet.hxx>
+#include <GeomTools_UndefinedTypeHandler.hxx>
#include <gp_Cone.hxx>
+#include <gp_Cylinder.hxx>
+#include <gp_Pln.hxx>
#include <gp_Sphere.hxx>
#include <gp_Torus.hxx>
-
-#include <TColStd_Array1OfReal.hxx>
-#include <TColStd_Array1OfInteger.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_Array1OfPnt.hxx>
-#include <TColStd_Array2OfReal.hxx>
#include <TColgp_Array2OfPnt.hxx>
-#include <Standard_Failure.hxx>
-#include <Standard_ErrorHandler.hxx>
-#include <Message_ProgressSentry.hxx>
+#include <TColStd_Array1OfInteger.hxx>
+#include <TColStd_Array1OfReal.hxx>
+#include <TColStd_Array2OfReal.hxx>
#define PLANE 1
#define CYLINDER 2
for (i = 1; i <= udegree+1; i++) {
for (j = 1; j <= vdegree+1; j++) {
- if (!compact) OS << "\n "<<setw(2)<<i<<", "<<setw(2)<<j<<" : ";
+ if (!compact) OS << "\n "<<std::setw(2)<<i<<", "<<std::setw(2)<<j<<" : ";
Print(S->Pole(i,j),OS,compact);
if (urational || vrational)
OS << " " << S->Weight(i,j);
if (!compact) OS << "\n Poles :\n";
for (i = 1; i <= nbupoles; i++) {
for (j = 1; j <= nbvpoles; j++) {
- if (!compact) OS << "\n "<<setw(2)<<i<<", "<<setw(2)<<j<<" : ";
+ if (!compact) OS << "\n "<<std::setw(2)<<i<<", "<<std::setw(2)<<j<<" : ";
Print(S->Pole(i,j),OS,compact);
if (urational || vrational)
OS << " " << S->Weight(i,j);
OS << "\n";
if (!compact) OS << "\n UKnots :\n";
for (i = 1; i <= nbuknots; i++) {
- if (!compact) OS << "\n "<<setw(2)<<i<<" : ";
+ if (!compact) OS << "\n "<<std::setw(2)<<i<<" : ";
OS << S->UKnot(i) << " " << S->UMultiplicity(i) <<"\n";
}
OS << "\n";
if (!compact) OS << "\n VKnots :\n";
for (i = 1; i <= nbvknots; i++) {
- if (!compact) OS << "\n "<<setw(2)<<i<<" : ";
+ if (!compact) OS << "\n "<<std::setw(2)<<i<<" : ";
OS << S->VKnot(i) << " " << S->VMultiplicity(i) <<"\n";
}
OS << "\n";
//if (!compact)
// OS << "***** Unknown Surface ********\n";
//else
- // cout << "***** Unknown Surface ********"<<endl;
+ // std::cout << "***** Unknown Surface ********"<<std::endl;
}
}
OS << "\n -------\n\n";
for (i = 1; i <= nbsurf; i++) {
- OS << setw(4) << i << " : ";
+ OS << std::setw(4) << i << " : ";
PrintSurface(Handle(Geom_Surface)::DownCast(myMap(i)),OS,Standard_False);
}
}
//OCC19559
Handle(Message_ProgressIndicator) progress = GetProgress();
Message_ProgressSentry PS(progress, "Surfaces", 0, nbsurf, 1);
-
for (i = 1; i <= nbsurf && PS.More(); i++, PS.Next()) {
- if ( !progress.IsNull() )
- progress->Show();
-
PrintSurface(Handle(Geom_Surface)::DownCast(myMap(i)),OS,Standard_True);
}
-
OS.precision(prec);
}
static Standard_IStream& operator>>(Standard_IStream& IS, gp_Pnt& P)
{
Standard_Real X=0.,Y=0.,Z=0.;
- IS >> X >> Y >> Z;
+ GeomTools::GetReal(IS, X);
+ GeomTools::GetReal(IS, Y);
+ GeomTools::GetReal(IS, Z);
P.SetCoord(X,Y,Z);
return IS;
}
static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir& D)
{
Standard_Real X=0.,Y=0.,Z=0.;
- IS >> X >> Y >> Z;
+ GeomTools::GetReal(IS, X);
+ GeomTools::GetReal(IS, Y);
+ GeomTools::GetReal(IS, Z);
D.SetCoord(X,Y,Z);
return IS;
}
{
gp_Ax3 A;
Standard_Real R=0.;
- IS >> A >> R;
+ IS >> A;
+ GeomTools::GetReal(IS, R);
S = new Geom_CylindricalSurface(A,R);
return IS;
}
{
gp_Ax3 A;
Standard_Real R=0.,Ang=0.;
- IS >> A >> R >> Ang;
+ IS >> A;
+ GeomTools::GetReal(IS, R);
+ GeomTools::GetReal(IS, Ang);
S = new Geom_ConicalSurface(A,Ang,R);
return IS;
}
{
gp_Ax3 A;
Standard_Real R=0.;
- IS >> A >> R;
+ IS >> A;
+ GeomTools::GetReal(IS, R);
S = new Geom_SphericalSurface(A,R);
return IS;
}
{
gp_Ax3 A;
Standard_Real R1=0.,R2=0.;
- IS >> A >> R1 >> R2;
+ IS >> A;
+ GeomTools::GetReal(IS, R1);
+ GeomTools::GetReal(IS, R2);
S = new Geom_ToroidalSurface(A,R1,R2);
return IS;
}
Handle(Geom_SurfaceOfLinearExtrusion)& S)
{
gp_Dir D(1.,0.,0.);
- Handle(Geom_Curve) C;
IS >> D;
- GeomTools_CurveSet::ReadCurve(IS,C);
+ Handle(Geom_Curve) C = GeomTools_CurveSet::ReadCurve(IS);
S = new Geom_SurfaceOfLinearExtrusion(C,D);
return IS;
}
{
gp_Pnt P(0.,0.,0.);
gp_Dir D(1.,0.,0.);
- Handle(Geom_Curve) C;
IS >> P >> D;
- GeomTools_CurveSet::ReadCurve(IS,C);
+ Handle(Geom_Curve) C = GeomTools_CurveSet::ReadCurve(IS);
S = new Geom_SurfaceOfRevolution(C,gp_Ax1(P,D));
return IS;
}
for (j = 1; j <= vdegree+1; j++) {
IS >> poles(i,j);
if (urational || vrational)
- IS >> weights(i,j);
+ GeomTools::GetReal(IS, weights(i,j));
}
}
for (j = 1; j <= nbvpoles; j++) {
IS >> poles(i,j);
if (urational || vrational)
- IS >> weights(i,j);
+ GeomTools::GetReal(IS, weights(i,j));
}
}
TColStd_Array1OfReal uknots(1,nbuknots);
TColStd_Array1OfInteger umults(1,nbuknots);
for (i = 1; i <= nbuknots; i++) {
- IS >> uknots(i) >> umults(i);
+ GeomTools::GetReal(IS, uknots(i));
+ IS >> umults(i);
}
TColStd_Array1OfReal vknots(1,nbvknots);
TColStd_Array1OfInteger vmults(1,nbvknots);
for (i = 1; i <= nbvknots; i++) {
- IS >> vknots(i) >> vmults(i);
+ GeomTools::GetReal(IS, vknots(i));
+ IS >> vmults(i);
}
if (urational || vrational)
Handle(Geom_RectangularTrimmedSurface)& S)
{
Standard_Real U1=0.,U2=0.,V1=0.,V2=0.;
- IS >> U1 >> U2 >> V1 >> V2;
- Handle(Geom_Surface) BS;
- GeomTools_SurfaceSet::ReadSurface(IS,BS);
+ GeomTools::GetReal(IS, U1);
+ GeomTools::GetReal(IS, U2);
+ GeomTools::GetReal(IS, V1);
+ GeomTools::GetReal(IS, V2);
+ Handle(Geom_Surface) BS = GeomTools_SurfaceSet::ReadSurface(IS);
S = new Geom_RectangularTrimmedSurface(BS,U1,U2,V1,V2);
return IS;
}
Handle(Geom_OffsetSurface)& S)
{
Standard_Real O=0.;
- IS >> O;
- Handle(Geom_Surface) BS;
- GeomTools_SurfaceSet::ReadSurface(IS,BS);
- S = new Geom_OffsetSurface(BS,O);
+ GeomTools::GetReal(IS, O);
+ Handle(Geom_Surface) BS = GeomTools_SurfaceSet::ReadSurface(IS);
+ S = new Geom_OffsetSurface(BS,O,Standard_True);
return IS;
}
//purpose :
//=======================================================================
-Standard_IStream& GeomTools_SurfaceSet::ReadSurface(Standard_IStream& IS,
- Handle(Geom_Surface)& S)
+Handle(Geom_Surface) GeomTools_SurfaceSet::ReadSurface(Standard_IStream& IS)
{
Standard_Integer stype;
+ Handle(Geom_Surface) S;
try {
OCC_CATCH_SIGNALS
IS >> stype;
break;
}
}
- catch(Standard_Failure) {
-#ifdef DEB
- Handle(Standard_Failure) anExc = Standard_Failure::Caught();
- cout <<"EXCEPTION in GeomTools_SurfaceSet::ReadSurface(..)!!!" << endl;
- cout << anExc << endl;
+ catch(Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+ std::cout <<"EXCEPTION in GeomTools_SurfaceSet::ReadSurface(..)!!!" << std::endl;
+ std::cout << anException << std::endl;
#endif
- S = NULL;
+ (void)anException;
}
- return IS;
+ return S;
}
//=======================================================================
char buffer[255];
IS >> buffer;
if (strcmp(buffer,"Surfaces")) {
- cout << "Not a surface table"<<endl;
+ std::cout << "Not a surface table"<<std::endl;
return;
}
- Handle(Geom_Surface) S;
Standard_Integer i, nbsurf;
IS >> nbsurf;
//OCC19559
Handle(Message_ProgressIndicator) progress = GetProgress();
Message_ProgressSentry PS(progress, "Surfaces", 0, nbsurf, 1);
for (i = 1; i <= nbsurf && PS.More(); i++, PS.Next()) {
- if ( !progress.IsNull() )
- progress->Show();
-
- GeomTools_SurfaceSet::ReadSurface(IS,S);
+ Handle(Geom_Surface) S = GeomTools_SurfaceSet::ReadSurface (IS);
myMap.Add(S);
}
}