0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / GeomTools / GeomTools.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 8b6e897..a488cd7
@@ -1,29 +1,27 @@
 // Created on: 1993-01-21
 // Created by: Remi LEQUETTE
 // Copyright (c) 1993-1999 Matra Datavision
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
 //
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
 //
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// 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.
 //
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 
-#include <GeomTools.ixx>
-
-#include <GeomTools_SurfaceSet.hxx>
-#include <GeomTools_CurveSet.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Surface.hxx>
+#include <GeomTools.hxx>
 #include <GeomTools_Curve2dSet.hxx>
+#include <GeomTools_CurveSet.hxx>
+#include <GeomTools_SurfaceSet.hxx>
 #include <GeomTools_UndefinedTypeHandler.hxx>
 
 static Handle(GeomTools_UndefinedTypeHandler) theActiveHandler = new GeomTools_UndefinedTypeHandler;
@@ -40,7 +38,7 @@ void  GeomTools::Write(const Handle(Geom_Surface)& S, Standard_OStream& OS)
 
 void GeomTools::Read(Handle(Geom_Surface)& S, Standard_IStream& IS)
 {
-  GeomTools_SurfaceSet::ReadSurface(IS,S);
+  S = GeomTools_SurfaceSet::ReadSurface(IS);
 }
 
 void  GeomTools::Dump(const Handle(Geom_Curve)& C, Standard_OStream& OS)
@@ -55,7 +53,7 @@ void  GeomTools::Write(const Handle(Geom_Curve)& C, Standard_OStream& OS)
 
 void GeomTools::Read(Handle(Geom_Curve)& C, Standard_IStream& IS)
 {
-  GeomTools_CurveSet::ReadCurve(IS,C);
+  C = GeomTools_CurveSet::ReadCurve(IS);
 }
 
 void  GeomTools::Dump(const Handle(Geom2d_Curve)& C, Standard_OStream& OS)
@@ -70,7 +68,7 @@ void  GeomTools::Write(const Handle(Geom2d_Curve)& C, Standard_OStream& OS)
 
 void  GeomTools::Read(Handle(Geom2d_Curve)& C, Standard_IStream& IS)
 {
-  GeomTools_Curve2dSet::ReadCurve2d(IS,C);
+  C = GeomTools_Curve2dSet::ReadCurve2d(IS);
 }
 
 //=======================================================================
@@ -93,3 +91,22 @@ Handle(GeomTools_UndefinedTypeHandler) GeomTools::GetUndefinedTypeHandler()
 {
   return theActiveHandler;
 }
+
+//=======================================================================
+//function : GetReal
+//purpose  : 
+//=======================================================================
+
+void GeomTools::GetReal(Standard_IStream& IS,Standard_Real& theValue)
+{
+  theValue = 0.;
+  if (IS.eof()) 
+    return;
+
+  char buffer[256];
+  buffer[0] = '\0';
+  std::streamsize anOldWide = IS.width(256);
+  IS >> buffer;
+  IS.width(anOldWide);
+  theValue = Strtod(buffer, NULL);
+}