From: dbv Date: Thu, 29 Dec 2016 13:37:24 +0000 (+0300) Subject: Issue #1932: error when dump study with not loaded documents X-Git-Tag: V_2.7.0~351^2~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=105ca0409d85455ee48a1caf39f48652761edeb8;p=modules%2Fshaper.git Issue #1932: error when dump study with not loaded documents Changed error message. --- diff --git a/src/ExchangePlugin/ExchangePlugin_Dump.cpp b/src/ExchangePlugin/ExchangePlugin_Dump.cpp index e81c896aa..f0f740671 100644 --- a/src/ExchangePlugin/ExchangePlugin_Dump.cpp +++ b/src/ExchangePlugin/ExchangePlugin_Dump.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include @@ -48,6 +49,20 @@ void ExchangePlugin_Dump::dump(const std::string& theFileName) ModelHighAPI_Dumper* aDumper = ModelHighAPI_Dumper::getInstance(); aDumper->clear(); DocumentPtr aDoc = ModelAPI_Session::get()->moduleDocument(); + + std::list aFeatures = aDoc->allFeatures(); + for(std::list::const_iterator aFeatIt = aFeatures.begin(); + aFeatIt != aFeatures.end(); + ++aFeatIt) { + ResultPartPtr aResultPart = std::dynamic_pointer_cast((*aFeatIt)->firstResult()); + if(aResultPart.get()) { + if(!aResultPart->isActivated()) { + setError("Error: Not all parts are loaded. Can not dump."); + return; + } + } + } + if (!aDumper || !aDumper->process(aDoc, theFileName)) setError("An error occured while dumping to " + theFileName); }