Adjust PropertyTopoShape::Save code for correctness.

This commit is contained in:
bgbsww
2024-07-07 09:38:15 -04:00
committed by Chris Hennes
parent 5568b40a07
commit 6ac5370cc4

View File

@@ -298,21 +298,13 @@ void PropertyPartShape::Save (Base::Writer &writer) const
writer.Stream() << " ElementMap=\"" << version << '"';
bool binary = writer.getMode("BinaryBrep");
bool toXML = writer.getFileVersion()>1 && writer.isForceXML()>=(binary?3:2);
bool toXML = writer.isForceXML();
if(!toXML) {
writer.Stream() << " file=\""
<< writer.addFile(getFileName(binary?".bin":".brp").c_str(), this)
<< "\"/>\n";
} else if(binary) {
writer.Stream() << " binary=\"1\">\n";
TopoShape shape;
shape.setShape(_Shape.getShape());
shape.exportBinary(writer.beginCharStream());
writer.endCharStream() << writer.ind() << "</Part>\n";
} else {
writer.Stream() << " brep=\"1\">\n";
_Shape.exportBrep(writer.beginCharStream()<<'\n');
writer.endCharStream() << '\n' << writer.ind() << "</Part>\n";
writer.Stream() << "/>\n";
}
if(_SaveHasher) {