Part: set explicit format version number for binary BRep files to support all OCC versions

This commit is contained in:
wmayer
2021-12-12 01:15:56 +01:00
parent 7dcd59d9fb
commit 651a4d7626

View File

@@ -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);