1 // Created on: 1993-01-21
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <GeomTools.ixx>
19 #include <GeomTools_SurfaceSet.hxx>
20 #include <GeomTools_CurveSet.hxx>
21 #include <GeomTools_Curve2dSet.hxx>
22 #include <GeomTools_UndefinedTypeHandler.hxx>
24 static Handle(GeomTools_UndefinedTypeHandler) theActiveHandler = new GeomTools_UndefinedTypeHandler;
26 void GeomTools::Dump(const Handle(Geom_Surface)& S, Standard_OStream& OS)
28 GeomTools_SurfaceSet::PrintSurface(S,OS);
31 void GeomTools::Write(const Handle(Geom_Surface)& S, Standard_OStream& OS)
33 GeomTools_SurfaceSet::PrintSurface(S,OS,Standard_True);
36 void GeomTools::Read(Handle(Geom_Surface)& S, Standard_IStream& IS)
38 GeomTools_SurfaceSet::ReadSurface(IS,S);
41 void GeomTools::Dump(const Handle(Geom_Curve)& C, Standard_OStream& OS)
43 GeomTools_CurveSet::PrintCurve(C,OS);
46 void GeomTools::Write(const Handle(Geom_Curve)& C, Standard_OStream& OS)
48 GeomTools_CurveSet::PrintCurve(C,OS,Standard_True);
51 void GeomTools::Read(Handle(Geom_Curve)& C, Standard_IStream& IS)
53 GeomTools_CurveSet::ReadCurve(IS,C);
56 void GeomTools::Dump(const Handle(Geom2d_Curve)& C, Standard_OStream& OS)
58 GeomTools_Curve2dSet::PrintCurve2d(C,OS);
61 void GeomTools::Write(const Handle(Geom2d_Curve)& C, Standard_OStream& OS)
63 GeomTools_Curve2dSet::PrintCurve2d(C,OS,Standard_True);
66 void GeomTools::Read(Handle(Geom2d_Curve)& C, Standard_IStream& IS)
68 GeomTools_Curve2dSet::ReadCurve2d(IS,C);
71 //=======================================================================
72 //function : SetUndefinedTypeHandler
74 //=======================================================================
76 void GeomTools::SetUndefinedTypeHandler(const Handle(GeomTools_UndefinedTypeHandler)& aHandler)
78 if(!aHandler.IsNull())
79 theActiveHandler = aHandler;
82 //=======================================================================
83 //function : GetUndefinedTypeHandler
85 //=======================================================================
87 Handle(GeomTools_UndefinedTypeHandler) GeomTools::GetUndefinedTypeHandler()
89 return theActiveHandler;
92 //=======================================================================
95 //=======================================================================
97 void GeomTools::GetReal(Standard_IStream& IS,Standard_Real& theValue)
105 std::streamsize anOldWide = IS.width(256);
108 theValue = Strtod(buffer, NULL);