mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-15 12:07:41 +08:00
0031946: Modeling Data - replace version numbers with enumerations in TopTools and BinTools
Added enumerations BinTools_FormatVersion & TopTools_FormatVersion for more clear version tracking in the code.
Added new BinTools::Write() & BRepTools::Write() overloaded functions with version & isWithTriangles parameters.
Added new "readbrep"/"writebrep" DRAW commands handling reading and writing of both Binary and ASCII .brep formats
and providing arguments to setup writing of triangulation data and of format version.
"binrestore" is made an alias to new command "readbrep".
"binsave" now is an alias to new "writebrep" saving into binary format by default ("writebrep" writes into ASCII format by default).
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDataStd_ExtStringArray.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDocStd_FormatVersion.hxx>
|
||||
#include <XmlMDataStd.hxx>
|
||||
#include <XmlMDataStd_ExtStringArrayDriver.hxx>
|
||||
#include <XmlObjMgt.hxx>
|
||||
@@ -195,7 +196,7 @@ Standard_Boolean XmlMDataStd_ExtStringArrayDriver::Paste
|
||||
// Read delta-flag.
|
||||
Standard_Boolean aDelta(Standard_False);
|
||||
|
||||
if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 2) {
|
||||
if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() >= TDocStd_FormatVersion_VERSION_3) {
|
||||
Standard_Integer aDeltaValue;
|
||||
if (!anElement.getAttribute(::IsDeltaOn()).GetInteger(aDeltaValue))
|
||||
{
|
||||
@@ -240,7 +241,7 @@ void XmlMDataStd_ExtStringArrayDriver::Paste (const Handle(TDF_Attribute)& theSo
|
||||
// So, if the user wants to save the document under the 7th or earlier versions,
|
||||
// don't apply this improvement.
|
||||
Standard_Character c = '-';
|
||||
if (theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 7)
|
||||
if (theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() >= TDocStd_FormatVersion_VERSION_8)
|
||||
{
|
||||
// Preferrable symbols for the separator: - _ . : ^ ~
|
||||
// Don't use a space as a separator: XML low-level parser sometimes "eats" it.
|
||||
|
||||
Reference in New Issue
Block a user