0025255: API to control storage with triangulation in BinTools
[occt.git] / src / BinTools / BinTools_ShapeSet.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 1cba7ec..1aa3a5b
@@ -1,8 +1,17 @@
-// File:       BinTools_ShapeSet.cxx
-// Created:    Tue May 11 18:16:36 2004
-// Author:     Sergey ZARITCHNY <szy@opencascade.com>
-// Copyright:  Open CasCade S.A. 2004
-
+// Created on: 2004-05-11
+// Created by: Sergey ZARITCHNY
+// Copyright (c) 2004-2014 OPEN CASCADE SAS
+//
+// 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 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 <BinTools_ShapeSet.ixx>
 #include <Standard_ErrorHandler.hxx>
@@ -60,7 +69,7 @@ static Standard_OStream& operator <<(Standard_OStream& OS, const gp_Pnt P)
 //=======================================================================
 
 BinTools_ShapeSet::BinTools_ShapeSet(const Standard_Boolean isWithTriangles)
-     :myWithTriangles(isWithTriangles), myFormatNb(3)
+     :myFormatNb(3), myWithTriangles(isWithTriangles)
 {}
 
 //=======================================================================
@@ -71,6 +80,15 @@ BinTools_ShapeSet::BinTools_ShapeSet(const Standard_Boolean isWithTriangles)
 void BinTools_ShapeSet::Delete()
 {}
 
+//=======================================================================
+//function : SetWithTriangles
+//purpose  : 
+//=======================================================================
+void BinTools_ShapeSet::SetWithTriangles(const Standard_Boolean isWithTriangles)
+{
+  myWithTriangles = isWithTriangles;
+}
+
 //=======================================================================
 //function : SetFormatNb
 //purpose  : 
@@ -371,7 +389,7 @@ void  BinTools_ShapeSet::Read(Standard_IStream& IS)
     IS.getline(vers,100,'\n');
     // BUC60769 PTV 18.10.2000: remove possible '\r' at the end of the line
     
-    for (Standard_Integer lv = (strlen(vers)- 1); lv > 1 && (vers[lv] == '\r' || vers[lv] == '\n') ;lv--) 
+    for (Standard_Size lv = (strlen(vers)- 1); lv > 1 && (vers[lv] == '\r' || vers[lv] == '\n') ;lv--) 
       vers[lv] = '\0';
     
   } while ( ! IS.fail() && strcmp(vers,Version_1) && strcmp(vers,Version_2) &&
@@ -744,17 +762,13 @@ void  BinTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
 {
   // Read the geometry
 
-  Standard_Integer val, c,pc,pc2,s,s2,l,l2,t, pt, pt2;
-  Standard_Real tol,X,Y,Z,first,last,p1,p2;
+  Standard_Integer val, c,pc,pc2 = 0,s,s2,l,l2,t, pt, pt2 = 0;
+  Standard_Real tol,X,Y,Z,first,last,p1 = 0.,p2;
   Standard_Real PfX,PfY,PlX,PlY;
   gp_Pnt2d aPf, aPl;
   Standard_Boolean closed, bval;
   Standard_SStream aMsg;
-#ifndef DEB
   GeomAbs_Shape reg = GeomAbs_C0;
-#else
-  GeomAbs_Shape reg;
-#endif
   try {
     OCC_CATCH_SIGNALS
     switch (T) {
@@ -790,7 +804,7 @@ void  BinTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
            if (val > 0 && val <= 3) 
              BinTools::GetReal(IS, p1); 
          } else {
-           Standard_Integer aPos = IS.tellg();
+        streampos aPos = IS.tellg();
            BinTools::GetReal(IS, p1);      
            val = (Standard_Integer)IS.get();//case {0|1|2|3}
 #ifdef MDTV_DEB