Salome HOME
Issue #1834: Fix length of lines
[modules/shaper.git] / src / BuildAPI / BuildAPI_Vertex.cpp
index a3b71ae5f1e2fcc3665d2fac291b3deb79e9d0d4..1ac2f874959a868204c420e810bbf53d56d2f32b 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "BuildAPI_Vertex.h"
 
+#include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 
 //==================================================================================================
@@ -39,7 +40,6 @@ void BuildAPI_Vertex::setBase(const std::list<ModelHighAPI_Selection>& theBaseOb
   execute();
 }
 
-// TODO(spo): make add* as static functions of the class
 //==================================================================================================
 VertexPtr addVertex(const std::shared_ptr<ModelAPI_Document>& thePart,
                     const std::list<ModelHighAPI_Selection>& theBaseObjects)
@@ -47,3 +47,13 @@ VertexPtr addVertex(const std::shared_ptr<ModelAPI_Document>& thePart,
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(BuildAPI_Vertex::ID());
   return VertexPtr(new BuildAPI_Vertex(aFeature, theBaseObjects));
 }
+
+//==================================================================================================
+void BuildAPI_Vertex::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+  std::string aPartName = theDumper.name(aBase->document());
+
+  theDumper << aBase << " = model.addVertex(" << aPartName << ", "
+            << aBase->selectionList(BuildPlugin_Vertex::BASE_OBJECTS_ID()) << ")" << std::endl;
+}