]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ConstructionAPI/ConstructionAPI_Point.cpp
Salome HOME
Dump Python in the High Level Parameterized Geometry API (issue #1648)
[modules/shaper.git] / src / ConstructionAPI / ConstructionAPI_Point.cpp
index c503c16fa9c0885473a0ee4c8a672a558cb832d5..76be0f73bb2e6fd569af7b999a0fdb50592aafa1 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <GeomAPI_Shape.h>
 
+#include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Selection.h>
 #include <ModelHighAPI_Tools.h>
 
@@ -133,6 +134,21 @@ void ConstructionAPI_Point::setByLineAndPlaneIntersection(const ModelHighAPI_Sel
   execute();
 }*/
 
+//==================================================================================================
+void ConstructionAPI_Point::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  // TODO: all types of points
+
+  FeaturePtr aBase = feature();
+  const std::string& aDocName = theDumper.name(aBase->document());
+
+  AttributeDoublePtr anAttrX = aBase->real(ConstructionPlugin_Point::X());
+  AttributeDoublePtr anAttrY = aBase->real(ConstructionPlugin_Point::Y());
+  AttributeDoublePtr anAttrZ = aBase->real(ConstructionPlugin_Point::Z());
+  theDumper << aBase << " = model.addPoint(" << aDocName << ", "
+            << anAttrX << ", " << anAttrY << ", " << anAttrZ << ")" << std::endl;
+}
+
 //==================================================================================================
 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document>& thePart,
                   const ModelHighAPI_Double& theX,