X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FBuildPlugin%2FBuildPlugin_Vertex.cpp;h=a2475d8702a5d3566deb1eae6387316b51d43610;hb=6e511a39b3b982757b90b73a7cfc4a1139ebc83c;hp=585682a32ff6bde03ee202ab3a898ce1bdbc975f;hpb=87b6a30a3afb8fb32e7e43ade8d9c947d9eb1684;p=modules%2Fshaper.git diff --git a/src/BuildPlugin/BuildPlugin_Vertex.cpp b/src/BuildPlugin/BuildPlugin_Vertex.cpp index 585682a32..a2475d870 100644 --- a/src/BuildPlugin/BuildPlugin_Vertex.cpp +++ b/src/BuildPlugin/BuildPlugin_Vertex.cpp @@ -24,6 +24,7 @@ #include #include +#include //================================================================================================= BuildPlugin_Vertex::BuildPlugin_Vertex() @@ -76,29 +77,17 @@ void BuildPlugin_Vertex::execute() } // Copy shape. - GeomAlgoAPI_Copy aCopyAlgo(aShape); + std::shared_ptr aCopyAlgo(new GeomAlgoAPI_Copy(aShape)); - // Check that algo is done. - if(!aCopyAlgo.isDone()) { - setError("Error: " + getKind() + " algorithm failed."); - return; - } - - // Check if shape is not null. - if(!aCopyAlgo.shape().get() || aCopyAlgo.shape()->isNull()) { - setError("Error: Resulting shape is null."); - return; - } - - // Check that resulting shape is valid. - if(!aCopyAlgo.isValid()) { - setError("Error: Resulting shape is not valid."); + std::string anError; + if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCopyAlgo, getKind(), anError)) { + setError(anError); return; } // Store result. ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - aResultBody->storeModified(aShape, aCopyAlgo.shape()); + aResultBody->storeModified(aShape, aCopyAlgo->shape()); setResult(aResultBody, aResultIndex); ++aResultIndex; }