]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Dump Python in the High Level Parameterized Geometry API (issue #1648)
authorazv <azv@opencascade.com>
Tue, 16 Aug 2016 07:59:42 +0000 (10:59 +0300)
committerazv <azv@opencascade.com>
Tue, 16 Aug 2016 08:01:01 +0000 (11:01 +0300)
* Dump for BuildPlugin_Vertex

src/BuildAPI/BuildAPI_Vertex.cpp
src/BuildAPI/BuildAPI_Vertex.h
src/PythonAPI/model/__init__.py
src/PythonAPI/model/build/__init__.py [new file with mode: 0644]

index b1723c84e3141bcd69e63b42657525827dacdc27..1ac2f874959a868204c420e810bbf53d56d2f32b 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "BuildAPI_Vertex.h"
 
+#include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 
 //==================================================================================================
@@ -46,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;
+}
index a01ea4c14284f95096a703b3655f696f263fb923..d4dc4b8c58fdce40458a5016e5e19dadcd9f6c97 100644 (file)
@@ -41,6 +41,10 @@ public:
   /// Modify base attribute of the feature.
   BUILDAPI_EXPORT
   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
+
+  /// Dump wrapped feature
+  BUILDAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
 };
 
 /// Pointer on Vertex object.
index 58ddaac9994c1eec692fbba35cbcb39b525e09b8..fc24671cd8fb42eaf4e30429ee10d085ef583f28 100644 (file)
@@ -13,6 +13,7 @@ from roots     import *
 
 # Built-in features
 
+from build import *
 from sketcher import *
 from connection import *
 from construction import *
diff --git a/src/PythonAPI/model/build/__init__.py b/src/PythonAPI/model/build/__init__.py
new file mode 100644 (file)
index 0000000..e700be8
--- /dev/null
@@ -0,0 +1,4 @@
+"""Package for Build plugin for the Parametric Geometry API of the Modeler.
+"""
+
+from BuildAPI import addVertex