-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <TColStd_MapOfTransient.hxx>
#include <TColStd_HSequenceOfInteger.hxx>
-#include <TColStd_HArray1OfByte.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
#include <Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString.hxx>
+#if OCC_VERSION_LARGE > 0x07000000
+#include <BinDrivers.hxx>
+#include <StdDrivers_DocumentRetrievalDriver.hxx>
+#include <PCDM_StorageDriver.hxx>
+#endif
+
#include <set>
#include <Standard_Failure.hxx>
TFunction_DriverTable::Get()->AddDriver(GEOM_Object::GetSubShapeID(), new GEOM_SubShapeDriver());
_OCAFApp = new GEOM_Application();
+#if OCC_VERSION_LARGE > 0x07000000
+ _OCAFApp->DefineFormat("SALOME_GEOM", "GEOM Document Version 1.0", "sgd",
+ new StdDrivers_DocumentRetrievalDriver, 0);
+ BinDrivers::DefineFormat(_OCAFApp);
+#endif
_UndoLimit = 0;
}
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);
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);
const int aRefTag = GetTag(anObjEntry);
- theRefMap[anObjTag].push_back(aRefTag);
+ if (anObjTag != aRefTag) {
+ // Avoid making references for operations without copy.
+ theRefMap[anObjTag].push_back(aRefTag);
+ }
}
}
}
// store aCreationCommand before publishing commands
int tag = GetTag(theObjectData._entry);
- theEntryToCmdMap.insert( std::make_pair( tag + 2*theEntry2ObjData.size(), aCreationCommand ));
+ theEntryToCmdMap.insert( std::make_pair( tag + -2*theEntry2ObjData.size(), aCreationCommand ));
}
// make a command
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);