Salome HOME
Add methods to assign curve to specific axes.
authorvsr <vsr@opencascade.com>
Thu, 30 Jan 2014 10:01:48 +0000 (10:01 +0000)
committervsr <vsr@opencascade.com>
Thu, 30 Jan 2014 10:01:48 +0000 (10:01 +0000)
src/SALOME_PYQT/SalomePyQt/SalomePyQt.h
src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip

index 9df13706c52fb4f40339db26e317fb063e6c6429..853d5b22ac5414913acee5030d56463d66c0bca1 100644 (file)
@@ -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
 {
index 136881846bcb1ee534134276ba01734537645ae1..553e6c74d9f12e18536d92a9865153b80313c3dd 100644 (file)
@@ -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