]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
fix : Fix python dump with translation AddNode_enhanced
authorNicolas RECHATIN <nicolas.rechatin@cea.fr>
Mon, 2 Oct 2023 08:50:26 +0000 (10:50 +0200)
committerNicolas RECHATIN <nicolas.rechatin@cea.fr>
Mon, 2 Oct 2023 08:50:26 +0000 (10:50 +0200)
src/OperaAPI/OperaAPI_AddNode.cpp
src/OperaAPI/OperaAPI_AddNode.h

index 74d578de993394f45fb600ed943c966069a6749a..68ee9cdf0d3e55f4d82928002726139bb83a59ce 100644 (file)
@@ -30,14 +30,20 @@ OperaAPI_AddNode::OperaAPI_AddNode(const std::shared_ptr<ModelAPI_Feature>& theF
 
 
 //==================================================================================================
-OperaAPI_AddNode::OperaAPI_AddNode(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                   const ModelHighAPI_Selection& theMainObject,
-                                   const ModelHighAPI_Selection& theTool)
-                                                                      : ModelHighAPI_Interface(theFeature)
+OperaAPI_AddNode::OperaAPI_AddNode(const std::shared_ptr<ModelAPI_Feature> &theFeature,
+                                   const ModelHighAPI_Selection &theMainObject,
+                                   const ModelHighAPI_Selection &theTool,
+                                   const ModelHighAPI_Double &theDx,
+                                   const ModelHighAPI_Double &theDy,
+                                   const ModelHighAPI_Double &theDz)
+: ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
     fillAttribute(theMainObject, mainObject());
     setToolObject(theTool);
+    fillAttribute(theDx, dx());
+    fillAttribute(theDy, dy());
+    fillAttribute(theDz, dz());
   }
 }
 
@@ -71,14 +77,22 @@ void OperaAPI_AddNode::dump(ModelHighAPI_Dumper& theDumper) const
 
   AttributeSelectionPtr anAttrTool =
     aBase->selection(OperaPlugin_AddNode::TOOL_OBJECT_ID());
-  theDumper << anAttrTool << ")" << std::endl;
+  theDumper << anAttrTool;
+
+  AttributeDoublePtr anAttrDx = aBase->real(OperaPlugin_AddNode::DX_ID());
+  AttributeDoublePtr anAttrDy = aBase->real(OperaPlugin_AddNode::DY_ID());
+  AttributeDoublePtr anAttrDz = aBase->real(OperaPlugin_AddNode::DZ_ID());
+  theDumper << ", " << anAttrDx << ", " << anAttrDy << ", " << anAttrDz << ")" << std::endl;
 }
 
 //==================================================================================================
-AddNodePtr addAddNode(const std::shared_ptr<ModelAPI_Document>& thePart,
-                      const ModelHighAPI_Selection& theMainObject,
-                      const ModelHighAPI_Selection& theTool)
+AddNodePtr addAddNode(const std::shared_ptr<ModelAPI_Document> &thePart,
+                      const ModelHighAPI_Selection &theMainObject,
+                      const ModelHighAPI_Selection &theTool,
+                      const ModelHighAPI_Double &theDx,
+                      const ModelHighAPI_Double &theDy,
+                      const ModelHighAPI_Double &theDz)
 {
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(OperaAPI_AddNode::ID());
-  return AddNodePtr(new OperaAPI_AddNode(aFeature, theMainObject, theTool));
+  return AddNodePtr(new OperaAPI_AddNode(aFeature, theMainObject, theTool, theDx, theDy, theDz));
 }
index 6eda7dee6f3d8ac51f16e5e33c5efcb8fe3fe465..c03cd25f6a7aae16b98b31cdfe401e45310b0bc5 100644 (file)
@@ -26,6 +26,7 @@
 #include <ModelHighAPI_Interface.h>
 #include <ModelHighAPI_Macro.h>
 
+class ModelHighAPI_Double;
 class ModelHighAPI_Selection;
 
 /// \class OperaAPI_AddNode
@@ -40,9 +41,12 @@ public:
 
   /// Constructor with values.
   OPERAAPI_EXPORT
-  explicit OperaAPI_AddNode(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                            const ModelHighAPI_Selection& theMainObject,
-                            const ModelHighAPI_Selection& theTool);
+  explicit OperaAPI_AddNode(const std::shared_ptr<ModelAPI_Feature> &theFeature,
+                            const ModelHighAPI_Selection &theMainObject,
+                            const ModelHighAPI_Selection &theTool,
+                            const ModelHighAPI_Double &theDx,
+                            const ModelHighAPI_Double &theDy,
+                            const ModelHighAPI_Double &theDz);
 
   /// Destructor.
   OPERAAPI_EXPORT
@@ -79,8 +83,11 @@ typedef std::shared_ptr<OperaAPI_AddNode> AddNodePtr;
 /// \ingroup CPPHighAPI
 /// \brief Create Volume feature.
 OPERAAPI_EXPORT
-AddNodePtr addAddNode(const std::shared_ptr<ModelAPI_Document>& thePart,
-                      const ModelHighAPI_Selection& theMainObject,
-                      const ModelHighAPI_Selection& theTool);
+AddNodePtr addAddNode(const std::shared_ptr<ModelAPI_Document> &thePart,
+                      const ModelHighAPI_Selection &theMainObject,
+                      const ModelHighAPI_Selection &theTool,
+                      const ModelHighAPI_Double &theDx,
+                      const ModelHighAPI_Double &theDy,
+                      const ModelHighAPI_Double &theDz);
 
 #endif // OPERAAPI_ADDNODE_H_