From: jh777916 Date: Wed, 25 Oct 2023 08:06:31 +0000 (+0200) Subject: Adding the SetX/YSciNotation() interfaced method to the cpp library X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c0eecf1ac03b840bac43152ef4cc51b6f77013b3;p=modules%2Fgui.git Adding the SetX/YSciNotation() interfaced method to the cpp library --- diff --git a/tools/CurvePlot/src/cpp/CurvePlot.cxx b/tools/CurvePlot/src/cpp/CurvePlot.cxx index 4c90126eb..29a4971d0 100644 --- a/tools/CurvePlot/src/cpp/CurvePlot.cxx +++ b/tools/CurvePlot/src/cpp/CurvePlot.cxx @@ -508,6 +508,26 @@ namespace CURVEPLOT return ((PyObject *)ret == Py_True); } + void CurvePlot::SetXSciNotation(PlotID plot_set_id, bool sci_notation) + { + PyLockWrapper lock; + PyObject * cont = GetInstance()->_impl->_controller; + + PyObjWrapper ret( + PyObject_CallMethod(cont, (char *)"SetXSciNotation", (char *)"ii", plot_set_id, sci_notation ? 1 : 0)); + HandleAndPrintPyError("CurvePlot::SetXSciNotation(): unexpected error!"); + } + + void CurvePlot::SetYSciNotation(PlotID plot_set_id, bool sci_notation) + { + PyLockWrapper lock; + PyObject * cont = GetInstance()->_impl->_controller; + + PyObjWrapper ret( + PyObject_CallMethod(cont, (char *)"SetYSciNotation", (char *)"ii", plot_set_id, sci_notation ? 1 : 0)); + HandleAndPrintPyError("CurvePlot::SetYSciNotation(): unexpected error!"); + } + int CurvePlot::GetSalomeViewID(PlotID plot_set_id) { PyLockWrapper lock; diff --git a/tools/CurvePlot/src/cpp/CurvePlot.hxx b/tools/CurvePlot/src/cpp/CurvePlot.hxx index 4b43c7c79..ed8beb14a 100644 --- a/tools/CurvePlot/src/cpp/CurvePlot.hxx +++ b/tools/CurvePlot/src/cpp/CurvePlot.hxx @@ -138,6 +138,10 @@ namespace CURVEPLOT static CurvePlot * GetInstance(bool test_mode=false); + static void SetXSciNotation(PlotID plot_set_id, bool sci_notation=true); + + static void SetYSciNotation(PlotID plot_set_id, bool sci_notation=true); + /**! Temporary ... */ static void OnSalomeViewTryClose(int salome_view_id);