From 7b2dc1199c516dc96e60f8b632e4097387030064 Mon Sep 17 00:00:00 2001 From: Nicolas RECHATIN Date: Mon, 2 Oct 2023 10:50:26 +0200 Subject: [PATCH] fix : Fix python dump with translation --- src/OperaAPI/OperaAPI_AddNode.cpp | 32 ++++++++++++++++++++++--------- src/OperaAPI/OperaAPI_AddNode.h | 19 ++++++++++++------ 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/src/OperaAPI/OperaAPI_AddNode.cpp b/src/OperaAPI/OperaAPI_AddNode.cpp index 74d578de9..68ee9cdf0 100644 --- a/src/OperaAPI/OperaAPI_AddNode.cpp +++ b/src/OperaAPI/OperaAPI_AddNode.cpp @@ -30,14 +30,20 @@ OperaAPI_AddNode::OperaAPI_AddNode(const std::shared_ptr& theF //================================================================================================== -OperaAPI_AddNode::OperaAPI_AddNode(const std::shared_ptr& theFeature, - const ModelHighAPI_Selection& theMainObject, - const ModelHighAPI_Selection& theTool) - : ModelHighAPI_Interface(theFeature) +OperaAPI_AddNode::OperaAPI_AddNode(const std::shared_ptr &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& thePart, - const ModelHighAPI_Selection& theMainObject, - const ModelHighAPI_Selection& theTool) +AddNodePtr addAddNode(const std::shared_ptr &thePart, + const ModelHighAPI_Selection &theMainObject, + const ModelHighAPI_Selection &theTool, + const ModelHighAPI_Double &theDx, + const ModelHighAPI_Double &theDy, + const ModelHighAPI_Double &theDz) { std::shared_ptr 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)); } diff --git a/src/OperaAPI/OperaAPI_AddNode.h b/src/OperaAPI/OperaAPI_AddNode.h index 6eda7dee6..c03cd25f6 100644 --- a/src/OperaAPI/OperaAPI_AddNode.h +++ b/src/OperaAPI/OperaAPI_AddNode.h @@ -26,6 +26,7 @@ #include #include +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& theFeature, - const ModelHighAPI_Selection& theMainObject, - const ModelHighAPI_Selection& theTool); + explicit OperaAPI_AddNode(const std::shared_ptr &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 AddNodePtr; /// \ingroup CPPHighAPI /// \brief Create Volume feature. OPERAAPI_EXPORT -AddNodePtr addAddNode(const std::shared_ptr& thePart, - const ModelHighAPI_Selection& theMainObject, - const ModelHighAPI_Selection& theTool); +AddNodePtr addAddNode(const std::shared_ptr &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_ -- 2.39.2