]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/BuildPlugin/BuildPlugin_Vertex.cpp
Salome HOME
Update copyrights
[modules/shaper.git] / src / BuildPlugin / BuildPlugin_Vertex.cpp
index a1bd7cc3a5220d14905db8b10fff0ba0a731c246..82f3521ed81ac72dd66859b97c9a7e5a19e83bef 100644 (file)
@@ -1,25 +1,29 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        BuildPlugin_Vertex.cpp
-// Created:     18 April 2016
-// Author:      Dmitry Bobylev
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #include "BuildPlugin_Vertex.h"
 
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_ResultBody.h>
-#include <ModelAPI_ResultConstruction.h>
-
-#include <Events_Error.h>
-
-#include <GeomAPI_DataMapOfShapeShape.h>
-#include <GeomAPI_PlanarEdges.h>
-#include <GeomAPI_ShapeExplorer.h>
-
-#include <GeomAlgoAPI_ShapeTools.h>
-#include <GeomAlgoAPI_WireBuilder.h>
 
-#include <algorithm>
+#include <GeomAlgoAPI_Copy.h>
+#include <GeomAlgoAPI_Tools.h>
 
 //=================================================================================================
 BuildPlugin_Vertex::BuildPlugin_Vertex()
@@ -71,9 +75,18 @@ void BuildPlugin_Vertex::execute()
       return;
     }
 
+    // Copy shape.
+    std::shared_ptr<GeomAlgoAPI_Copy> aCopyAlgo(new GeomAlgoAPI_Copy(aShape));
+
+    std::string anError;
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCopyAlgo, getKind(), anError)) {
+      setError(anError);
+      return;
+    }
+
     // Store result.
     ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-    aResultBody->store(aShape);
+    aResultBody->storeModified(aShape, aCopyAlgo->shape());
     setResult(aResultBody, aResultIndex);
     ++aResultIndex;
   }