1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03: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:
asuraven
2020-11-03 17:22:14 +03:00
committed by bugmaster
parent 1e1158c78b
commit 14eea8293d
44 changed files with 653 additions and 203 deletions

View File

@@ -41,6 +41,7 @@
#include <TDF_Data.hxx>
#include <TDF_Label.hxx>
#include <TDocStd_Document.hxx>
#include <TDocStd_FormatVersion.hxx>
#include <TDocStd_Owner.hxx>
#include <Message_ProgressScope.hxx>
@@ -192,7 +193,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
else if (aStr == END_TYPES)
break;
else if (begin) {
if ( aFileVer < 8 ) {
if ( aFileVer < TDocStd_FormatVersion_VERSION_8) {
#ifdef DATATYPE_MIGRATION
TCollection_AsciiString newName;
if(Storage_Schema::CheckTypeMigration(aStr, newName)) {
@@ -236,7 +237,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
Message_ProgressScope aPS(theRange, "Reading data", 3);
// 2b. Read the TOC of Sections
if (aFileVer >= 3) {
if (aFileVer >= TDocStd_FormatVersion_VERSION_3) {
BinLDrivers_DocumentSection aSection;
do {
BinLDrivers_DocumentSection::ReadTOC (aSection, theIStream, aFileVer);
@@ -347,7 +348,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
}
// Read Sections (post-reading type)
if (aFileVer >= 3) {
if (aFileVer >= TDocStd_FormatVersion_VERSION_3) {
BinLDrivers_VectorOfDocumentSection::Iterator aSectIter (mySections);
for (; aSectIter.More(); aSectIter.Next()) {
BinLDrivers_DocumentSection& aCurSection = aSectIter.ChangeValue();
@@ -569,7 +570,7 @@ Standard_Boolean BinLDrivers_DocumentRetrievalDriver::CheckDocumentVersion(
const Standard_Integer theFileVersion,
const Standard_Integer theCurVersion)
{
if (theFileVersion < 2 || theFileVersion > theCurVersion) {
if (theFileVersion < TDocStd_FormatVersion_VERSION_2 || theFileVersion > theCurVersion) {
// file was written with another version
return Standard_False;
}