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.
18 #include <Geom2d_Curve.hxx>
19 #include <Geom_Curve.hxx>
20 #include <Geom_Surface.hxx>
21 #include <GeomTools.hxx>
22 #include <GeomTools_Curve2dSet.hxx>
23 #include <GeomTools_CurveSet.hxx>
24 #include <GeomTools_SurfaceSet.hxx>
25 #include <GeomTools_UndefinedTypeHandler.hxx>
27 static Handle(GeomTools_UndefinedTypeHandler) theActiveHandler = new GeomTools_UndefinedTypeHandler;
29 void GeomTools::Dump(const Handle(Geom_Surface)& S, Standard_OStream& OS)
31 GeomTools_SurfaceSet::PrintSurface(S,OS);
34 void GeomTools::Write(const Handle(Geom_Surface)& S, Standard_OStream& OS)
36 GeomTools_SurfaceSet::PrintSurface(S,OS,Standard_True);
39 void GeomTools::Read(Handle(Geom_Surface)& S, Standard_IStream& IS)
41 S = GeomTools_SurfaceSet::ReadSurface(IS);
44 void GeomTools::Dump(const Handle(Geom_Curve)& C, Standard_OStream& OS)
46 GeomTools_CurveSet::PrintCurve(C,OS);
49 void GeomTools::Write(const Handle(Geom_Curve)& C, Standard_OStream& OS)
51 GeomTools_CurveSet::PrintCurve(C,OS,Standard_True);
54 void GeomTools::Read(Handle(Geom_Curve)& C, Standard_IStream& IS)
56 C = GeomTools_CurveSet::ReadCurve(IS);
59 void GeomTools::Dump(const Handle(Geom2d_Curve)& C, Standard_OStream& OS)
61 GeomTools_Curve2dSet::PrintCurve2d(C,OS);
64 void GeomTools::Write(const Handle(Geom2d_Curve)& C, Standard_OStream& OS)
66 GeomTools_Curve2dSet::PrintCurve2d(C,OS,Standard_True);
69 void GeomTools::Read(Handle(Geom2d_Curve)& C, Standard_IStream& IS)
71 C = GeomTools_Curve2dSet::ReadCurve2d(IS);
74 //=======================================================================
75 //function : SetUndefinedTypeHandler
77 //=======================================================================
79 void GeomTools::SetUndefinedTypeHandler(const Handle(GeomTools_UndefinedTypeHandler)& aHandler)
81 if(!aHandler.IsNull())
82 theActiveHandler = aHandler;
85 //=======================================================================
86 //function : GetUndefinedTypeHandler
88 //=======================================================================
90 Handle(GeomTools_UndefinedTypeHandler) GeomTools::GetUndefinedTypeHandler()
92 return theActiveHandler;
95 //=======================================================================
98 //=======================================================================
100 void GeomTools::GetReal(Standard_IStream& IS,Standard_Real& theValue)
108 std::streamsize anOldWide = IS.width(256);
111 theValue = Strtod(buffer, NULL);