]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOM/GEOM_Engine.cxx
Salome HOME
Migration to OCCT 7.0
[modules/geom.git] / src / GEOM / GEOM_Engine.cxx
index 7550ef30aea1ee54dae07b3aeeab64e740fc0332..ac1216f5a27922600c4eb93f3c2011d5867b53cb 100644 (file)
@@ -62,7 +62,6 @@
 #include <TColStd_MapOfTransient.hxx>
 #include <TColStd_HSequenceOfInteger.hxx>
 
-#include <TColStd_HArray1OfByte.hxx>
 #include <TColStd_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
 
 #include <Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString.hxx>
@@ -265,7 +264,11 @@ Handle(TDocStd_Document) GEOM_Engine::GetDocument(int theDocID, bool force)
     aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID));
   }
   else if (force) {
+#if OCC_VERSION_MAJOR > 6
+    _OCAFApp->NewDocument("BinOcaf", aDoc);
+#else
     _OCAFApp->NewDocument("SALOME_GEOM", aDoc);
+#endif
     aDoc->SetUndoLimit(_UndoLimit);
     _mapIDDocument.Bind(theDocID, aDoc);
     TDataStd_Integer::Set(aDoc->Main(), theDocID);
@@ -564,6 +567,13 @@ bool GEOM_Engine::Load(int theDocID, const char* theFileName)
     return false;
   }
 
+#if OCC_VERSION_MAJOR > 6
+  // Replace old document format by the new one.
+  if (aDoc->StorageFormat().IsEqual("SALOME_GEOM")) {
+    aDoc->ChangeStorageFormat("BinOcaf");
+  }
+#endif
+
   aDoc->SetUndoLimit(_UndoLimit);
 
   if(_mapIDDocument.IsBound(theDocID)) _mapIDDocument.UnBind(theDocID);
@@ -1878,7 +1888,7 @@ TCollection_AsciiString GetPublishCommands
       if (aRefIt != theMapRefs.end()) {
         // Recursively publish all references.
         std::list< int >::const_iterator aRefTagIt = aRefIt->second.begin();
-  
+
         for(; aRefTagIt != aRefIt->second.end(); ++aRefTagIt) {
           const TCollection_AsciiString aRefCmd = GetPublishCommands
             (*aRefTagIt, theEntryToCmdMap, theMapRefs, thePublished);