From c0eecf1ac03b840bac43152ef4cc51b6f77013b3 Mon Sep 17 00:00:00 2001 From: jh777916 Date: Wed, 25 Oct 2023 10:06:31 +0200 Subject: [PATCH] Adding the SetX/YSciNotation() interfaced method to the cpp library --- tools/CurvePlot/src/cpp/CurvePlot.cxx | 20 ++++++++++++++++++++ tools/CurvePlot/src/cpp/CurvePlot.hxx | 4 ++++ 2 files changed, 24 insertions(+) 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); -- 2.39.2