X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOM%2FGEOM_Engine.cxx;h=dd7fefae6afb03f4a8dbfb025a7ca14d3af57f7a;hb=d617faae6bc5aeb91b63796618a20c7c13037b6c;hp=f09601f8c9bd83f30cb4a86b01701337210160cc;hpb=d6f1d8730fa07983755573173bfdf8f708f91a17;p=modules%2Fgeom.git diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index f09601f8c..dd7fefae6 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -37,6 +37,7 @@ #include "utilities.h" #include +#include #include #include @@ -62,7 +63,9 @@ #include +#if OCC_VERSION_LARGE < 0x07050000 #include +#endif #include #include @@ -80,12 +83,6 @@ #define C_SQR_BRACKET ']' #define PY_NULL "None" -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - // VSR 29/08/2017: 0023327, 0023428: eliminate unnecessary lines in Python dump // Next macro, when defined, causes appearing of SubShapeAllIDs(), SubShapeAllSortedIDs(), GetSameIDs() // and other such commands in Python dump. @@ -113,7 +110,7 @@ bool ProcessFunction(Handle(GEOM_Function)& theFunction, TCollection_AsciiString& theScript, TCollection_AsciiString& theAfterScript, const TVariablesList& theVariables, - const bool theIsPublished, + const bool /*theIsPublished*/, TDF_LabelMap& theProcessed, std::set& theIgnoreObjs, bool& theIsDumpCollected); @@ -512,9 +509,13 @@ bool GEOM_Engine::Save(const char* theFileName) { if(!_document) return false; - _OCAFApp->SaveAs(_document, theFileName); +#if defined(WIN32) && defined(UNICODE) + std::wstring aFileName = Kernel_Utils::utf8_decode_s(theFileName); +#else + std::string aFileName = theFileName; +#endif - return true; + return _OCAFApp->SaveAs( _document, aFileName.c_str() ) == PCDM_SS_OK; } //============================================================================= @@ -524,8 +525,13 @@ bool GEOM_Engine::Save(const char* theFileName) //============================================================================= bool GEOM_Engine::Load(const char* theFileName) { +#if defined(WIN32) && defined(UNICODE) + std::wstring aFileName = Kernel_Utils::utf8_decode_s(theFileName); +#else + std::string aFileName = theFileName; +#endif Handle(TDocStd_Document) aDoc; - if (_OCAFApp->Open(theFileName, aDoc) != PCDM_RS_OK) { + if (_OCAFApp->Open(aFileName.c_str(), aDoc) != PCDM_RS_OK) { return false; } @@ -1289,14 +1295,14 @@ Handle(TColStd_HSequenceOfInteger) FindEntries(TCollection_AsciiString& theStrin void ReplaceVariables(TCollection_AsciiString& theCommand, const TVariablesList& theVariables) { - if (MYDEBUG) - cout<<"Command : "<GetCurrectState(); - if(MYDEBUG) { - cout<<"Variables from SObject:"<= aVariables.size()) continue; @@ -1480,28 +1488,31 @@ void ReplaceVariables(TCollection_AsciiString& theCommand, aReplacedParameter.InsertAfter(aReplacedParameter.Length(),"'"); } - if(MYDEBUG) - cout<<"aSection before : "<IncrementState(); } - if (MYDEBUG) - cout<<"Command : "<::const_iterator anIt = theEntryToCmdMap.find(theTag); @@ -1829,7 +1842,7 @@ TCollection_AsciiString GetPublishCommands TIntToListIntMap::const_iterator aRefIt = theMapRefs.find(theTag); if (aRefIt != theMapRefs.end()) { - // Recursively publish all references. + // Recursively publish all references. std::list< int >::const_iterator aRefTagIt = aRefIt->second.begin(); for(; aRefTagIt != aRefIt->second.end(); ++aRefTagIt) { @@ -1843,8 +1856,6 @@ TCollection_AsciiString GetPublishCommands // Add the object command. aResult += anIt->second; } - - thePublished.insert(theTag); } return aResult;