X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FBuildPlugin%2FBuildPlugin_Edge.cpp;h=b78100d15a5f886cdf6f8febff64706ac0661d16;hb=7d7d8eab2109542bd50a90a09c63f8fee1bfbb60;hp=0ae8accdd928a69943710fd8352f1be56d45f197;hpb=1be6afdf88358a1f6823078e65e7d42574c10b8b;p=modules%2Fshaper.git diff --git a/src/BuildPlugin/BuildPlugin_Edge.cpp b/src/BuildPlugin/BuildPlugin_Edge.cpp index 0ae8accdd..b78100d15 100644 --- a/src/BuildPlugin/BuildPlugin_Edge.cpp +++ b/src/BuildPlugin/BuildPlugin_Edge.cpp @@ -8,18 +8,8 @@ #include #include -#include -#include - -#include -#include -#include - -#include -#include - -#include +#include //================================================================================================= BuildPlugin_Edge::BuildPlugin_Edge() @@ -71,9 +61,36 @@ void BuildPlugin_Edge::execute() return; } + // Copy shape. + GeomAlgoAPI_Copy aCopyAlgo(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."); + return; + } + // Store result. ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - aResultBody->store(aShape); + aResultBody->storeModified(aShape, aCopyAlgo.shape()); + std::shared_ptr aSubShapes = aCopyAlgo.mapOfSubShapes(); + int aModVertexTag = 1; + std::string aModVertexName = "Modified_Vertex"; + aResultBody->loadAndOrientModifiedShapes(&aCopyAlgo, aShape, GeomAPI_Shape::VERTEX, + aModVertexTag, aModVertexName, *aSubShapes.get()); + setResult(aResultBody, aResultIndex); ++aResultIndex; }