From 651a4d7626bbef077ce39a686df88f83ddcd8908 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 12 Dec 2021 01:15:56 +0100 Subject: [PATCH] Part: set explicit format version number for binary BRep files to support all OCC versions --- src/Mod/Part/App/TopoShape.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index f3c11745b7..4f03ee5610 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -1050,8 +1050,17 @@ void TopoShape::exportBrep(std::ostream& out) const void TopoShape::exportBinary(std::ostream& out) { + // See BinTools_FormatVersion of OCCT 7.6 + enum { + VERSION_1 = 1, + VERSION_2 = 2, + VERSION_3 = 3, + VERSION_4 = 4 + }; + // An example how to use BinTools_ShapeSet can be found in BinMNaming_NamedShapeDriver.cxx BinTools_ShapeSet theShapeSet; + theShapeSet.SetFormatNb(VERSION_3); if (this->_Shape.IsNull()) { theShapeSet.Add(this->_Shape); theShapeSet.Write(out);