-// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 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
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#ifdef WNT
#pragma warning( disable:4786 )
#include "GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx"
#include "GEOM_PythonDump.hxx"
-#include <CASCatch_OCCTVersion.hxx>
+#include <Basics_OCCTVersion.hxx>
#include "utilities.h"
GEOM_Engine::GEOM_Engine()
{
TFunction_DriverTable::Get()->AddDriver(GEOM_Object::GetSubShapeID(), new GEOM_SubShapeDriver());
-
+
_OCAFApp = new GEOM_Application();
_UndoLimit = 10;
}
if (_objects.IsBound(anID)) _objects.UnBind(anID);
_objects.Bind(anID, anObject);
- // Put this subshape in the list of subshapes of theMainShape
+ // Put this sub-shape in the list of sub-shapes of theMainShape
aMainShape->AddSubShapeReference(aFunction);
GEOM::TPythonDump pd (aFunction);
TCollection_AsciiString anID = BuildIDFromObject(theObject);
if (_objects.IsBound(anID)) _objects.UnBind(anID);
- // If subshape, remove it from the list of subshapes of its main shape
+ // If sub-shape, remove it from the list of sub-shapes of its main shape
if (!theObject->IsMainShape()) {
Handle(GEOM_Function) aFunction = theObject->GetFunction(1);
GEOM_ISubShape aSSI (aFunction);
bool GEOM_Engine::Load(int theDocID, char* theFileName)
{
Handle(TDocStd_Document) aDoc;
- if(_OCAFApp->Open(theFileName, aDoc) != CDF_RS_OK) {
+#if OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher
+ if (_OCAFApp->Open(theFileName, aDoc) != PCDM_RS_OK) {
+#else
+ if (_OCAFApp->Open(theFileName, aDoc) != CDF_RS_OK) {
+#endif
return false;
}
continue;
// add function description before dump
if (!aCurScript.IsEmpty())
+ {
+ if ( aFunction->GetDriverGUID() == GEOM_Object::GetSubShapeID() )
+ // avoid repeated SubShape...() command at the end
+ if (aFuncScript.Location( aCurScript,
+ aFuncScript.Length() - aCurScript.Length(),
+ aFuncScript.Length()))
+ continue;
aFuncScript += aCurScript;
+ }
if (isDumpCollected ) {
// Replace entries by the names
ReplaceEntriesByNames( aFuncScript, aEntry2ObjData, isPublished,
else
aEndParamPos = aSection.Length() + 1;
+ if(MYDEBUG)
+ cout<<"aParamIndex: "<<aParamIndex<<" aStartParamPos: " <<aStartParamPos<<" aEndParamPos: "<<aEndParamPos<<endl;
+
+ if ( aStartParamPos == aEndParamPos)
+ continue;
+
aParameter = aSection.SubString(aStartParamPos, aEndParamPos-1);
if(MYDEBUG)
cout<<"aParameter: "<<aParameter<<endl;