#include <Standard_Integer.hxx>
#include <BinObjMgt_Persistent.hxx>
+#include <TDocStd_FormatVersion.hxx>
class BinMDF_ADriverTable;
class Message_Messenger;
static void SetAttributeID(const BinObjMgt_Persistent& theSource, const Handle(T)& anAtt, const Standard_Integer aDocFormatVersion)
{
Standard_Boolean ok = Standard_True;
- if(aDocFormatVersion > 9) { // process user defined guid
+ if(aDocFormatVersion >= TDocStd_FormatVersion_VERSION_10) { // process user defined guid
const Standard_Integer& aPos = theSource.Position();
Standard_GUID aGuid;
ok = theSource >> aGuid;
} else
return Standard_False;
} else {
- // read the datum's trasformation
+ // read the datum's transformation
gp_Trsf aTrsf;
Standard_Real aScaleFactor;
--- /dev/null
+// Copyright (c) 2020 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.
+
+#ifndef _BinToolsFormatVersion_HeaderFile
+#define _BinToolsFormatVersion_HeaderFile
+
+//! Defined BinTools format version
+enum BinTools_FormatVersion
+{
+ BinTools_FormatVersion_VERSION_1 = 1, //!< Does not write CurveOnSurface UV Points into the file.
+ //! On reading calls Check() method.
+ BinTools_FormatVersion_VERSION_2 = 2, //!< Stores CurveOnSurface UV Points.
+ //! On reading format is recognized from Version string.
+ BinTools_FormatVersion_VERSION_3 = 3, //!< (OCCT 6.2.1) Correctly processes geometry with points on Curve,
+ //! or point on Surface, or points on curve of surface [#0009745]
+
+ BinTools_FormatVersion_CURRENT = BinTools_FormatVersion_VERSION_1 //!< The current version.
+};
+
+#endif
else if (FormatNb() == BinTools_FormatVersion_VERSION_2)
{
OS << "\n" << Version_2 << "\n";
+ }
else
+ {
OS << "\n" << Version_1 << "\n";
+ }
//-----------------------------------------
// write the locations
} while ( ! IS.fail() && strcmp(vers,Version_1) && strcmp(vers,Version_2) &&
strcmp(vers,Version_3));
if (IS.fail()) {
- std::cout << "BinTools_ShapeSet::Read: File was not written with this version of the topology"<<std::endl;
- return;
+ std::cout << "BinTools_ShapeSet::Read: File was not written with this version of the topology" << std::endl;
+ return;
}
- if (strcmp(vers,Version_3) == 0) SetFormatNb(3);
- else if (strcmp(vers,Version_2) == 0) SetFormatNb(2);
- else SetFormatNb(1);
+ if (strcmp (vers, Version_3) == 0)
+ {
+ SetFormatNb (BinTools_FormatVersion_VERSION_3);
+ }
+ else if (strcmp (vers, Version_2) == 0)
+ {
+ SetFormatNb (BinTools_FormatVersion_VERSION_2);
+ }
+ else
+ {
+ SetFormatNb (BinTools_FormatVersion_VERSION_1);
+ }
//-----------------------------------------
// read the locations
{
gp_Pnt2d Pf,Pl;
if (CR->IsCurveOnClosedSurface()) {
- Handle(BRep_CurveOnClosedSurface) COCS =
- Handle(BRep_CurveOnClosedSurface)::DownCast(CR);
+ Handle(BRep_CurveOnClosedSurface) COCS = Handle(BRep_CurveOnClosedSurface)::DownCast(CR);
COCS->UVPoints2(Pf,Pl);
}
else {
- Handle(BRep_CurveOnSurface) COS =
- Handle(BRep_CurveOnSurface)::DownCast(CR);
+ Handle(BRep_CurveOnSurface) COS = Handle(BRep_CurveOnSurface)::DownCast(CR);
COS->UVPoints(Pf,Pl);
}
BinTools::PutReal(OS, Pf.X());
BinTools_Curve2dSet.hxx
BinTools_CurveSet.cxx
BinTools_CurveSet.hxx
+BinTools_FormatVersion.hxx
BinTools_IStream.cxx
BinTools_IStream.hxx
BinTools_LocationSet.cxx