]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Adding SetLegendVisible method to the cpp library
authorjh777916 <juba.hamma@cea.fr>
Tue, 3 Oct 2023 12:47:18 +0000 (14:47 +0200)
committerjh777916 <juba.hamma@cea.fr>
Tue, 3 Oct 2023 12:47:46 +0000 (14:47 +0200)
tools/CurvePlot/src/cpp/CurvePlot.cxx
tools/CurvePlot/src/cpp/CurvePlot.hxx

index 0a1f20ecb206bef3b0b08f778de7b76446b7148e..4c90126eb2bc8f10ed48edeb91fa387cad7af0a3 100644 (file)
@@ -487,6 +487,16 @@ namespace CURVEPLOT
     HandleAndPrintPyError("CurvePlot::SetCurrentPlotSet(): unexpected error!");
   }
 
+  void CurvePlot::SetLegendVisible(PlotID plot_set_id, bool visible)
+  {
+    PyLockWrapper lock;
+    PyObject * cont = GetInstance()->_impl->_controller;
+
+    PyObjWrapper ret(
+          PyObject_CallMethod(cont, (char *)"SetLegendVisible", (char *)"ii", plot_set_id, visible ? 1 : 0));
+    HandleAndPrintPyError("CurvePlot::SetLegendVisible(): unexpected error!");
+  }
+
   bool CurvePlot::IsValidPlotSetID(PlotID plot_set_id)
   {
     PyLockWrapper lock;
index d59b9f96133f776b4914ab055f83871c992c3b9e..4b43c7c79bab514a2deb54d31fb39e02275e00d6 100644 (file)
@@ -130,6 +130,8 @@ namespace CURVEPLOT
 
     static void ToggleCurveBrowser(bool with_curve_browser);
 
+    static void SetLegendVisible(PlotID plot_set_id, bool visible=true);
+
     static bool IsValidPlotSetID(PlotID plot_set_id=-1);
 
     static int GetSalomeViewID(PlotID plot_set_id);