From 8c1cfc61c90fe2c964bcb75202e1685aa3553710 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 30 Jan 2014 10:01:48 +0000 Subject: [PATCH] Add methods to assign curve to specific axes. --- src/SALOME_PYQT/SalomePyQt/SalomePyQt.h | 6 +++++ src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip | 27 ++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h index 9df13706c..853d5b22a 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h @@ -136,6 +136,12 @@ enum VisibilityState UnpresentableState //!< Unpresentable object }; +enum Axis { + yLeft = QwtPlot::yLeft, + yRight = QwtPlot::yRight, + xBottom = QwtPlot::xBottom, + xTop = QwtPlot::xTop, +}; class SalomePyQt { diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip index 136881846..553e6c74d 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip @@ -101,6 +101,13 @@ enum Action { SplitAt = 2 }; +enum Axis { + yLeft, + yRight, + xBottom, + xTop, +}; + class QtxAction : QWidgetAction { %TypeHeaderCode @@ -232,7 +239,7 @@ public: int ny = PyList_Size(a1); if( nx != ny ) { - PyErr_Format(PyExc_TypeError,"The dimention of x and y should be the same. It is %d and %d currently.", nx, ny); + PyErr_Format(PyExc_TypeError,"The dimension of x and y should be the same. It is %d and %d currently.", nx, ny); } int i; @@ -249,6 +256,24 @@ public: void insertPoint( int, double, double ); void deletePoint( int ); void clearAllPoints(); + void setXAxis( Axis ); +%MethodCode + int ax = int(a0); + sipCpp->setXAxis(QwtPlot::Axis(ax)); +%End + Axis getXAxis() const; +%MethodCode + sipRes = Axis(sipCpp->getXAxis()); +%End + void setYAxis( Axis ); +%MethodCode + int ay = int(a0); + sipCpp->setYAxis(QwtPlot::Axis(ay)); +%End + Axis getYAxis() const; +%MethodCode + sipRes = Axis(sipCpp->getYAxis()); +%End }; enum VisibilityState -- 2.39.2