Part: set explicit format version number for BRep files to support all OCC versions
This commit is contained in:
@@ -1024,13 +1024,28 @@ void TopoShape::exportStep(const char *filename) const
|
||||
|
||||
void TopoShape::exportBrep(const char *filename) const
|
||||
{
|
||||
#if OCC_VERSION_HEX >= 0x070600
|
||||
if (!BRepTools::Write(this->_Shape,encodeFilename(filename).c_str(), Standard_False, Standard_False, TopTools_FormatVersion_VERSION_1))
|
||||
throw Base::FileException("Writing of BREP failed");
|
||||
#else
|
||||
if (!BRepTools::Write(this->_Shape,encodeFilename(filename).c_str()))
|
||||
throw Base::FileException("Writing of BREP failed");
|
||||
#endif
|
||||
}
|
||||
|
||||
void TopoShape::exportBrep(std::ostream& out) const
|
||||
{
|
||||
BRepTools::Write(this->_Shape, out);
|
||||
// See TopTools_FormatVersion of OCCT 7.6
|
||||
enum {
|
||||
VERSION_1 = 1,
|
||||
VERSION_2 = 2,
|
||||
VERSION_3 = 3
|
||||
};
|
||||
BRepTools_ShapeSet SS(Standard_False);
|
||||
SS.SetFormatNb(VERSION_1);
|
||||
SS.Add(this->_Shape);
|
||||
SS.Write(out);
|
||||
SS.Write(this->_Shape, out);
|
||||
}
|
||||
|
||||
void TopoShape::exportBinary(std::ostream& out)
|
||||
|
||||
Reference in New Issue
Block a user