X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FBuildPlugin%2FBuildPlugin_Interpolation.h;h=83175f115ff73d538680e007c3bd4671d4bc45e4;hb=f2f6562ee02fabf58c922eef97849b6182ff0044;hp=bdf6df0206b905e37ecb6121c847d83e21244720;hpb=7318a07336a28c7b95703b15672e4a43df03dabb;p=modules%2Fshaper.git diff --git a/src/BuildPlugin/BuildPlugin_Interpolation.h b/src/BuildPlugin/BuildPlugin_Interpolation.h index bdf6df020..83175f115 100644 --- a/src/BuildPlugin/BuildPlugin_Interpolation.h +++ b/src/BuildPlugin/BuildPlugin_Interpolation.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2021 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef BuildPlugin_Interpolation_H_ @@ -41,6 +40,27 @@ public: return MY_ID; } + /// Attribute name of creation method. + inline static const std::string& CREATION_METHOD_ID() + { + static const std::string MY_CREATION_METHOD_ID("interpolation_method"); + return MY_CREATION_METHOD_ID; + } + + /// Attribute name of creation method by selection + inline static const std::string& CREATION_METHOD_BY_SELECTION_ID() + { + static const std::string MY_CREATION_METHOD_BY_SELECTION_ID("by_selection"); + return MY_CREATION_METHOD_BY_SELECTION_ID; + } + + /// Attribute name of creation method analytical + inline static const std::string& CREATION_METHOD_ANALYTICAL_ID() + { + static const std::string MY_CREATION_METHOD_ANALYTICAL_ID("analytical"); + return MY_CREATION_METHOD_ANALYTICAL_ID; + } + /// Attribute name of base objects. inline static const std::string& BASE_OBJECTS_ID() { @@ -83,9 +103,79 @@ public: return MY_TANGENT_END_ID; } + /// Attribute name of x(t) equation. + inline static const std::string& XT_ID() + { + static const std::string MY_XT_ID("xt"); + return MY_XT_ID; + } + + /// Attribute name of y(t) equation. + inline static const std::string& YT_ID() + { + static const std::string MY_YT_ID("yt"); + return MY_YT_ID; + } + + /// Attribute name of z(t) equation. + inline static const std::string& ZT_ID() + { + static const std::string MY_ZT_ID("zt"); + return MY_ZT_ID; + } + + /// Attribute name of min t. + inline static const std::string& MINT_ID() + { + static const std::string MY_MINT_ID("mint"); + return MY_MINT_ID; + } + + /// Attribute name of max t. + inline static const std::string& MAXT_ID() + { + static const std::string MY_MAXT_ID("maxt"); + return MY_MAXT_ID; + } + + /// Attribute of parameter name of variable + inline static const std::string& VARIABLE_ID() + { + static const std::string MY_VARIABLE_ID("variable"); + return MY_VARIABLE_ID; + } + + /// Attribute of parameter name of value + inline static const std::string& VALUE_ID() + { + static const std::string MY_VALUE_ID("value"); + return MY_VALUE_ID; + } + + /// Attribute of parameter expression error + inline static const std::string& EXPRESSION_ERROR_ID() + { + static const std::string MY_EXPRESSION_ERROR_ID("ExpressionError"); + return MY_EXPRESSION_ERROR_ID; + } + + /// Attribute name of number of steps + inline static const std::string& NUMSTEP_ID() + { + static const std::string MY_NUMSTEP_ID("numstep"); + return MY_NUMSTEP_ID; + } + /// Default value of the closed attribute inline static bool CLOSED_DEFAULT() { return false; } + /// List of references to the arguments of this expression + inline static const std::string& ARGUMENTS_ID() + { + static const std::string MY_ARGUMENTS_ID("arguments"); + return MY_ARGUMENTS_ID; + } + /// \return the kind of a feature. BUILDPLUGIN_EXPORT virtual const std::string& getKind() { @@ -98,6 +188,21 @@ public: /// Creates a new part document if needed. BUILDPLUGIN_EXPORT virtual void execute(); + + /// Called on change of any argument-attribute of this object. + /// \param[in] theID identifier of changed attribute. + BUILDPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID); + + protected: + /// Evaluates the expression x(t), y(t),z(t) in value table. + void evaluate(std::string& theError); + + /// Update coordinates x,y,z + void updateCoordinates(); + + /// Output error for python interpreter + std::string outErrorMessage; + }; #endif