pyqwt5-5.2.1~cvs20091107+dfsg/0000755000175000017500000000000011275562661013656 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/COPYING.GSE0000444000175000017500000000201510720075721015310 0ustar poxpoxThis is an exceptional PyQwt license agreement between Gerard Vermeulen (licensor) 4 rue Commandant Rozan 38000 Grenoble France and GSE Software, Inc. (licensee) 60121 Stirling Dr. Bend, OR USA. PyQwt is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PyQwt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PyQwt; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, Gerard Vermeulen permits GSE Software, Inc. to modify PyQwt, to link PyQwt statically into proprietary software, and to distribute PyQwt in this form. pyqwt5-5.2.1~cvs20091107+dfsg/CHANGES-5.0.00000444000175000017500000000107510606755173015307 0ustar poxpoxBug fixes with with respect to PyQwt5-20061017: - wrap QwtPlotMagnifier. - add an event filter to track the mouse coordinates in the status bar of the IPlot widget of the qplt module. - translate the symbols properly when cloning a QwtPlot to grace in qplt.py. - patch the code generated by SIP to make typedefs work in Qt signals. - fix the virtual copy constructor in QwtScaleTransformation. - handle dynamic linking of Qwt on Windows. - documentation fixes. New features with respect to PyQwt5-20061017: - based on Qwt SVN revision 81. - install programs for Windows.pyqwt5-5.2.1~cvs20091107+dfsg/setup.py0000444000175000017500000000170511264102457015360 0ustar poxpox #!/usr/bin/env python from distutils.core import setup import time name = 'PyQwt' version = '5.2.1' #version = '%04d%02d%02d' % (time.localtime()[:3]) long_description = """ PyQwt is a set of Python bindings for the Qwt C++ class library which extends the Qt framework with widgets for scientific, engineering, and scientific applications. It provides a widget to plot data points in two dimensions and various widgets to display and control bounded or unbounded floating point values. """ setup( name = name, version = version, description = "Python bindings for the Qwt library", url = "http://pyqwt.sourceforge.net", author = "Gerard Vermeulen", author_email = "gerard.vermeulen@grenoble.cnrs.fr", license = "GPL", long_description = long_description, platforms = "Unix, Windows, Mac OS X", ) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/COPYING.INTES0000444000175000017500000000202011074364325015554 0ustar poxpoxThis is an exceptional PyQwt license agreement between Gerard Vermeulen (licensor) 4 rue Commandant Rozan 38000 Grenoble France and INTES GmbH (licensee) Schulze-Delitzsch-Str. 16, 70565 Stuttgart, Germany PyQwt is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PyQwt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PyQwt; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, Gerard Vermeulen permits INTES GmbH to modify PyQwt, to link PyQwt statically into proprietary software, and to distribute PyQwt in this form. pyqwt5-5.2.1~cvs20091107+dfsg/GNUmakefile0000444000175000017500000000664411264102405015720 0ustar poxpox# GNUmakefile for PyQwt # # There are at least two options to log the output of make: # # (1) Invoke make and tie stderr to stdout and redirect stdout to log.txt: # make all 2&>1 >log.txt # However, you do not see what is going on. # # (2) Use script to capture all screen output of make to log.txt: # script -c 'make all' log.txt # The script command appeared in 3.0BSD and is part of util-linux. # To compile and link the Qwt sources statically into Pyqwt. QWT := ../qwt-5.2 JOBS := 1 UNAME := $(shell uname) REVISION := 596 ifeq ($(UNAME),Linux) JOBS := $(shell getconf _NPROCESSORS_ONLN) endif ifeq ($(UNAME),Darwin) JOBS := $(shell sysctl -n hw.ncpu) endif .PHONY: dist qwt-5.0 qwt-5.1 qwt-5.2 all: 3 4 debug: 3d 4d trace: 3t 4t 3: cd configure \ && python configure.py -3 -Q $(QWT) -j $(JOBS) \ && $(MAKE) -j $(JOBS) 4: cd configure \ && python configure.py -4 -Q $(QWT) -j $(JOBS) \ && $(MAKE) -j $(JOBS) 3d: cd configure \ && python configure.py -3 --debug -Q $(QWT) -j $(JOBS) \ && $(MAKE) -j $(JOBS) 4d: cd configure \ && python configure.py -4 --debug -Q $(QWT) -j $(JOBS) \ && $(MAKE) -j $(JOBS) 3t: cd configure \ && python configure.py --debug --trace -3 -Q $(QWT) \ && $(MAKE) 4t: cd configure \ && python configure.py --debug --trace -4 -Q $(QWT) \ && $(MAKE) # Installation install-3: 3 make -C configure install install-4: 4 make -C configure install install: install-3 install-4 install-3d: 3d make -C configure install install-4d: 4d make -C configure install install-debug: install-3d install-4d install-3t: 3t make -C configure install install-4t: 4t make -C configure install install-trace: install-3t install-4t # SVN qwt-5.0: (cd tmp/qwt-5.0; svn up -r $(REVISION)) rm -rf old-5.0; mv qwt-5.0 old-5.0 rm -rf qwt-5.0; cp -pr tmp/qwt-5.0 qwt-5.0 python untabify.py -t 4 qwt-5.0 .cpp .h .pro patch -p0 --fuzz=10 -b -z .pyqwt #if defined(Q_OS_WIN32) #include #include #else #include #endif // copy the idea of Michiel de Hoon from PyQt-x11-gpl-4.3. static int iqt_input_hook(void) { QApplication *a = qApp; if (a) { #if defined(Q_OS_WIN32) QTimer timer; QObject::connect(&timer, SIGNAL(timeout()), a, SLOT(quit())); do { timer.start(100); a->exec(); timer.stop(); } while (!_kbhit()); QObject::disconnect(&timer, SIGNAL(timeout()), a, SLOT(quit())); #else #if HAVE_LIBREADLINE a->processEvents(); #else QSocketNotifier notifier(0, QSocketNotifier::Read, 0); QObject::connect(¬ifier, SIGNAL(activated(int)), a, SLOT(quit())); a->exec(); QObject::disconnect(¬ifier, SIGNAL(activated(int)), a, SLOT(quit())); #endif // HAVE_LIBREADLINE #endif // defined(Q_OS_WIN32) } return 0; } %End // ModuleCode %PostInitialisationCode PyOS_InputHook = iqt_input_hook; %End // PostInitialisationCode // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/iqt5qt4/0000755000175000017500000000000011275562661015764 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/sip/iqt5qt4/IQtModule.sip0000444000175000017500000000504410651711714020335 0ustar poxpox// The SIP interface definition for the _iqt module of PyQwt. // // Copyright (C) 2001-2007 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %Module PyQt4.Qwt5._iqt 0 %ModuleCode #include #if defined(Q_OS_WIN32) #include #include #else #include #endif // copy the idea of Michiel de Hoon from PyQt-x11-gpl-4.3. static int iqt_input_hook(void) { QCoreApplication *a = QCoreApplication::instance(); if (a) { #if defined(Q_OS_WIN32) QTimer timer; QObject::connect(&timer, SIGNAL(timeout()), a, SLOT(quit())); do { timer.start(100); QCoreApplication::exec(); timer.stop(); } while (!_kbhit()); QObject::disconnect(&timer, SIGNAL(timeout()), a, SLOT(quit())); #else #if HAVE_LIBREADLINE a->processEvents(); #else QSocketNotifier notifier(0, QSocketNotifier::Read, 0); QObject::connect(¬ifier, SIGNAL(activated(int)), a, SLOT(quit())); QCoreApplication::exec(); QObject::disconnect(¬ifier, SIGNAL(activated(int)), a, SLOT(quit())); #endif // HAVE_LIBREADLINE #endif // defined(Q_OS_WIN32) } return 0; } %End // ModuleCode %PostInitialisationCode PyOS_InputHook = iqt_input_hook; %End // PostInitialisationCode // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/0000755000175000017500000000000011275562661016001 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_canvas.sip0000444000175000017500000001136711172321327021714 0ustar poxpox// The SIP interface specification for: // QwtPlotCanvas. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlotCanvas: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum PaintAttribute { PaintCached, PaintPacked }; // enum PaintAttribute enum FocusIndicator { NoFocusIndicator, CanvasFocusIndicator, ItemFocusIndicator }; // enum FocusIndicator void setFocusIndicator(QwtPlotCanvas::FocusIndicator); QwtPlotCanvas::FocusIndicator focusIndicator() const; void setPaintAttribute(QwtPlotCanvas::PaintAttribute, bool = true); bool testPaintAttribute(QwtPlotCanvas::PaintAttribute) const; QPixmap* paintCache(); // signature: const QPixmap* paintCache() const; void invalidatePaintCache(); protected: QwtPlotCanvas(QwtPlot* /TransferThis/); virtual ~QwtPlotCanvas(); virtual void hideEvent(QHideEvent*); virtual void paintEvent(QPaintEvent*); virtual void drawContents(QPainter*); virtual void drawFocusIndicator(QPainter*); void drawCanvas(QPainter* = 0); }; // class QwtPlotCanvas %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - Qwt_5_2_0) class QwtPlotCanvas: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum PaintAttribute { PaintCached, PaintPacked }; // enum PaintAttribute enum FocusIndicator { NoFocusIndicator, CanvasFocusIndicator, ItemFocusIndicator }; // enum FocusIndicator QwtPlotCanvas(QwtPlot* /TransferThis/); virtual ~QwtPlotCanvas(); QwtPlot* plot(); // signature: const QwtPlot* plot() const; void setFocusIndicator(QwtPlotCanvas::FocusIndicator); QwtPlotCanvas::FocusIndicator focusIndicator() const; void setPaintAttribute(QwtPlotCanvas::PaintAttribute, bool = true); bool testPaintAttribute(QwtPlotCanvas::PaintAttribute) const; QPixmap* paintCache(); // signature: const QPixmap* paintCache() const; void invalidatePaintCache(); protected: virtual void hideEvent(QHideEvent*); virtual void paintEvent(QPaintEvent*); virtual void drawContents(QPainter*); virtual void drawFocusIndicator(QPainter*); void drawCanvas(QPainter* = 0); }; // class QwtPlotCanvas %End // (Qwt_5_1_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtPlotCanvas: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum PaintAttribute { PaintCached, PaintPacked }; // enum PaintAttribute enum FocusIndicator { NoFocusIndicator, CanvasFocusIndicator, ItemFocusIndicator }; // enum FocusIndicator QwtPlotCanvas(QwtPlot* /TransferThis/); virtual ~QwtPlotCanvas(); QwtPlot* plot(); // signature: const QwtPlot* plot() const; void setFocusIndicator(QwtPlotCanvas::FocusIndicator); QwtPlotCanvas::FocusIndicator focusIndicator() const; void setPaintAttribute(QwtPlotCanvas::PaintAttribute, bool = true); bool testPaintAttribute(QwtPlotCanvas::PaintAttribute) const; QPixmap* paintCache(); // signature: const QPixmap* paintCache() const; void invalidatePaintCache(); void replot(); protected: virtual void hideEvent(QHideEvent*); virtual void paintEvent(QPaintEvent*); virtual void drawContents(QPainter*); virtual void drawFocusIndicator(QPainter*); void drawCanvas(QPainter* = 0); }; // class QwtPlotCanvas %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_text.sip0000444000175000017500000000647711130210270020361 0ustar poxpox// The SIP interface specification for: // QwtText. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtText { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum TextFormat { AutoText, PlainText, RichText, MathMLText, TeXText, OtherFormat }; // enum TextFormat enum PaintAttribute { PaintUsingTextFont, PaintUsingTextColor, PaintBackground }; // enum PaintAttribute enum LayoutAttribute { MinimumLayout }; // enum LayoutAttribute QwtText(const QString& = QString::null, QwtText::TextFormat = QwtText::AutoText); QwtText(const QwtText&); ~QwtText(); // Not Pythonic: QwtText& operator=(const QwtText&); int operator==(const QwtText&) const; int operator!=(const QwtText&) const; void setText(const QString&, QwtText::TextFormat = QwtText::AutoText); QString text() const; bool isNull() const; bool isEmpty() const; void setFont(const QFont&); QFont font() const; QFont usedFont(const QFont&) const; void setRenderFlags(int); int renderFlags() const; void setColor(const QColor&); QColor color() const; QColor usedColor(const QColor&) const; void setBackgroundPen(const QPen&); QPen backgroundPen() const; void setBackgroundBrush(const QBrush&); QBrush backgroundBrush() const; void setPaintAttribute(QwtText::PaintAttribute, bool = true); bool testPaintAttribute(QwtText::PaintAttribute) const; void setLayoutAttribute(QwtText::LayoutAttribute, bool = true); bool testLayoutAttribute(QwtText::LayoutAttribute) const; int heightForWidth(int, const QFont& = QFont()) const; QSize textSize(const QFont& = QFont()) const; void draw(QPainter*, const QRect&) const; static const QwtTextEngine* textEngine(const QString&, QwtText::TextFormat = QwtText::AutoText); static const QwtTextEngine* textEngine(QwtText::TextFormat); static void setTextEngine(QwtText::TextFormat, QwtTextEngine*); }; // class QwtText // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_panner.sip0000444000175000017500000000667111130210270020654 0ustar poxpox// The SIP interface specification for: // QwtPanner. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPanner: QWidget { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPanner(QWidget* /TransferThis/); virtual ~QwtPanner(); virtual void setEnabled(bool); bool isEnabled() const; void setMouseButton(int, int = Qt::NoButton); void getMouseButton(int&, int&) const; void setAbortKey(int, int = Qt::NoButton); void getAbortKey(int&, int&) const; virtual void setCursor(const QCursor&); const QCursor cursor() const; virtual bool eventFilter(QObject*, QEvent*); signals: void panned(int, int); void moved(int, int); protected: virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); virtual void paintEvent(QPaintEvent*); }; // class QwtPanner %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPanner: QWidget { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPanner(QWidget* /TransferThis/); virtual ~QwtPanner(); virtual void setEnabled(bool); bool isEnabled() const; void setMouseButton(int, int = Qt::NoButton); void getMouseButton(int&, int&) const; void setAbortKey(int, int = Qt::NoButton); void getAbortKey(int&, int&) const; virtual void setCursor(const QCursor&); const QCursor cursor() const; void enableOrientation(Qt::Orientation, bool); bool isOrientationEnabled(Qt::Orientation) const; virtual bool eventFilter(QObject*, QEvent*); signals: void panned(int, int); void moved(int, int); protected: virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); virtual void paintEvent(QPaintEvent*); }; // class QwtPanner %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_dial_needle.sip0000444000175000017500000001014111130210270021601 0ustar poxpox// The SIP interface specification for: // QwtCompassMagnetNeedle, // QwtCompassWindArrow, // QwtDialNeedle, // QwtDialSimpleNeedle. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtCompassMagnetNeedle: QwtDialNeedle { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Style { TriangleStyle, ThinStyle }; // enum Style QwtCompassMagnetNeedle(QwtCompassMagnetNeedle::Style = TriangleStyle, const QColor& = Qt::white, const QColor& = Qt::red); virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const; static void drawTriangleNeedle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, double); static void drawThinNeedle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, double); protected: static void drawPointer(QPainter*, const QBrush&, int, const QPoint&, int, int, double); }; // class QwtCompassMagnetNeedle class QwtCompassWindArrow: QwtDialNeedle { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Style { Style1, Style2 }; // enum Style QwtCompassWindArrow(QwtCompassWindArrow::Style, const QColor& = Qt::white, const QColor& = Qt::gray); virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const; static void drawStyle1Needle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, double); static void drawStyle2Needle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, double); }; // class QwtCompassWindArrow class QwtDialNeedle { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDialNeedle(); virtual ~QwtDialNeedle(); virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const = 0; virtual void setPalette(const QPalette&); const QPalette& palette() const; protected: static void drawKnob(QPainter*, const QPoint&, int, const QBrush&, bool); }; // class QwtDialNeedle class QwtDialSimpleNeedle: QwtDialNeedle { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Style { Arrow, Ray }; // enum Style QwtDialSimpleNeedle(QwtDialSimpleNeedle::Style, bool = true, const QColor& = Qt::gray, const QColor& = Qt::darkGray); virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const; static void drawArrowNeedle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, int, double, bool); static void drawRayNeedle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, int, double, bool); void setWidth(int); int width() const; }; // class QwtDialSimpleNeedle // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_analog_clock.sip0000444000175000017500000000457311130210270022004 0ustar poxpox// The SIP interface specification for: // QwtAnalogClock. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtAnalogClock: QwtDial { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Hand { SecondHand, MinuteHand, HourHand, NHands }; // enum Hand QwtAnalogClock(QWidget* /TransferThis/ = 0); QwtAnalogClock(QWidget*, const char*); virtual ~QwtAnalogClock(); virtual void setHand(QwtAnalogClock::Hand, QwtDialNeedle* /Transfer/); // signature: const QwtDialNeedle* hand(QwtAnalogClock::Hand) const; QwtDialNeedle* hand(QwtAnalogClock::Hand); public slots: void setCurrentTime(); void setTime(const QTime& = QTime::currentTime()); protected: virtual QwtText scaleLabel(double) const; virtual void drawNeedle(QPainter*, const QPoint&, int, double, QPalette::ColorGroup) const; virtual void drawHand(QPainter*, QwtAnalogClock::Hand, const QPoint&, int, double, QPalette::ColorGroup) const; private: virtual void setNeedle(QwtDialNeedle* /Transfer/); }; // class QwtAnalogClock // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_event_pattern.sip0000444000175000017500000000661211130210270022242 0ustar poxpox// The SIP interface specification for: // QwtEventPattern. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtEventPattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum MousePatternCode { MouseSelect1, MouseSelect2, MouseSelect3, MouseSelect4, MouseSelect5, MouseSelect6, MousePatternCount }; // enum MousePatternCode enum KeyPatternCode { KeySelect1, KeySelect2, KeyAbort, KeyLeft, KeyRight, KeyUp, KeyDown, KeyRedo, KeyUndo, KeyHome, KeyPatternCount }; // enum KeyPatternCode class MousePattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: int button; int state; MousePattern(int = Qt::NoButton, int = Qt::NoButton); }; // class MousePattern class KeyPattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: int key; int state; KeyPattern(int = 0, int = Qt::NoButton); }; // class KeyPattern QwtEventPattern(); virtual ~QwtEventPattern(); void initMousePattern(int); void initKeyPattern(); void setMousePattern(uint, int, int = Qt::NoButton); void setKeyPattern(uint, int, int = Qt::NoButton); void setMousePattern(const QMemArray&); void setKeyPattern(const QMemArray&); // signature: const QMemArray& mousePattern() const; // signature: const QMemArray& keyPattern() const; QMemArray& mousePattern(); QMemArray& keyPattern(); bool mouseMatch(uint, const QMouseEvent*) const; bool keyMatch(uint, const QKeyEvent*) const; protected: virtual bool mouseMatch(const QwtEventPattern::MousePattern&, const QMouseEvent*) const; virtual bool keyMatch(const QwtEventPattern::KeyPattern&, const QKeyEvent*) const; }; // class QwtEventPattern // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/common/0000755000175000017500000000000011275562661017271 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/common/QwtMap.sip0000444000175000017500000000771311163711320021205 0ustar poxpox// The SIP interface specification for: // QMap. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %MappedType QMap { %TypeHeaderCode #include %End %ConvertFromTypeCode PyObject *d = PyDict_New(); if (!d) return d; QMap::const_iterator i = sipCpp->constBegin(); while (i != sipCpp->constEnd()) { QString *t = new QString(i.data()); PyObject *kobj = PyFloat_FromDouble(i.key()); #if SIP_VERSION < 0x040800 PyObject *tobj = sipConvertFromNewInstance( t, sipClass_QString, sipTransferObj); #else PyObject *tobj = sipConvertFromNewType( t, sipType_QString, sipTransferObj); #endif if ((0 == kobj) || (0 == tobj) || (0 > PyDict_SetItem(d, kobj, tobj))) { Py_DECREF(d); if (kobj) Py_DECREF(kobj); if (tobj) Py_DECREF(tobj); else delete t; return 0; } Py_DECREF(kobj); Py_DECREF(tobj); ++i; } return d; %End // ConvertFromTypeCode %ConvertToTypeCode PyObject *kobj, *tobj; SIP_SSIZE_T i = 0; if (0 == sipIsErr) { if (!PyDict_Check(sipPy)) return 0; while (PyDict_Next(sipPy, &i, &kobj, &tobj)) #if SIP_VERSION < 0x040800 if (!sipCanConvertToInstance(tobj, sipClass_QString, SIP_NOT_NONE)) #else if (!sipCanConvertToType(tobj, sipType_QString, SIP_NOT_NONE)) #endif return 0; return 1; } QMap *qm = new QMap; while (PyDict_Next(sipPy, &i, &kobj, &tobj)) { int state; double k = PyFloat_AS_DOUBLE(kobj); #if SIP_VERSION < 0x040800 QString *t = reinterpret_cast( sipConvertToInstance(tobj, sipClass_QString, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); #else QString *t = reinterpret_cast( sipConvertToType(tobj, sipType_QString, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); #endif if (*sipIsErr) { #if SIP_VERSION < 0x040800 sipReleaseInstance(t, sipClass_QString, state); #else sipReleaseType(t, sipType_QString, state); #endif delete qm; return 0; } qm->insert(k, *t); #if SIP_VERSION < 0x040800 sipReleaseInstance(t, sipClass_QString, state); #else sipReleaseType(t, sipType_QString, state); #endif } *sipCppPtr = qm; return sipGetState(sipTransferObj); %End // ConvertToTypeCode }; // QMap // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/common/QwtValueStack.sip0000444000175000017500000000620211130210270022512 0ustar poxpox// The SIP interface specification for: // QValueStack. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. // QValueStack is implemented as a Python list. template %MappedType QValueStack { %TypeHeaderCode #include %End %ConvertFromTypeCode // Create the list. PyObject *l = PyList_New(sipCpp->size()); if (!l) return 0; // Set the list elements. int i = 0; QValueListConstIterator it; for (it = sipCpp->begin(); it != sipCpp->end(); ++it) { PyObject *o; if (0 == (o = sipConvertFromInstance(new Type(*it), sipClass_Type, sipTransferObj)) || 0 > PyList_SetItem(l, i, o)) { Py_XDECREF(o); Py_DECREF(l); return 0; } ++i; } return l; %End %ConvertToTypeCode // Type checking if only that is required. if (!sipIsErr) { if (!PyList_Check(sipPy)) return 0; // check elements for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_Type, 0)) return 0; return 1; } // Return the QValueStack. QValueStack *s = new QValueStack; for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) { int iserr = 0, state; Type *t = reinterpret_cast(sipConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_Type, 0, SIP_NOT_NONE, &state, &iserr)); if (iserr) { sipReleaseInstance(t, sipClass_Type, state); *sipIsErr = 1; delete s; return 0; } s->append(*t); sipReleaseInstance(t, sipClass_Type, state); } *sipCppPtr = s; return sipGetState(sipTransferObj); %End }; // template %MappedType QValueStack // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/common/QwtValueList.sip0000444000175000017500000001413011274627067022410 0ustar poxpox// The SIP interface definition for: // QValueList, // QValueList, // QwtValueList. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. // QValueList is implemented as a Python list. %MappedType QValueList { %TypeHeaderCode #include %End %ConvertFromTypeCode // Create the list. PyObject *l = PyList_New(sipCpp->size()); if (0 == l) return 0; // Set the list elements. for (int i = 0; i < int(sipCpp->size()); ++i) { QwtPickerMachine::Command *t = new QwtPickerMachine::Command((*sipCpp)[i]); PyObject *tobj = sipConvertFromNewType(t, sipType_QwtPickerMachine_Command, sipTransferObj); if (0 == tobj) { Py_DECREF(l); delete t; return 0; } PyList_SET_ITEM(l, i, tobj); } return l; %End %ConvertToTypeCode SIP_SSIZE_T size; // Check the type if that is all that is required. if (0 == sipIsErr) { if (!PySequence_Check(sipPy) || 0 > (size = PySequence_Size(sipPy))) return 0; for (SIP_SSIZE_T i = 0; i < size; ++i) { PyObject *item = PySequence_ITEM(sipPy, i); bool ok = (item && sipCanConvertToType(item, sipType_QwtPickerMachine_Command, SIP_NOT_NONE)); Py_XDECREF(item); if (!ok) return 0; } return 1; } QValueList *l = new QValueList; size = PySequence_Size(sipPy); for (SIP_SSIZE_T i = 0; i < size; ++i) { PyObject *item = PySequence_ITEM(sipPy, i); int state; QwtPickerMachine::Command *t = reinterpret_cast(sipConvertToType(item, sipType_QwtPickerMachine_Command, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); Py_DECREF(item); if (*sipIsErr) { sipReleaseType(t, sipType_QwtPickerMachine_Command, state); delete l; return 0; } l->append(*t); sipReleaseType(t, sipType_QwtPickerMachine_Command, state); } *sipCppPtr = l; return sipGetState(sipTransferObj); %End }; // QValueList is implemented as a Python list. template %MappedType QValueList { %TypeHeaderCode #include %End %ConvertFromTypeCode // Create the list. PyObject *l = PyList_New(sipCpp->size()); if (0 == l) return 0; // Set the list elements. for (int i = 0; i < int(sipCpp->size()); ++i) { TYPE *t = (*sipCpp)[i]; PyObject *o = sipConvertFromType(t, sipType_TYPE, sipTransferObj); if (!o) { Py_DECREF(l); return 0; } PyList_SET_ITEM(l, i, o); } return l; %End %ConvertToTypeCode SIP_SSIZE_T len; // Check the type if that is all that is required. if (0 == sipIsErr) { if (!PySequence_Check(sipPy) || 0 < (len = PySequence_Size(sipPy))) return 0; // Check the elements for (SIP_SSIZE_T i = 0; i < len; ++i) { PyObject *item = PySequence_ITEM(sipPy, i); bool ok = (item && sipCanConvertToType(item, sipType_TYPE, 0)); Py_XDECREF(item); if (!ok) return 0; } return 1; } // Return the QValueList. QValueList *l = new QValueList; len = PySequence_Size(sipPy); for (SIP_SSIZE_T i=0; i < len; ++i) { PyObject *item = PySequence_ITEM(sipPy, i); TYPE *t = reinterpret_cast(sipConvertToType(item, sipType_TYPE, sipTransferObj, 0, 0, sipIsErr)); Py_DECREF(item); if (*sipIsErr) { delete l; return 0; } l->append(t); } *sipCppPtr = l; return sipGetState(sipTransferObj); %End }; // template %MappedType QValueList %If (HAS_QWT5) %MappedType QwtValueList { %TypeHeaderCode #include %End %ConvertFromTypeCode // Create the list. PyObject *l = PyList_New(sipCpp->size()); if (0 == l) return 0; // Set the list elements. for (int i = 0; i < int(sipCpp->size()); ++i) { PyObject *o = PyFloat_FromDouble((*sipCpp)[i]); if (!o) { Py_DECREF(l); return 0; } PyList_SetItem(l, i, o); } return l; %End // %ConvertFromTypeCode %ConvertToTypeCode // Type checking if that is all that is required. if (!sipIsErr) return PyList_Check(sipPy); // Create the list. QwtValueList *l = new QwtValueList; for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) { l->append(PyFloat_AsDouble(PyList_GET_ITEM(sipPy, i))); } *sipCppPtr = l; return sipGetState(sipTransferObj); %End // %ConvertToTypeCode }; // QwtValueList %End // HAS_QWT5 // Local Variables: // mode: C++ // c-file-style: "stroustrup" // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/common/QwtMemArray.sip0000444000175000017500000000577011130210270022176 0ustar poxpox// The SIP interface definition for: // QMemArray. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. // QMemArray is implemented as a Python list. template %MappedType QMemArray { %TypeHeaderCode #include %End %ConvertFromTypeCode // Create the list. PyObject *l = PyList_New(sipCpp->size()); if (0 == l) return 0; // Set the list elements. for (int i=0; isize()); ++i) { TYPE *t = new TYPE(sipCpp->at(i)); PyObject *o = sipConvertFromNewInstance(t, sipClass_TYPE, sipTransferObj); if (0 == o) { Py_DECREF(l); delete t; return 0; } PyList_SET_ITEM(l, i, o); } return l; %End %ConvertToTypeCode // Type checking if that is all that is required. if (!sipIsErr) { if (!PyList_Check(sipPy)) return 0; // check elements for (int i=0; i < PyList_GET_SIZE(sipPy); ++i) if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, SIP_NOT_NONE)) return 0; return 1; } // Return the QMemArray QMemArray *a = new QMemArray(PyList_GET_SIZE(sipPy)); for (int i=0; i( sipConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); if (*sipIsErr) { sipReleaseInstance(t, sipClass_TYPE, state); delete a; return 0; } (*a)[i] = *t; sipReleaseInstance(t, sipClass_TYPE, state); } *sipCppPtr = a; return sipGetState(sipTransferObj); %End }; // template %MappedType QMemArray // Local Variables: // mode: C++ // c-file-style: "stroustrup" // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_marker.sip0000444000175000017500000000743011172321327021716 0ustar poxpox// The SIP interface specification for: // QwtPlotMarker. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtPlotMarker: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum LineStyle { NoLine, HLine, VLine, Cross }; // enum LineStyle QwtPlotMarker(); virtual ~QwtPlotMarker(); virtual int rtti() const; double xValue() const; double yValue() const; QwtDoublePoint value() const; void setXValue(double); void setYValue(double); void setValue(double, double); void setValue(const QwtDoublePoint&); void setLineStyle(QwtPlotMarker::LineStyle); QwtPlotMarker::LineStyle lineStyle() const; void setLinePen(const QPen&); const QPen& linePen() const; void setSymbol(const QwtSymbol&); const QwtSymbol& symbol() const; void setLabel(const QwtText&); QwtText label() const; void setLabelAlignment(int); int labelAlignment() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual QwtDoubleRect boundingRect() const; }; // class QwtPlotMarker %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtPlotMarker: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum LineStyle { NoLine, HLine, VLine, Cross }; // enum LineStyle QwtPlotMarker(); virtual ~QwtPlotMarker(); virtual int rtti() const; double xValue() const; double yValue() const; QwtDoublePoint value() const; void setXValue(double); void setYValue(double); void setValue(double, double); void setValue(const QwtDoublePoint&); void setLineStyle(QwtPlotMarker::LineStyle); QwtPlotMarker::LineStyle lineStyle() const; void setLinePen(const QPen&); const QPen& linePen() const; void setSymbol(const QwtSymbol&); const QwtSymbol& symbol() const; void setLabel(const QwtText&); QwtText label() const; void setLabelAlignment(int); int labelAlignment() const; void setLabelOrientation(Qt::Orientation); Qt::Orientation labelOrientation() const; void setSpacing(int); int spacing() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual QwtDoubleRect boundingRect() const; protected: void drawAt(QPainter*, const QRect&, const QPoint&) const; }; // class QwtPlotMarker %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/QwtValueVector.sip0000444000175000017500000000444310554700523021442 0ustar poxpox// The SIP interface definition for: // QValueVector. // // Copyright (C) 2001-2007 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %MappedType QValueVector { %TypeHeaderCode #include %End %ConvertFromTypeCode // Create the list. PyObject *l = PyList_New(sipCpp->size()); if (!l) return 0; // Set the list elements. for (int i = 0; i < sipCpp->size(); ++i) { PyObject *o = PyInt_FromLong(long((*sipCpp)[i])); if (!o) { Py_DECREF(l); return 0; } PyList_SET_ITEM(l, i, o); } return l; %End // %ConvertFromTypeCode %ConvertToTypeCode // Type checking if that is all that is required. if (!sipIsErr) return PyList_Check(sipPy); QValueVector *v = new QValueVector; for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) { v[i] = PyInt_AsLong(PyList_GET_ITEM(sipPy, i)); } *sipCppPtr = v; return sipGetState(sipTransferObj); %End // %ConvertToTypeCode }; // QValueVector // Local Variables: // mode: C++ // c-file-style: "stroustrup" // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_grid.sip0000444000175000017500000000444611130210270021352 0ustar poxpox// The SIP interface specification for: // QwtPlotGrid. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotGrid: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotGrid(); virtual ~QwtPlotGrid(); virtual int rtti() const; void enableX(bool); bool xEnabled() const; void enableY(bool); bool yEnabled() const; void enableXMin(bool); bool xMinEnabled() const; void enableYMin(bool); bool yMinEnabled() const; void setXDiv(const QwtScaleDiv&); const QwtScaleDiv& xScaleDiv() const; void setYDiv(const QwtScaleDiv&); const QwtScaleDiv& yScaleDiv() const; void setPen(const QPen&); void setMajPen(const QPen&); const QPen& majPen() const; void setMinPen(const QPen&); const QPen& minPen() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual void updateScaleDiv(const QwtScaleDiv&, const QwtScaleDiv&); }; // class QwtPlotGrid // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_wheel.sip0000444000175000017500000000507511130210270020472 0ustar poxpox// The SIP interface specification for: // QwtWheel. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtWheel: QwtAbstractSlider { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtWheel(QWidget* /TransferThis/ = 0); QwtWheel(QWidget*, const char*); virtual ~QwtWheel(); virtual void setOrientation(Qt::Orientation); double totalAngle() const; double viewAngle() const; int tickCnt() const; int internalBorder() const; virtual double mass() const; void setTotalAngle(double); void setTickCnt(int); void setViewAngle(double); void setInternalBorder(int); virtual void setMass(double); void setWheelWidth(int); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; protected: virtual void resizeEvent(QResizeEvent*); virtual void paintEvent(QPaintEvent*); void layoutWheel(bool = true); void draw(QPainter*, const QRect&); void drawWheel(QPainter*, const QRect&); void drawWheelBackground(QPainter*, const QRect&); void setColorArray(); virtual void valueChange(); virtual void paletteChange(const QPalette&); virtual double getValue(const QPoint&); virtual void getScrollMode(const QPoint&, int& /Out/, int& /Out/); }; // class QwtWheel // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/QwtArrayInt.sip0000444000175000017500000001061011130210270020707 0ustar poxpox// The SIP interface specification for: // QwtArrayInt. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrayInt { %TypeHeaderCode #include typedef QwtArray QwtArrayInt; %End // %TypeHeaderCode public: QwtArrayInt(); QwtArrayInt(int); QwtArrayInt(const QwtArrayInt &); QwtArrayInt(SIP_PYOBJECT); %MethodCode QwtArray array; // Numeric is not thread-safe if (-1 == try_PyObject_to_QwtArray(a0, array)) return 0; sipCpp = new QwtArrayInt(array); %End // QwtArrayInt() ~QwtArrayInt(); // not possible: QwtArray &operator=(const QArray &); // not Pythonic: type *data() const; // not Pythonic: uint nrefs() const; uint size() const; uint count() const; bool isEmpty() const; bool isNull() const; bool resize(uint); bool truncate(uint); bool fill(const int, int = -1); void detach(); QwtArrayInt copy() const; QwtArrayInt & assign(const QwtArrayInt &); // not Pythonic: QwtArray & assign(const type *, uint); QwtArrayInt & duplicate(const QwtArrayInt &); // not Pythonic: QwtArray & duplicate(const type *, uint); // not Pythonic: QwtArray & setRawData(const type *, uint); // not Pythonic: void resetRawData(const type *, uint); int find(const int &, uint = 0) const; int contains(const int &) const; void sort(); int bsearch(const int &) const; // see __getitem__: type & operator[](int) const; int /* & */ at(uint) const; // pulls in unwanted operators: bool operator==(const QwtArrayInt &) const; // pulls in unwanted operators: bool operator!=(const QwtArrayInt &) const; // No iterators, yet: Iterator begin(); // No iterators, yet: Iterator end(); // No iterators, yet: ConstIterator begin() const; // No iterators, yet: ConstIterator end() const; int __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = (*sipCpp)[a0]; %End // __getitem__() int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End // __len__() void __setitem__(int, int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = a1; %End // __setitem__() void __setitem__(SIP_PYSLICE, const QwtArrayInt &); %MethodCode int len = sipCpp -> size(); Py_ssize_t start, stop, step, slicelength; if (0 > sipConvertFromSliceObject(a0, len, &start, &stop, &step, &slicelength)) sipIsErr = 1; else { int vlen = a1 -> size(); if (vlen != slicelength) { sipBadLengthForSlice(vlen, slicelength); sipIsErr = 1; } else { QwtArrayInt::ConstIterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[int(start)] = *it; start += step; ++it; } } } %End // __setitem__() }; // class QwtArrayInt // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_legend.sip0000444000175000017500000001042511130210270020617 0ustar poxpox// The SIP interface specification for: // QwtLegend. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtLegend: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum LegendDisplayPolicy { NoIdentifier, FixedIdentifier, AutoIdentifier }; // enum LegendDisplayPolicy enum LegendItemMode { ReadOnlyItem, ClickableItem, CheckableItem }; // enum LegendItemMode QwtLegend(QWidget* /TransferThis/ = 0); virtual ~QwtLegend(); void setDisplayPolicy(QwtLegend::LegendDisplayPolicy, int); QwtLegend::LegendDisplayPolicy displayPolicy() const; void setItemMode(QwtLegend::LegendItemMode); QwtLegend::LegendItemMode itemMode() const; int identifierMode() const; QWidget* contentsWidget(); // signature: const QWidget* contentsWidget() const; void insert(const QwtPlotItem*, QWidget* /Transfer/); void remove(const QwtPlotItem*); QWidget* find(const QwtPlotItem*) const; QwtPlotItem* find(const QWidget*) const; virtual QValueList legendItems() const; void clear(); bool isEmpty() const; uint itemCount() const; virtual bool eventFilter(QObject*, QEvent*); virtual QSize sizeHint() const; virtual int heightForWidth(int) const; QScrollBar* horizontalScrollBar() const; QScrollBar* verticalScrollBar() const; protected: virtual void resizeEvent(QResizeEvent*); virtual void layoutContents(); }; // class QwtLegend %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtLegend: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum LegendDisplayPolicy { NoIdentifier, FixedIdentifier, AutoIdentifier }; // enum LegendDisplayPolicy enum LegendItemMode { ReadOnlyItem, ClickableItem, CheckableItem }; // enum LegendItemMode QwtLegend(QWidget* /TransferThis/ = 0); virtual ~QwtLegend(); void setDisplayPolicy(QwtLegend::LegendDisplayPolicy, int); QwtLegend::LegendDisplayPolicy displayPolicy() const; void setItemMode(QwtLegend::LegendItemMode); QwtLegend::LegendItemMode itemMode() const; int identifierMode() const; QWidget* contentsWidget(); // signature: const QWidget* contentsWidget() const; void insert(const QwtLegendItemManager*, QWidget*); void remove(const QwtLegendItemManager*); QWidget* find(const QwtLegendItemManager*) const; QwtLegendItemManager* find(const QWidget*) const; virtual QValueList legendItems() const; void clear(); bool isEmpty() const; uint itemCount() const; virtual bool eventFilter(QObject*, QEvent*); virtual QSize sizeHint() const; virtual int heightForWidth(int) const; QScrollBar* horizontalScrollBar() const; QScrollBar* verticalScrollBar() const; protected: virtual void resizeEvent(QResizeEvent*); virtual void layoutContents(); }; // class QwtLegend %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_picker_machine.sip0000444000175000017500000001102611130210270022320 0ustar poxpox// The SIP interface specification for: // QwtPickerClickPointMachine, // QwtPickerClickRectMachine, // QwtPickerDragPointMachine, // QwtPickerDragRectMachine, // QwtPickerMachine, // QwtPickerPolygonMachine. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPickerClickPointMachine: QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual QValueList transition(const QwtEventPattern&, const QEvent*); }; // class QwtPickerClickPointMachine class QwtPickerClickRectMachine: QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual QValueList transition(const QwtEventPattern&, const QEvent*); }; // class QwtPickerClickRectMachine class QwtPickerDragPointMachine: QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual QValueList transition(const QwtEventPattern&, const QEvent*); }; // class QwtPickerDragPointMachine class QwtPickerDragRectMachine: QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual QValueList transition(const QwtEventPattern&, const QEvent*); }; // class QwtPickerDragRectMachine class QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Command { Begin, Append, Move, End }; // enum Command virtual ~QwtPickerMachine(); virtual QValueList transition(const QwtEventPattern&, const QEvent*) = 0; void reset(); int state() const; void setState(int); protected: QwtPickerMachine(); %If (CXX_DYNAMIC_CAST) %ConvertToSubClassCode // Walk the inheritance tree depth first in alphabetical order #ifdef sipClass_QwtPickerClickPointMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerClickPointMachine; else #endif #ifdef sipClass_QwtPickerClickRectMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerClickRectMachine; else #endif #ifdef sipClass_QwtPickerDragPointMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerDragPointMachine; else #endif #ifdef sipClass_QwtPickerDragRectMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerDragRectMachine; else #endif #ifdef sipClass_QwtPickerPolygonMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerPolygonMachine; else #endif #ifdef sipClass_QwtPickerMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerMachine; else #endif sipClass = 0; %End %End }; // class QwtPickerMachine class QwtPickerPolygonMachine: QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual QValueList transition(const QwtEventPattern&, const QEvent*); }; // class QwtPickerPolygonMachine // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_spline.sip0000444000175000017500000000620511172321327020670 0ustar poxpox// The SIP interface specification for: // QwtSpline. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtSpline { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum SplineType { Natural, Periodic }; // enum SplineType QwtSpline(); QwtSpline(const QwtSpline&); ~QwtSpline(); // Not Pythonic: QwtSpline& operator=(const QwtSpline&); void setSplineType(QwtSpline::SplineType); QwtSpline::SplineType splineType() const; bool setPoints(const QwtArrayQwtDoublePoint&); %If (Qwt_5_0_1 - ) QwtArrayQwtDoublePoint points() const; %End // (Qwt_5_0_1 - ) void reset(); bool isValid() const; double value(double) const; protected: bool buildNaturalSpline(const QwtArrayQwtDoublePoint&); bool buildPeriodicSpline(const QwtArrayQwtDoublePoint&); }; // class QwtSpline %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtSpline { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum SplineType { Natural, Periodic }; // enum SplineType QwtSpline(); QwtSpline(const QwtSpline&); ~QwtSpline(); // Not Pythonic: QwtSpline& operator=(const QwtSpline&); void setSplineType(QwtSpline::SplineType); QwtSpline::SplineType splineType() const; bool setPoints(const QwtArrayQwtDoublePoint&); %If (Qwt_5_0_1 - ) QwtArrayQwtDoublePoint points() const; %End // (Qwt_5_0_1 - ) void reset(); bool isValid() const; double value(double) const; const QwtArrayDouble& coefficientsA() const; const QwtArrayDouble& coefficientsB() const; const QwtArrayDouble& coefficientsC() const; protected: bool buildNaturalSpline(const QwtArrayQwtDoublePoint&); bool buildPeriodicSpline(const QwtArrayQwtDoublePoint&); }; // class QwtSpline %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_double_interval.sip0000444000175000017500000001054711172321327022560 0ustar poxpox// The SIP interface specification for: // QwtDoubleInterval. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtDoubleInterval { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDoubleInterval(); QwtDoubleInterval(double, double); void setInterval(double, double); QwtDoubleInterval normalized() const; QwtDoubleInterval inverted() const; QwtDoubleInterval limited(double, double) const; int operator==(const QwtDoubleInterval&) const; int operator!=(const QwtDoubleInterval&) const; double minValue() const; double maxValue() const; double width() const; void setMinValue(double); void setMaxValue(double); bool contains(double) const; bool intersects(const QwtDoubleInterval&) const; QwtDoubleInterval intersect(const QwtDoubleInterval&) const; QwtDoubleInterval unite(const QwtDoubleInterval&) const; QwtDoubleInterval operator|(const QwtDoubleInterval&) const; QwtDoubleInterval operator&(const QwtDoubleInterval&) const; QwtDoubleInterval& __ior__(const QwtDoubleInterval&); QwtDoubleInterval& __iand__(const QwtDoubleInterval&); QwtDoubleInterval extend(double) const; QwtDoubleInterval operator|(double) const; QwtDoubleInterval& __ior__(double); bool isValid() const; bool isNull() const; void invalidate(); QwtDoubleInterval symmetrize(double) const; }; // class QwtDoubleInterval %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtDoubleInterval { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum BorderMode { IncludeBorders, ExcludeMinimum, ExcludeMaximum, ExcludeBorders }; // enum BorderMode QwtDoubleInterval(); QwtDoubleInterval(double, double, int = IncludeBorders); void setInterval(double, double, int = IncludeBorders); QwtDoubleInterval normalized() const; QwtDoubleInterval inverted() const; QwtDoubleInterval limited(double, double) const; int operator==(const QwtDoubleInterval&) const; int operator!=(const QwtDoubleInterval&) const; void setBorderFlags(int); int borderFlags() const; double minValue() const; double maxValue() const; double width() const; void setMinValue(double); void setMaxValue(double); bool contains(double) const; bool intersects(const QwtDoubleInterval&) const; QwtDoubleInterval intersect(const QwtDoubleInterval&) const; QwtDoubleInterval unite(const QwtDoubleInterval&) const; QwtDoubleInterval operator|(const QwtDoubleInterval&) const; QwtDoubleInterval operator&(const QwtDoubleInterval&) const; QwtDoubleInterval& __ior__(const QwtDoubleInterval&); QwtDoubleInterval& __iand__(const QwtDoubleInterval&); QwtDoubleInterval extend(double) const; QwtDoubleInterval operator|(double) const; QwtDoubleInterval& __ior__(double); bool isValid() const; bool isNull() const; void invalidate(); QwtDoubleInterval symmetrize(double) const; }; // class QwtDoubleInterval %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/QwtArrayQwtDoublePoint.sip0000444000175000017500000001220011163711320023102 0ustar poxpox// The SIP interface specification for: // QwtArrayQwtDoublePoint. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrayQwtDoublePoint { %TypeHeaderCode #include #include typedef QwtArray QwtArrayQwtDoublePoint; %End // %TypeHeaderCode public: QwtArrayQwtDoublePoint(); QwtArrayQwtDoublePoint(int); QwtArrayQwtDoublePoint(const QwtArrayQwtDoublePoint &); QwtArrayQwtDoublePoint(SIP_PYLIST); %MethodCode // FIXME QwtArray array(PyList_GET_SIZE(a0)); for (int i = 0; i < PyList_GET_SIZE(a0); ++i) { #if SIP_VERSION < 0x040800 void *cpp = sipForceConvertToInstance( PyList_GET_ITEM(a0, i), sipClass_QwtDoublePoint, NULL, SIP_NO_CONVERTORS, NULL, &sipIsErr); #else void *cpp = sipForceConvertToType( PyList_GET_ITEM(a0, i), sipType_QwtDoublePoint, NULL, SIP_NO_CONVERTORS, NULL, &sipIsErr); #endif array[i] = *reinterpret_cast(cpp); } sipCpp = new QwtArrayQwtDoublePoint(array); %End // QwtArrayQwtDoublePoint() // not Pythonic: type *data() const; // not Pythonic: uint nrefs() const; uint size() const; uint count() const; bool isEmpty() const; bool isNull() const; bool resize(uint); bool truncate(uint); bool fill(const QwtDoublePoint, int = -1); void detach(); QwtArrayQwtDoublePoint copy() const; QwtArrayQwtDoublePoint & assign(const QwtArrayQwtDoublePoint &); // not Pythonic: QwtArray & assign(const type *, uint); QwtArrayQwtDoublePoint & duplicate(const QwtArrayQwtDoublePoint &); // not Pythonic: QwtArray & duplicate(const type *, uint); // not Pythonic: QwtArray & setRawData(const type *, uint); // not Pythonic: void resetRawData(const type *, uint); int find(const QwtDoublePoint &, uint = 0) const; int contains(const QwtDoublePoint &) const; void sort(); int bsearch(const QwtDoublePoint &) const; // see __getitem__: type & operator[](int) const; QwtDoublePoint & at(uint) const; // pulls in unwanted operators: bool operator==(const QwtArrayQwtDoublePoint &) const; // pulls in unwanted operators: bool operator!=(const QwtArrayQwtDoublePoint &) const; // No iterators, yet: Iterator begin(); // No iterators, yet: Iterator end(); // No iterators, yet: ConstIterator begin() const; // No iterators, yes: ConstIterator end() const; QwtDoublePoint & __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = &(*sipCpp)[a0]; %End // __getitem__() int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End // __len__() void __setitem__(int, QwtDoublePoint); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = *a1; %End // __setitem__() void __setitem__(SIP_PYSLICE, const QwtArrayQwtDoublePoint &); %MethodCode int len = sipCpp -> size(); Py_ssize_t start, stop, step, slicelength; if (0 > sipConvertFromSliceObject(a0, len, &start, &stop, &step, &slicelength)) sipIsErr = 1; else { int vlen = a1 -> size(); if (vlen != slicelength) { sipBadLengthForSlice(vlen, slicelength); sipIsErr = 1; } else { QwtArrayQwtDoublePoint::ConstIterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[int(start)] = *it; start += step; ++it; } } } %End // __setitem__() }; // class QwtArrayQwtDoublePoint // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_magnifier.sip0000444000175000017500000000656711130210270022374 0ustar poxpox// The SIP interface specification for: // QwtPlotMagnifier. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlotMagnifier: QObject { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotMagnifier(QwtPlotCanvas* /TransferThis/); virtual ~QwtPlotMagnifier(); void setEnabled(bool); bool isEnabled() const; void setAxisEnabled(int, bool); bool isAxisEnabled(int) const; void setMouseFactor(double); double mouseFactor() const; void setMouseButton(int, int = Qt::NoButton); void getMouseButton(int&, int&) const; void setWheelFactor(double); double wheelFactor() const; void setWheelButtonState(int); int wheelButtonState() const; void setKeyFactor(double); double keyFactor() const; void setZoomInKey(int, int); void getZoomInKey(int&, int&); void setZoomOutKey(int, int); void getZoomOutKey(int&, int&); QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; virtual bool eventFilter(QObject*, QEvent*); protected: virtual void rescale(double); virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetWheelEvent(QWheelEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); }; // class QwtPlotMagnifier %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPlotMagnifier: QwtMagnifier { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotMagnifier(QwtPlotCanvas* /TransferThis/); virtual ~QwtPlotMagnifier(); void setAxisEnabled(int, bool); bool isAxisEnabled(int) const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; protected: virtual void rescale(double); }; // class QwtPlotMagnifier %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_slider.sip0000444000175000017500000000625611130210270020652 0ustar poxpox// The SIP interface specification for: // QwtSlider. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtSlider: QwtAbstractSlider, QwtAbstractScale { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum ScalePos { NoScale, LeftScale, RightScale, TopScale, BottomScale }; // enum ScalePos enum BGSTYLE { BgTrough, BgSlot, BgBoth }; // enum BGSTYLE QwtSlider(QWidget* /TransferThis/, Qt::Orientation = Qt::Horizontal, QwtSlider::ScalePos = NoScale, QwtSlider::BGSTYLE = BgTrough); QwtSlider(QWidget* /TransferThis/, const char*); virtual ~QwtSlider(); virtual void setOrientation(Qt::Orientation); void setBgStyle(QwtSlider::BGSTYLE); QwtSlider::BGSTYLE bgStyle() const; void setScalePosition(QwtSlider::ScalePos); QwtSlider::ScalePos scalePosition() const; int thumbLength() const; int thumbWidth() const; int borderWidth() const; void setThumbLength(int); void setThumbWidth(int); void setBorderWidth(int); void setMargins(int, int); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; void setScaleDraw(QwtScaleDraw* /Transfer/); // signature: const QwtScaleDraw* scaleDraw() const; protected: virtual double getValue(const QPoint&); virtual void getScrollMode(const QPoint&, int& /Out/, int& /Out/); void draw(QPainter*, const QRect&); virtual void drawSlider(QPainter*, const QRect&); virtual void drawThumb(QPainter*, const QRect&, int); virtual void resizeEvent(QResizeEvent*); virtual void paintEvent(QPaintEvent*); virtual void valueChange(); virtual void rangeChange(); virtual void scaleChange(); virtual void fontChange(const QFont&); void layoutSlider(bool = true); int xyPosition(double) const; QwtScaleDraw* scaleDraw(); }; // class QwtSlider // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_color_map.sip0000444000175000017500000000722711130210270021342 0ustar poxpox// The SIP interface specification for: // QwtAlphaColorMap, // QwtColorMap, // QwtLinearColorMap. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtAlphaColorMap: QwtColorMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtAlphaColorMap(const QColor& = QColor(Qt::gray)); QwtAlphaColorMap(const QwtAlphaColorMap&); virtual ~QwtAlphaColorMap(); // Not Pythonic: QwtAlphaColorMap& operator=(const QwtAlphaColorMap&); virtual QwtColorMap* copy() const; void setColor(const QColor&); QColor color() const; virtual QRgb rgb(const QwtDoubleInterval&, double) const; private: virtual unsigned char colorIndex(const QwtDoubleInterval&, double) const; }; // class QwtAlphaColorMap class QwtColorMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Format { RGB, Indexed }; // enum Format QwtColorMap(QwtColorMap::Format = QwtColorMap::RGB); virtual ~QwtColorMap(); QwtColorMap::Format format() const; virtual QwtColorMap* copy() const = 0; virtual QRgb rgb(const QwtDoubleInterval&, double) const = 0; virtual unsigned char colorIndex(const QwtDoubleInterval&, double) const = 0; QColor color(const QwtDoubleInterval&, double) const; virtual QValueVector colorTable(const QwtDoubleInterval&) const; }; // class QwtColorMap class QwtLinearColorMap: QwtColorMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Mode { FixedColors, ScaledColors }; // enum Mode QwtLinearColorMap(QwtColorMap::Format = QwtColorMap::RGB); QwtLinearColorMap(const QColor&, const QColor&, QwtColorMap::Format = QwtColorMap::RGB); QwtLinearColorMap(const QwtLinearColorMap&); virtual ~QwtLinearColorMap(); // Not Pythonic: QwtLinearColorMap& operator=(const QwtLinearColorMap&); virtual QwtColorMap* copy() const; void setMode(QwtLinearColorMap::Mode); QwtLinearColorMap::Mode mode() const; void setColorInterval(const QColor&, const QColor&); void addColorStop(double, const QColor&); QwtArrayDouble colorStops() const; QColor color1() const; QColor color2() const; virtual QRgb rgb(const QwtDoubleInterval&, double) const; virtual unsigned char colorIndex(const QwtDoubleInterval&, double) const; }; // class QwtLinearColorMap // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_spectrogram.sip0000444000175000017500000000604511207550767022777 0ustar poxpox// The SIP interface specification for: // QwtPlotSpectrogram. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotSpectrogram: QwtPlotRasterItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum DisplayMode { ImageMode, ContourMode }; // enum DisplayMode QwtPlotSpectrogram(const QString& = QString::null); virtual ~QwtPlotSpectrogram(); void setDisplayMode(QwtPlotSpectrogram::DisplayMode, bool = true); bool testDisplayMode(QwtPlotSpectrogram::DisplayMode) const; void setData(const QwtRasterData&); const QwtRasterData& data() const; void setColorMap(const QwtColorMap&); const QwtColorMap& colorMap() const; virtual QwtDoubleRect boundingRect() const; virtual QSize rasterHint(const QwtDoubleRect&) const; void setDefaultContourPen(const QPen&); QPen defaultContourPen() const; virtual QPen contourPen(double) const; void setConrecAttribute(QwtRasterData::ConrecAttribute, bool); bool testConrecAttribute(QwtRasterData::ConrecAttribute) const; void setContourLevels(const QwtValueList&); QwtValueList contourLevels() const; virtual int rtti() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; protected: virtual QImage renderImage(const QwtScaleMap&, const QwtScaleMap&, const QwtDoubleRect&) const; virtual QSize contourRasterSize(const QwtDoubleRect&, const QRect&) const; // FIXME: virtual QMap renderContourLines(const QwtDoubleRect&, const QSize&) const; // FIXME: virtual void drawContourLines(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QMap&) const; }; // class QwtPlotSpectrogram // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_layout_metrics.sip0000444000175000017500000000550711130210270022431 0ustar poxpox// The SIP interface specification for: // QwtMetricsMap. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtMetricsMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtMetricsMap(); bool isIdentity() const; void setMetrics(const QPaintDevice*, const QPaintDevice*); int layoutToDeviceX(int) const; int deviceToLayoutX(int) const; int screenToLayoutX(int) const; int layoutToScreenX(int) const; int layoutToDeviceY(int) const; int deviceToLayoutY(int) const; int screenToLayoutY(int) const; int layoutToScreenY(int) const; QPoint layoutToDevice(const QPoint&, const QPainter* = 0) const; QPoint deviceToLayout(const QPoint&, const QPainter* = 0) const; QPoint screenToLayout(const QPoint&) const; QPoint layoutToScreen(const QPoint&) const; QSize layoutToDevice(const QSize&) const; QSize deviceToLayout(const QSize&) const; QSize screenToLayout(const QSize&) const; QSize layoutToScreen(const QSize&) const; QRect layoutToDevice(const QRect&, const QPainter* = 0) const; QRect deviceToLayout(const QRect&, const QPainter* = 0) const; QRect screenToLayout(const QRect&) const; QRect layoutToScreen(const QRect&) const; QwtPolygon layoutToDevice(const QwtPolygon&, const QPainter* = 0) const; QwtPolygon deviceToLayout(const QwtPolygon&, const QPainter* = 0) const; static QwtPolygon translate(const QWMatrix&, const QwtPolygon&); static QRect translate(const QWMatrix&, const QRect&); }; // class QwtMetricsMap // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_picker.sip0000444000175000017500000002632611130210270020645 0ustar poxpox// The SIP interface specification for: // QwtPicker. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_0_3) class QwtPicker: QObject, QwtEventPattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum SelectionType { NoSelection, PointSelection, RectSelection, PolygonSelection }; // enum SelectionType enum RectSelectionType { CornerToCorner, CenterToCorner, CenterToRadius }; // enum RectSelectionType enum SelectionMode { ClickSelection, DragSelection }; // enum SelectionMode enum RubberBand { NoRubberBand, HLineRubberBand, VLineRubberBand, CrossRubberBand, RectRubberBand, EllipseRubberBand, PolygonRubberBand, UserRubberBand }; // enum RubberBand enum DisplayMode { AlwaysOff, AlwaysOn, ActiveOnly }; // enum DisplayMode enum ResizeMode { Stretch, KeepSize }; // enum ResizeMode QwtPicker(QWidget* /TransferThis/); QwtPicker(int, QwtPicker::RubberBand, QwtPicker::DisplayMode, QWidget* /TransferThis/); virtual ~QwtPicker(); virtual void setSelectionFlags(int); int selectionFlags() const; virtual void setRubberBand(QwtPicker::RubberBand); QwtPicker::RubberBand rubberBand() const; virtual void setTrackerMode(QwtPicker::DisplayMode); QwtPicker::DisplayMode trackerMode() const; virtual void setResizeMode(QwtPicker::ResizeMode); QwtPicker::ResizeMode resizeMode() const; virtual void setRubberBandPen(const QPen&); QPen rubberBandPen() const; virtual void setTrackerPen(const QPen&); QPen trackerPen() const; virtual void setTrackerFont(const QFont&); QFont trackerFont() const; bool isEnabled() const; virtual void setEnabled(bool); bool isActive() const; virtual bool eventFilter(QObject*, QEvent*); QWidget* parentWidget(); // signature: const QWidget* parentWidget() const; virtual QRect pickRect() const; const QwtPolygon& selection() const; virtual void drawRubberBand(QPainter*) const; virtual void drawTracker(QPainter*) const; signals: void selected(const QwtPolygon&); void appended(const QPoint&); void moved(const QPoint&); void changed(const QwtPolygon&); protected: virtual bool accept(QwtPolygon&) const; virtual void transition(const QEvent*); virtual void begin(); virtual void append(const QPoint&); virtual void move(const QPoint&); virtual bool end(bool = true); virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseDoubleClickEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetWheelEvent(QWheelEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); virtual void widgetLeaveEvent(QEvent*); QRect trackerRect(QPainter*) const; virtual void stretchSelection(const QSize&, const QSize&); virtual QwtText trackerText(const QPoint&) const; virtual QwtPickerMachine* stateMachine(int) const /Factory/; virtual void updateDisplay(); const QWidget* rubberBandWidget() const; const QWidget* trackerWidget() const; }; // class QwtPicker %End // (Qwt_5_0_0 - Qwt_5_0_3) %If (Qwt_5_0_3 - Qwt_5_1_0) class QwtPicker: QObject, QwtEventPattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum SelectionType { NoSelection, PointSelection, RectSelection, PolygonSelection }; // enum SelectionType enum RectSelectionType { CornerToCorner, CenterToCorner, CenterToRadius }; // enum RectSelectionType enum SelectionMode { ClickSelection, DragSelection }; // enum SelectionMode enum RubberBand { NoRubberBand, HLineRubberBand, VLineRubberBand, CrossRubberBand, RectRubberBand, EllipseRubberBand, PolygonRubberBand, UserRubberBand }; // enum RubberBand enum DisplayMode { AlwaysOff, AlwaysOn, ActiveOnly }; // enum DisplayMode enum ResizeMode { Stretch, KeepSize }; // enum ResizeMode QwtPicker(QWidget* /TransferThis/); QwtPicker(int, QwtPicker::RubberBand, QwtPicker::DisplayMode, QWidget* /TransferThis/); virtual ~QwtPicker(); virtual void setSelectionFlags(int); int selectionFlags() const; virtual void setRubberBand(QwtPicker::RubberBand); QwtPicker::RubberBand rubberBand() const; virtual void setTrackerMode(QwtPicker::DisplayMode); QwtPicker::DisplayMode trackerMode() const; virtual void setResizeMode(QwtPicker::ResizeMode); QwtPicker::ResizeMode resizeMode() const; virtual void setRubberBandPen(const QPen&); QPen rubberBandPen() const; virtual void setTrackerPen(const QPen&); QPen trackerPen() const; virtual void setTrackerFont(const QFont&); QFont trackerFont() const; bool isEnabled() const; virtual void setEnabled(bool); bool isActive() const; virtual bool eventFilter(QObject*, QEvent*); QWidget* parentWidget(); // signature: const QWidget* parentWidget() const; virtual QRect pickRect() const; const QwtPolygon& selection() const; virtual void drawRubberBand(QPainter*) const; virtual void drawTracker(QPainter*) const; virtual QwtText trackerText(const QPoint&) const; QRect trackerRect(QPainter*) const; signals: void selected(const QwtPolygon&); void appended(const QPoint&); void moved(const QPoint&); void changed(const QwtPolygon&); protected: virtual bool accept(QwtPolygon&) const; virtual void transition(const QEvent*); virtual void begin(); virtual void append(const QPoint&); virtual void move(const QPoint&); virtual bool end(bool = true); virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseDoubleClickEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetWheelEvent(QWheelEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); virtual void widgetLeaveEvent(QEvent*); virtual void stretchSelection(const QSize&, const QSize&); virtual QwtPickerMachine* stateMachine(int) const /Factory/; virtual void updateDisplay(); const QWidget* rubberBandWidget() const; const QWidget* trackerWidget() const; }; // class QwtPicker %End // (Qwt_5_0_3 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPicker: QObject, QwtEventPattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum SelectionType { NoSelection, PointSelection, RectSelection, PolygonSelection }; // enum SelectionType enum RectSelectionType { CornerToCorner, CenterToCorner, CenterToRadius }; // enum RectSelectionType enum SelectionMode { ClickSelection, DragSelection }; // enum SelectionMode enum RubberBand { NoRubberBand, HLineRubberBand, VLineRubberBand, CrossRubberBand, RectRubberBand, EllipseRubberBand, PolygonRubberBand, UserRubberBand }; // enum RubberBand enum DisplayMode { AlwaysOff, AlwaysOn, ActiveOnly }; // enum DisplayMode enum ResizeMode { Stretch, KeepSize }; // enum ResizeMode QwtPicker(QWidget* /TransferThis/); QwtPicker(int, QwtPicker::RubberBand, QwtPicker::DisplayMode, QWidget* /TransferThis/); virtual ~QwtPicker(); virtual void setSelectionFlags(int); int selectionFlags() const; virtual void setRubberBand(QwtPicker::RubberBand); QwtPicker::RubberBand rubberBand() const; virtual void setTrackerMode(QwtPicker::DisplayMode); QwtPicker::DisplayMode trackerMode() const; virtual void setResizeMode(QwtPicker::ResizeMode); QwtPicker::ResizeMode resizeMode() const; virtual void setRubberBandPen(const QPen&); QPen rubberBandPen() const; virtual void setTrackerPen(const QPen&); QPen trackerPen() const; virtual void setTrackerFont(const QFont&); QFont trackerFont() const; bool isEnabled() const; virtual void setEnabled(bool); bool isActive() const; virtual bool eventFilter(QObject*, QEvent*); QWidget* parentWidget(); // signature: const QWidget* parentWidget() const; virtual QRect pickRect() const; const QwtPolygon& selection() const; virtual void drawRubberBand(QPainter*) const; virtual void drawTracker(QPainter*) const; virtual QwtText trackerText(const QPoint&) const; QPoint trackerPosition() const; QRect trackerRect(const QFont&) const; signals: void selected(const QwtPolygon&); void appended(const QPoint&); void moved(const QPoint&); void changed(const QwtPolygon&); protected: virtual bool accept(QwtPolygon&) const; virtual void transition(const QEvent*); virtual void begin(); virtual void append(const QPoint&); virtual void move(const QPoint&); virtual bool end(bool = true); virtual void reset(); virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseDoubleClickEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetWheelEvent(QWheelEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); virtual void widgetLeaveEvent(QEvent*); virtual void stretchSelection(const QSize&, const QSize&); virtual QwtPickerMachine* stateMachine(int) const /Factory/; virtual void updateDisplay(); const QWidget* rubberBandWidget() const; const QWidget* trackerWidget() const; }; // class QwtPicker %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_abstract_scale_draw.sip0000444000175000017500000000554211130210270023354 0ustar poxpox// The SIP interface specification for: // QwtAbstractScaleDraw. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtAbstractScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum ScaleComponent { Backbone, Ticks, Labels }; // enum ScaleComponent QwtAbstractScaleDraw(); QwtAbstractScaleDraw(const QwtAbstractScaleDraw&); virtual ~QwtAbstractScaleDraw(); // Not Pythonic: QwtAbstractScaleDraw& operator=(const QwtAbstractScaleDraw&); void setScaleDiv(const QwtScaleDiv&); const QwtScaleDiv& scaleDiv() const; void setTransformation(QwtScaleTransformation*); const QwtScaleMap& map() const; void enableComponent(QwtAbstractScaleDraw::ScaleComponent, bool = true); bool hasComponent(QwtAbstractScaleDraw::ScaleComponent) const; void setTickLength(QwtScaleDiv::TickType, int); int tickLength(QwtScaleDiv::TickType) const; int majTickLength() const; void setSpacing(int); int spacing() const; virtual void draw(QPainter*, const QColorGroup&) const; virtual QwtText label(double) const; virtual int extent(const QPen&, const QFont&) const = 0; void setMinimumExtent(int); int minimumExtent() const; QwtScaleMap& scaleMap(); protected: virtual void drawTick(QPainter*, double, int) const = 0; virtual void drawBackbone(QPainter*) const = 0; virtual void drawLabel(QPainter*, double) const = 0; void invalidateCache(); const QwtText& tickLabel(const QFont&, double) const; }; // class QwtAbstractScaleDraw // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_text_label.sip0000444000175000017500000000443711130210270021512 0ustar poxpox// The SIP interface specification for: // QwtTextLabel. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtTextLabel: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtTextLabel(QWidget* /TransferThis/ = 0); QwtTextLabel(QWidget*, const char*); QwtTextLabel(const QwtText&, QWidget* /TransferThis/ = 0); virtual ~QwtTextLabel(); public slots: void setText(const QString&, QwtText::TextFormat = QwtText::AutoText); virtual void setText(const QwtText&); void clear(); public: const QwtText& text() const; int indent() const; void setIndent(int); int margin() const; virtual void setMargin(int); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual int heightForWidth(int) const; QRect textRect() const; protected: virtual void paintEvent(QPaintEvent*); virtual void drawContents(QPainter*); virtual void drawText(QPainter*, const QRect&); }; // class QwtTextLabel // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_compass.sip0000444000175000017500000000424511130210270021031 0ustar poxpox// The SIP interface specification for: // QwtCompass. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtCompass: QwtDial { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtCompass(QWidget* /TransferThis/ = 0); QwtCompass(QWidget*, const char*); virtual ~QwtCompass(); void setRose(QwtCompassRose* /Transfer/); // signature: const QwtCompassRose* rose() const; QwtCompassRose* rose(); // signature: const QMap& labelMap() const; QMap& labelMap(); void setLabelMap(const QMap&); protected: virtual QwtText scaleLabel(double) const; virtual void drawRose(QPainter*, const QPoint&, int, double, QPalette::ColorGroup) const; virtual void drawScaleContents(QPainter*, const QPoint&, int) const; virtual void keyPressEvent(QKeyEvent*); }; // class QwtCompass // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_thermo.sip0000444000175000017500000000631111130210270020656 0ustar poxpox// The SIP interface specification for: // QwtThermo. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtThermo: QWidget, QwtAbstractScale { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum ScalePos { NoScale, LeftScale, RightScale, TopScale, BottomScale }; // enum ScalePos QwtThermo(QWidget* /TransferThis/ = 0); QwtThermo(QWidget*, const char*); virtual ~QwtThermo(); void setOrientation(Qt::Orientation, QwtThermo::ScalePos); void setScalePosition(QwtThermo::ScalePos); QwtThermo::ScalePos scalePosition() const; void setBorderWidth(int); int borderWidth() const; void setFillBrush(const QBrush&); const QBrush& fillBrush() const; void setFillColor(const QColor&); const QColor& fillColor() const; void setAlarmBrush(const QBrush&); const QBrush& alarmBrush() const; void setAlarmColor(const QColor&); const QColor& alarmColor() const; void setAlarmLevel(double); double alarmLevel() const; void setAlarmEnabled(bool); bool alarmEnabled() const; void setPipeWidth(int); int pipeWidth() const; void setMaxValue(double); double maxValue() const; void setMinValue(double); double minValue() const; double value() const; void setRange(double, double, bool = false); void setMargin(int); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; void setScaleDraw(QwtScaleDraw* /Transfer/); // signature: const QwtScaleDraw* scaleDraw() const; public slots: void setValue(double); protected: void draw(QPainter*, const QRect&); void drawThermo(QPainter*); void layoutThermo(bool = true); virtual void scaleChange(); virtual void fontChange(const QFont&); virtual void paintEvent(QPaintEvent*); virtual void resizeEvent(QResizeEvent*); QwtScaleDraw* scaleDraw(); }; // class QwtThermo // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_abstract_scale.sip0000444000175000017500000000456211130210270022340 0ustar poxpox// The SIP interface specification for: // QwtAbstractScale. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtAbstractScale { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtAbstractScale(); virtual ~QwtAbstractScale(); void setScale(double, double, double = 0.0); void setScale(const QwtDoubleInterval&, double = 0.0); void setScale(const QwtScaleDiv&); void setAutoScale(); bool autoScale() const; void setScaleMaxMajor(int); int scaleMaxMinor() const; void setScaleMaxMinor(int); int scaleMaxMajor() const; void setScaleEngine(QwtScaleEngine* /Transfer/); // signature: const QwtScaleEngine* scaleEngine() const; QwtScaleEngine* scaleEngine(); const QwtScaleMap& scaleMap() const; protected: void rescale(double, double, double = 0.0); void setAbstractScaleDraw(QwtAbstractScaleDraw* /Transfer/); // signature: const QwtAbstractScaleDraw* abstractScaleDraw() const; QwtAbstractScaleDraw* abstractScaleDraw(); virtual void scaleChange(); }; // class QwtAbstractScale // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_rasteritem.sip0000444000175000017500000000632011130210270022575 0ustar poxpox// The SIP interface specification for: // QwtPlotRasterItem. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_0_1) class QwtPlotRasterItem: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum CachePolicy { NoCache, PaintCache, ScreenCache }; // enum CachePolicy QwtPlotRasterItem(const QString& = QString::null); QwtPlotRasterItem(const QwtText&); virtual ~QwtPlotRasterItem(); void setAlpha(int); int alpha() const; void setCachePolicy(QwtPlotRasterItem::CachePolicy); QwtPlotRasterItem::CachePolicy cachePolicy() const; void invalidateCache(); virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual QSize rasterHint(const QwtDoubleRect&) const; protected: virtual QImage renderImage(const QwtScaleMap&, const QwtScaleMap&, const QwtDoubleRect&) const = 0; }; // class QwtPlotRasterItem %End // (Qwt_5_0_0 - Qwt_5_0_1) %If (Qwt_5_0_1 - ) class QwtPlotRasterItem: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum CachePolicy { NoCache, PaintCache, ScreenCache }; // enum CachePolicy QwtPlotRasterItem(const QString& = QString::null); QwtPlotRasterItem(const QwtText&); virtual ~QwtPlotRasterItem(); void setAlpha(int); int alpha() const; void setCachePolicy(QwtPlotRasterItem::CachePolicy); QwtPlotRasterItem::CachePolicy cachePolicy() const; void invalidateCache(); virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual QSize rasterHint(const QwtDoubleRect&) const; protected: virtual QImage renderImage(const QwtScaleMap&, const QwtScaleMap&, const QwtDoubleRect&) const = 0; private: QwtPlotRasterItem(const QwtPlotRasterItem&); }; // class QwtPlotRasterItem %End // (Qwt_5_0_1 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_legend_itemmanager.sip0000444000175000017500000000332411130210270023170 0ustar poxpox// The SIP interface specification for: // QwtLegendItemManager. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtLegendItemManager { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtLegendItemManager(); virtual ~QwtLegendItemManager(); virtual void updateLegend(QwtLegend*) const = 0; virtual QWidget* legendItem() const = 0; }; // class QwtLegendItemManager // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_knob.sip0000444000175000017500000000524011130210270020311 0ustar poxpox// The SIP interface specification for: // QwtKnob. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtKnob: QwtAbstractSlider, QwtAbstractScale { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Symbol { Line, Dot }; // enum Symbol QwtKnob(QWidget* /TransferThis/ = 0); QwtKnob(QWidget*, const char*); virtual ~QwtKnob(); void setKnobWidth(int); int knobWidth() const; void setTotalAngle(double); double totalAngle() const; void setBorderWidth(int); int borderWidth() const; void setSymbol(QwtKnob::Symbol); QwtKnob::Symbol symbol() const; virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; void setScaleDraw(QwtRoundScaleDraw* /Transfer/); // signature: const QwtRoundScaleDraw* scaleDraw() const; QwtRoundScaleDraw* scaleDraw(); protected: virtual void paintEvent(QPaintEvent*); virtual void resizeEvent(QResizeEvent*); void draw(QPainter*, const QRect&); void drawKnob(QPainter*, const QRect&); void drawMarker(QPainter*, double, const QColor&); private: virtual double getValue(const QPoint&); virtual void getScrollMode(const QPoint&, int& /Out/, int& /Out/); virtual void valueChange(); virtual void rangeChange(); virtual void scaleChange(); virtual void fontChange(const QFont&); }; // class QwtKnob // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_dict.sip0000444000175000017500000000335211130210270021343 0ustar poxpox// The SIP interface specification for: // QwtPlotDict. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotDict { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotDict(); ~QwtPlotDict(); void setAutoDelete(bool); bool autoDelete() const; const QValueList& itemList() const; void detachItems(int = QwtPlotItem::Rtti_PlotItem, bool = true); }; // class QwtPlotDict // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_printfilter.sip0000444000175000017500000000702411130210270022762 0ustar poxpox// The SIP interface specification for: // QwtPlotPrintFilter. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlotPrintFilter { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Options { PrintAll, PrintMargin, PrintTitle, PrintLegend, PrintGrid, PrintCanvasBackground, PrintWidgetBackground }; // enum Options enum Item { Title, Legend, Curve, CurveSymbol, Marker, MarkerSymbol, MajorGrid, MinorGrid, CanvasBackground, AxisScale, AxisTitle, WidgetBackground }; // enum Item QwtPlotPrintFilter(); virtual ~QwtPlotPrintFilter(); virtual QColor color(const QColor&, QwtPlotPrintFilter::Item) const; virtual QFont font(const QFont&, QwtPlotPrintFilter::Item) const; void setOptions(int); int options() const; virtual void apply(QwtPlot*) const; virtual void reset(QwtPlot*) const; virtual void apply(QwtPlotItem*) const; virtual void reset(QwtPlotItem*) const; }; // class QwtPlotPrintFilter %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPlotPrintFilter { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Options { PrintAll, PrintMargin, PrintTitle, PrintLegend, PrintGrid, PrintBackground, PrintFrameWithScales }; // enum Options enum Item { Title, Legend, Curve, CurveSymbol, Marker, MarkerSymbol, MajorGrid, MinorGrid, CanvasBackground, AxisScale, AxisTitle, WidgetBackground }; // enum Item QwtPlotPrintFilter(); virtual ~QwtPlotPrintFilter(); virtual QColor color(const QColor&, QwtPlotPrintFilter::Item) const; virtual QFont font(const QFont&, QwtPlotPrintFilter::Item) const; void setOptions(int); int options() const; virtual void apply(QwtPlot*) const; virtual void reset(QwtPlot*) const; virtual void apply(QwtPlotItem*) const; virtual void reset(QwtPlotItem*) const; }; // class QwtPlotPrintFilter %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_scale_map.sip0000444000175000017500000001141511231447464021330 0ustar poxpox// The SIP interface specification for: // QwtScaleMap, // QwtScaleTransformation. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_0_1) class QwtScaleMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: static const double LogMin; static const double LogMax; QwtScaleMap(); QwtScaleMap(const QwtScaleMap&); ~QwtScaleMap(); // Not Pythonic: QwtScaleMap& operator=(const QwtScaleMap&); void setTransformation(QwtScaleTransformation* /Transfer/); const QwtScaleTransformation* transformation() const; void setPaintInterval(int, int); void setPaintXInterval(double, double); void setScaleInterval(double, double); int transform(double) const; double invTransform(double) const; double xTransform(double) const; double p1() const; double p2() const; double s1() const; double s2() const; double pDist() const; double sDist() const; public: QwtScaleMap(int, int, double, double); %MethodCode sipCpp = new QwtScaleMap(); sipCpp->setPaintInterval(a0, a1); sipCpp->setScaleInterval(a2, a3); %End }; // class QwtScaleMap class QwtScaleTransformation { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Type { Linear, Log10, Other }; // enum Type QwtScaleTransformation(QwtScaleTransformation::Type); virtual ~QwtScaleTransformation(); virtual double xForm(double, double, double, double, double) const; virtual double invXForm(double, double, double, double, double) const; QwtScaleTransformation::Type type() const; virtual QwtScaleTransformation* copy() const /Factory/; private: QwtScaleTransformation(const QwtScaleTransformation&); }; // class QwtScaleTransformation %End // (Qwt_5_0_0 - Qwt_5_0_1) %If (Qwt_5_0_1 - ) class QwtScaleMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: static const double LogMin; static const double LogMax; QwtScaleMap(); QwtScaleMap(const QwtScaleMap&); ~QwtScaleMap(); // Not Pythonic: QwtScaleMap& operator=(const QwtScaleMap&); void setTransformation(QwtScaleTransformation* /Transfer/); const QwtScaleTransformation* transformation() const; void setPaintInterval(int, int); void setPaintXInterval(double, double); void setScaleInterval(double, double); int transform(double) const; double invTransform(double) const; double xTransform(double) const; double p1() const; double p2() const; double s1() const; double s2() const; double pDist() const; double sDist() const; public: QwtScaleMap(int, int, double, double); %MethodCode sipCpp = new QwtScaleMap(); sipCpp->setPaintInterval(a0, a1); sipCpp->setScaleInterval(a2, a3); %End }; // class QwtScaleMap class QwtScaleTransformation { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Type { Linear, Log10, Other }; // enum Type QwtScaleTransformation(QwtScaleTransformation::Type); virtual ~QwtScaleTransformation(); virtual double xForm(double, double, double, double, double) const; virtual double invXForm(double, double, double, double, double) const; QwtScaleTransformation::Type type() const; virtual QwtScaleTransformation* copy() const /Factory/; private: QwtScaleTransformation(); private: QwtScaleTransformation(const QwtScaleTransformation&); }; // class QwtScaleTransformation %End // (Qwt_5_0_1 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_compass_rose.sip0000444000175000017500000000466211130210270022064 0ustar poxpox// The SIP interface specification for: // QwtCompassRose, // QwtSimpleCompassRose. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtCompassRose { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual ~QwtCompassRose(); virtual void setPalette(const QPalette&); const QPalette& palette() const; virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const = 0; }; // class QwtCompassRose class QwtSimpleCompassRose: QwtCompassRose { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtSimpleCompassRose(int = 8, int = -1); void setWidth(double); double width() const; void setNumThorns(int); int numThorns() const; void setNumThornLevels(int); int numThornLevels() const; void setShrinkFactor(double); double shrinkFactor() const; virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const; static void drawRose(QPainter*, const QColorGroup&, const QPoint&, int, double, double, int, int, double); }; // class QwtSimpleCompassRose // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_painter.sip0000444000175000017500000001222211172321327021034 0ustar poxpox// The SIP interface specification for: // QwtPainter. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtPainter { %TypeHeaderCode #include %End // %TypeHeaderCode public: static void setMetricsMap(const QPaintDevice*, const QPaintDevice*); static void setMetricsMap(const QwtMetricsMap&); static void resetMetricsMap(); static const QwtMetricsMap& metricsMap(); static void setDeviceClipping(bool); static bool deviceClipping(); static void setClipRect(QPainter*, const QRect&); static void drawText(QPainter*, int, int, const QString&); static void drawText(QPainter*, const QPoint&, const QString&); static void drawText(QPainter*, int, int, int, int, int, const QString&); static void drawText(QPainter*, const QRect&, int, const QString&); static void drawSimpleRichText(QPainter*, const QRect&, int, QSimpleRichText&); static void drawRect(QPainter*, int, int, int, int); static void drawRect(QPainter*, const QRect&); static void fillRect(QPainter*, const QRect&, const QBrush&); static void drawEllipse(QPainter*, const QRect&); static void drawPie(QPainter*, const QRect&, int, int); static void drawLine(QPainter*, int, int, int, int); static void drawLine(QPainter*, const QPoint&, const QPoint&); static void drawPolygon(QPainter*, const QwtPolygon&); static void drawPolyline(QPainter*, const QwtPolygon&); static void drawPoint(QPainter*, int, int); static void drawRoundFrame(QPainter*, const QRect&, int, const QColorGroup&, bool); static void drawFocusRect(QPainter*, QWidget*); static void drawFocusRect(QPainter*, QWidget*, const QRect&); static QwtPolygon clip(const QwtPolygon&); static void drawColorBar(QPainter*, const QwtColorMap&, const QwtDoubleInterval&, const QwtScaleMap&, Qt::Orientation, const QRect&); static void setSVGMode(bool); static bool isSVGMode(); }; // class QwtPainter %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtPainter { %TypeHeaderCode #include %End // %TypeHeaderCode public: static void setMetricsMap(const QPaintDevice*, const QPaintDevice*); static void setMetricsMap(const QwtMetricsMap&); static void resetMetricsMap(); static const QwtMetricsMap& metricsMap(); static void setDeviceClipping(bool); static bool deviceClipping(); static const QRect& deviceClipRect(); static void setClipRect(QPainter*, const QRect&); static void drawText(QPainter*, int, int, const QString&); static void drawText(QPainter*, const QPoint&, const QString&); static void drawText(QPainter*, int, int, int, int, int, const QString&); static void drawText(QPainter*, const QRect&, int, const QString&); static void drawSimpleRichText(QPainter*, const QRect&, int, QSimpleRichText&); static void drawRect(QPainter*, int, int, int, int); static void drawRect(QPainter*, const QRect&); static void fillRect(QPainter*, const QRect&, const QBrush&); static void drawEllipse(QPainter*, const QRect&); static void drawPie(QPainter*, const QRect&, int, int); static void drawLine(QPainter*, int, int, int, int); static void drawLine(QPainter*, const QPoint&, const QPoint&); static void drawPolygon(QPainter*, const QwtPolygon&); static void drawPolyline(QPainter*, const QwtPolygon&); static void drawPoint(QPainter*, int, int); static void drawRoundFrame(QPainter*, const QRect&, int, const QColorGroup&, bool); static void drawFocusRect(QPainter*, QWidget*); static void drawFocusRect(QPainter*, QWidget*, const QRect&); static void drawColorBar(QPainter*, const QwtColorMap&, const QwtDoubleInterval&, const QwtScaleMap&, Qt::Orientation, const QRect&); static void setSVGMode(bool); static bool isSVGMode(); static QPen scaledPen(const QPen&); }; // class QwtPainter %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/QwtArrayDouble.sip0000444000175000017500000001074211130210270021375 0ustar poxpox// The SIP interface specification for: // QwtArrayDouble. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrayDouble { %TypeHeaderCode #include typedef QwtArray QwtArrayDouble; %End // %TypeHeaderCode public: QwtArrayDouble(); QwtArrayDouble(int); QwtArrayDouble(const QwtArrayDouble &); QwtArrayDouble(SIP_PYOBJECT); %MethodCode QwtArray array; // Numeric is not thread-safe if (-1 == try_PyObject_to_QwtArray(a0, array)) return 0; sipCpp = new QwtArrayDouble(array); %End // QwtArrayDouble() ~QwtArrayDouble(); // not possible: QwtArray &operator=(const QArray &); // not Pythonic: type *data() const; // not Pythonic: uint nrefs() const; uint size() const; uint count() const; bool isEmpty() const; bool isNull() const; bool resize(uint); bool truncate(uint); bool fill(const double, int = -1); void detach(); QwtArrayDouble copy() const; QwtArrayDouble & assign(const QwtArrayDouble &); // not Pythonic: QwtArray & assign(const type *, uint); QwtArrayDouble & duplicate(const QwtArrayDouble &); // not Pythonic: QwtArray & duplicate(const type *, uint); // not Pythonic: QwtArray & setRawData(const type *, uint); // not Pythonic: void resetRawData(const type *, uint); int find(const double &, uint = 0) const; int contains(const double &) const; void sort(); int bsearch(const double &) const; // see __getitem__: type & operator[](int) const; double /* & */ at(uint) const; // pulls in unwanted operators: bool operator==(const QwtArrayDouble &) const; // pulls in unwanted operators: bool operator!=(const QwtArrayDouble &) const; // No iterators, yet: Iterator begin(); // No iterators, yet: Iterator end(); // No iterators, yet: ConstIterator begin() const; // No iterators, yet: ConstIterator end() const; double __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = (*sipCpp)[a0]; %End // __getitem__() int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End // __len__() void __setitem__(int, double); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = a1; %End // __setitem__() void __setitem__(SIP_PYSLICE, const QwtArrayDouble &); %MethodCode int len = sipCpp -> size(); Py_ssize_t start, stop, step, slicelength; if (0 > sipConvertFromSliceObject(a0, len, &start, &stop, &step, &slicelength)) sipIsErr = 1; else { int vlen = a1 -> size(); if (vlen != slicelength) { sipBadLengthForSlice(vlen, slicelength); sipIsErr = 1; } else { QwtArrayDouble::ConstIterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[int(start)] = *it; start += step; ++it; } } } %End // __setitem__() }; // class QwtArrayDouble // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_dial.sip0000444000175000017500000001600211172321327020303 0ustar poxpox// The SIP interface specification for: // QwtDial, // QwtDialScaleDraw. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtDial: QwtAbstractSlider { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Shadow { Plain, Raised, Sunken }; // enum Shadow enum ScaleOptions { ScaleBackbone, ScaleTicks, ScaleLabel }; // enum ScaleOptions enum Mode { RotateNeedle, RotateScale }; // enum Mode QwtDial(QWidget* /TransferThis/ = 0); QwtDial(QWidget*, const char*); virtual ~QwtDial(); void setFrameShadow(QwtDial::Shadow); QwtDial::Shadow frameShadow() const; bool hasVisibleBackground() const; void showBackground(bool); void setLineWidth(int); int lineWidth() const; void setMode(QwtDial::Mode); QwtDial::Mode mode() const; virtual void setWrapping(bool); bool wrapping() const; virtual void setScale(int, int, double = 0.0); void setScaleArc(double, double); void setScaleOptions(int); void setScaleTicks(int, int, int, int = 1); double minScaleArc() const; double maxScaleArc() const; virtual void setOrigin(double); double origin() const; virtual void setNeedle(QwtDialNeedle* /Transfer/); // signature: const QwtDialNeedle* needle() const; QwtDialNeedle* needle(); QRect boundingRect() const; QRect contentsRect() const; virtual QRect scaleContentsRect() const; virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual void setScaleDraw(QwtDialScaleDraw* /Transfer/); QwtDialScaleDraw* scaleDraw(); // signature: const QwtDialScaleDraw* scaleDraw() const; protected: virtual void paintEvent(QPaintEvent*); virtual void resizeEvent(QResizeEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void updateMask(); virtual void drawFrame(QPainter*); virtual void drawContents(QPainter*) const; virtual void drawFocusIndicator(QPainter*) const; virtual void drawScale(QPainter*, const QPoint&, int, double, double, double) const; virtual void drawScaleContents(QPainter*, const QPoint&, int) const; virtual void drawNeedle(QPainter*, const QPoint&, int, double, QPalette::ColorGroup) const; virtual QwtText scaleLabel(double) const; void updateScale(); virtual void rangeChange(); virtual void valueChange(); virtual double getValue(const QPoint&); virtual void getScrollMode(const QPoint&, int& /Out/, int& /Out/); }; // class QwtDial class QwtDialScaleDraw: QwtRoundScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDialScaleDraw(QwtDial*); virtual QwtText label(double) const; void setPenWidth(uint); uint penWidth() const; }; // class QwtDialScaleDraw %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtDial: QwtAbstractSlider { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Shadow { Plain, Raised, Sunken }; // enum Shadow enum ScaleOptions { ScaleBackbone, ScaleTicks, ScaleLabel }; // enum ScaleOptions enum Mode { RotateNeedle, RotateScale }; // enum Mode enum Direction { Clockwise, CounterClockwise }; // enum Direction QwtDial(QWidget* /TransferThis/ = 0); QwtDial(QWidget*, const char*); virtual ~QwtDial(); void setFrameShadow(QwtDial::Shadow); QwtDial::Shadow frameShadow() const; bool hasVisibleBackground() const; void showBackground(bool); void setLineWidth(int); int lineWidth() const; void setMode(QwtDial::Mode); QwtDial::Mode mode() const; virtual void setWrapping(bool); bool wrapping() const; virtual void setScale(int, int, double = 0.0); void setScaleArc(double, double); void setScaleOptions(int); void setScaleTicks(int, int, int, int = 1); double minScaleArc() const; double maxScaleArc() const; virtual void setOrigin(double); double origin() const; void setDirection(QwtDial::Direction); QwtDial::Direction direction() const; virtual void setNeedle(QwtDialNeedle* /Transfer/); // signature: const QwtDialNeedle* needle() const; QwtDialNeedle* needle(); QRect boundingRect() const; QRect contentsRect() const; virtual QRect scaleContentsRect() const; virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual void setScaleDraw(QwtDialScaleDraw* /Transfer/); QwtDialScaleDraw* scaleDraw(); // signature: const QwtDialScaleDraw* scaleDraw() const; protected: virtual void paintEvent(QPaintEvent*); virtual void resizeEvent(QResizeEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void updateMask(); virtual void drawFrame(QPainter*); virtual void drawContents(QPainter*) const; virtual void drawFocusIndicator(QPainter*) const; virtual void drawScale(QPainter*, const QPoint&, int, double, double, double) const; virtual void drawScaleContents(QPainter*, const QPoint&, int) const; virtual void drawNeedle(QPainter*, const QPoint&, int, double, QPalette::ColorGroup) const; virtual QwtText scaleLabel(double) const; void updateScale(); virtual void rangeChange(); virtual void valueChange(); virtual double getValue(const QPoint&); virtual void getScrollMode(const QPoint&, int& /Out/, int& /Out/); }; // class QwtDial class QwtDialScaleDraw: QwtRoundScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDialScaleDraw(QwtDial*); virtual QwtText label(double) const; void setPenWidth(uint); uint penWidth() const; }; // class QwtDialScaleDraw %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_curve_fitter.sip0000444000175000017500000000464711130210270022073 0ustar poxpox// The SIP interface specification for: // QwtCurveFitter, // QwtSplineCurveFitter. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtCurveFitter { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual ~QwtCurveFitter(); virtual QwtArrayQwtDoublePoint fitCurve(const QwtArrayQwtDoublePoint&) const = 0; protected: QwtCurveFitter(); private: QwtCurveFitter(const QwtCurveFitter&); }; // class QwtCurveFitter class QwtSplineCurveFitter: QwtCurveFitter { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum FitMode { Auto, Spline, ParametricSpline }; // enum FitMode QwtSplineCurveFitter(); virtual ~QwtSplineCurveFitter(); void setFitMode(QwtSplineCurveFitter::FitMode); QwtSplineCurveFitter::FitMode fitMode() const; void setSpline(const QwtSpline&); // signature: const QwtSpline& spline() const; QwtSpline& spline(); void setSplineSize(int); int splineSize() const; virtual QwtArrayQwtDoublePoint fitCurve(const QwtArrayQwtDoublePoint&) const; }; // class QwtSplineCurveFitter // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/QwtModule.sip0000444000175000017500000001233311231257033020421 0ustar poxpox// The SIP interface definition for the Qwt module of PyQwt. // // Copyright (C) 2001-2007 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %Module Qwt5.Qwt 0 %Import qt/qtmod.sip %Timeline {Qwt_5_0_0 Qwt_5_0_1 Qwt_5_0_3 Qwt_5_1_0 Qwt_5_1_1 Qwt_5_2_0} %Feature CXX_DYNAMIC_CAST %Feature HAS_NUMARRAY %Feature HAS_NUMERIC %Feature HAS_NUMPY %Feature HAS_PYQT_031105 %Feature HAS_QWT5 %Feature HAS_QWT4 %Feature HAS_QWT_SVG %Include QwtTypes.sip typedef QPointArray QwtPolygon; %If (Qwt_5_1_0 -) typedef QwtArrayQwtDoublePoint QwtPolygonF; %End // (Qwt_5_1_0 -) %ModuleHeaderCode #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #endif #include #include %End %PostInitialisationCode #ifdef HAS_NUMARRAY qwt_import_numarray(); #endif #ifdef HAS_NUMERIC qwt_import_numeric(); #endif #ifdef HAS_NUMPY qwt_import_numpy(); #endif %End // Converter code %Include common/QwtMap.sip %If (!HAS_PYQT_031105) %Include common/QwtMemArray.sip %End // (!HAS_PYQT_031105) %Include common/QwtValueList.sip %Include common/QwtValueStack.sip %Include QwtValueVector.sip // Template code %Include QwtArrayDouble.sip %Include QwtArrayInt.sip %Include QwtArrayQwtDoubleInterval.sip %Include QwtArrayQwtDoublePoint.sip // Wrapper code %Include qwt_abstract_scale.sip %Include qwt_abstract_scale_draw.sip %Include qwt_abstract_slider.sip %Include qwt_analog_clock.sip %Include qwt_arrow_button.sip %If (Qwt_5_1_0 - ) %Include qwt_clipper.sip %End // (Qwt_5_1_0 - ) %Include qwt_color_map.sip %Include qwt_compass.sip %Include qwt_compass_rose.sip %Include qwt_counter.sip %Include qwt_curve_fitter.sip %Include qwt_data.sip %Include qwt_dial.sip %Include qwt_dial_needle.sip %Include qwt_double_interval.sip %Include qwt_double_range.sip %Include qwt_double_rect.sip %Include qwt_dyngrid_layout.sip %Include qwt_event_pattern.sip %Include qwt_interval_data.sip %Include qwt_knob.sip %Include qwt_layout_metrics.sip %Include qwt_legend.sip %Include qwt_legend_item.sip %If (Qwt_5_1_0 - ) %Include qwt_legend_itemmanager.sip %Include qwt_magnifier.sip %End // (Qwt_5_1_0 - ) %Include qwt_paint_buffer.sip %Include qwt_painter.sip %Include qwt_panner.sip %Include qwt_picker.sip %Include qwt_picker_machine.sip %Include qwt_plot.sip %Include qwt_plot_canvas.sip %Include qwt_plot_curve.sip %Include qwt_plot_dict.sip %Include qwt_plot_grid.sip %Include qwt_plot_item.sip %Include qwt_plot_layout.sip %Include qwt_plot_marker.sip %Include qwt_plot_magnifier.sip %Include qwt_plot_panner.sip %Include qwt_plot_picker.sip %Include qwt_plot_printfilter.sip %Include qwt_plot_rasteritem.sip %If (Qwt_5_2_0 - ) %Include qwt_plot_rescaler.sip %End // (Qwt_5_2_0 - ) %If (Qwt_5_1_0 - ) %Include qwt_plot_scaleitem.sip %End // (Qwt_5_1_0 - ) %Include qwt_plot_spectrogram.sip %If (HAS_QWT_SVG) %Include qwt_plot_svgitem.sip %End // HAS_QWT_SVG %Include qwt_plot_zoomer.sip %Include qwt_raster_data.sip %If ( - Qwt_5_2_0) %Include qwt_rect.sip %End // ( - Qwt_5_2_0) %Include qwt_round_scale_draw.sip %Include qwt_scale_div.sip %Include qwt_scale_draw.sip %Include qwt_scale_engine.sip %Include qwt_scale_map.sip %Include qwt_scale_widget.sip %Include qwt_slider.sip %Include qwt_spline.sip %Include qwt_symbol.sip %Include qwt_text.sip %Include qwt_text_engine.sip %Include qwt_text_label.sip %Include qwt_thermo.sip %Include qwt_wheel.sip // qwt_global.h const int QWT_VERSION; const char *QWT_VERSION_STR; // qwt_math.h // Those functions have no equivalent in Python QPoint qwtPolar2Pos(const QPoint&, double, double); QPoint qwtDegree2Pos(const QPoint&, double, double); // Image support QImage toQImage(SIP_PYOBJECT); %MethodCode // Numeric is not thread-safe sipRes = 0; if (-1 == try_PyObject_to_QImage(a0, &sipRes)) return 0; %End %If (HAS_NUMARRAY) SIP_PYOBJECT toNumarray(const QImage&); %End %If (HAS_NUMERIC) SIP_PYOBJECT toNumeric(const QImage&); %End %If (HAS_NUMPY) SIP_PYOBJECT toNumpy(const QImage&); %End // Local Variables: // mode: C++ // c-file-style: "stroustrup" // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_svgitem.sip0000444000175000017500000000410611130210270022074 0ustar poxpox// The SIP interface specification for: // QwtPlotSvgItem. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotSvgItem: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotSvgItem(const QString& = QString::null); QwtPlotSvgItem(const QwtText&); virtual ~QwtPlotSvgItem(); bool loadFile(const QwtDoubleRect&, const QString&); bool loadData(const QwtDoubleRect&, const QByteArray&); virtual QwtDoubleRect boundingRect() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual int rtti() const; protected: void render(QPainter*, const QwtDoubleRect&, const QRect&) const; QwtDoubleRect viewBox(const QwtDoubleRect&) const; }; // class QwtPlotSvgItem // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_arrow_button.sip0000444000175000017500000000404611130210270022110 0ustar poxpox// The SIP interface specification for: // QwtArrowButton. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrowButton: QPushButton { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtArrowButton(int, Qt::ArrowType, QWidget* /TransferThis/ = 0); virtual ~QwtArrowButton(); Qt::ArrowType arrowType() const; int num() const; virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; protected: virtual void drawButtonLabel(QPainter*); virtual void drawArrow(QPainter*, const QRect&, Qt::ArrowType) const; virtual QRect labelRect() const; virtual QSize arrowSize(Qt::ArrowType, const QSize&) const; virtual void keyPressEvent(QKeyEvent*); }; // class QwtArrowButton // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_scaleitem.sip0000444000175000017500000000471411231524514022404 0ustar poxpox// The SIP interface specification for: // QwtPlotScaleItem. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotScaleItem: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotScaleItem(QwtScaleDraw::Alignment = QwtScaleDraw::BottomScale, const double = 0.0); virtual ~QwtPlotScaleItem(); virtual int rtti() const; void setScaleDiv(const QwtScaleDiv&); const QwtScaleDiv& scaleDiv() const; void setScaleDivFromAxis(bool); bool isScaleDivFromAxis() const; void setColorGroup(const QColorGroup&); QColorGroup colorGroup() const; void setFont(const QFont&); QFont font() const; void setScaleDraw(QwtScaleDraw* /Transfer/); // signature: const QwtScaleDraw* scaleDraw() const; QwtScaleDraw* scaleDraw(); void setPosition(double); double position() const; void setBorderDistance(int); int borderDistance() const; void setAlignment(QwtScaleDraw::Alignment); virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual void updateScaleDiv(const QwtScaleDiv&, const QwtScaleDiv&); }; // class QwtPlotScaleItem // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_raster_data.sip0000444000175000017500000000442311130210270021653 0ustar poxpox// The SIP interface specification for: // QwtRasterData. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtRasterData { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum ConrecAttribute { IgnoreAllVerticesOnLevel, IgnoreOutOfRange }; // enum ConrecAttribute QwtRasterData(); QwtRasterData(const QwtDoubleRect&); virtual ~QwtRasterData(); virtual QwtRasterData* copy() const = 0 /Factory/; virtual void setBoundingRect(const QwtDoubleRect&); QwtDoubleRect boundingRect() const; virtual QSize rasterHint(const QwtDoubleRect&) const; virtual void initRaster(const QwtDoubleRect&, const QSize&); virtual void discardRaster(); virtual double value(double, double) const = 0; virtual QwtDoubleInterval range() const = 0; // FIXME: virtual QMap contourLines(const QwtDoubleRect&, const QSize&, const QValueList&, int) const; }; // class QwtRasterData // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot.sip0000444000175000017500000005170011172321327020354 0ustar poxpox// The SIP interface specification for: // QwtPlot. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlot: QFrame, QwtPlotDict { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Axis { yLeft, yRight, xBottom, xTop, axisCnt }; // enum Axis enum LegendPosition { LeftLegend, RightLegend, BottomLegend, TopLegend, ExternalLegend }; // enum LegendPosition QwtPlot(QWidget* /TransferThis/ = 0); QwtPlot(const QwtText&, QWidget* /TransferThis/ = 0); QwtPlot(QWidget*, const char*); virtual ~QwtPlot(); void applyProperties(const QString&); QString grabProperties() const; void setAutoReplot(bool = true); bool autoReplot() const; void print(QPaintDevice&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; virtual void print(QPainter*, const QRect&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; QwtPlotLayout* plotLayout(); // signature: const QwtPlotLayout* plotLayout() const; virtual void setMargin(int); int margin() const; void setTitle(const QString&); void setTitle(const QwtText&); QwtText title() const; QwtTextLabel* titleLabel(); // signature: const QwtTextLabel* titleLabel() const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; void setCanvasBackground(const QColor&); const QColor& canvasBackground() const; void setCanvasLineWidth(int); int canvasLineWidth() const; virtual QwtScaleMap canvasMap(int) const; double invTransform(int, int) const; int transform(int, double) const; QwtScaleEngine* axisScaleEngine(int); // signature: const QwtScaleEngine* axisScaleEngine(int) const; void setAxisScaleEngine(int, QwtScaleEngine* /Transfer/); void setAxisAutoScale(int); bool axisAutoScale(int) const; void enableAxis(int, bool = true); bool axisEnabled(int) const; void setAxisFont(int, const QFont&); QFont axisFont(int) const; void setAxisScale(int, double, double, double = 0); void setAxisScaleDiv(int, const QwtScaleDiv&); void setAxisScaleDraw(int, QwtScaleDraw* /Transfer/); // signature: const QwtScaleDiv* axisScaleDiv(int) const; QwtScaleDiv* axisScaleDiv(int); // signature: const QwtScaleDraw* axisScaleDraw(int) const; QwtScaleDraw* axisScaleDraw(int); // signature: const QwtScaleWidget* axisWidget(int) const; QwtScaleWidget* axisWidget(int); void setAxisLabelAlignment(int, int); void setAxisLabelRotation(int, double); void setAxisTitle(int, const QString&); void setAxisTitle(int, const QwtText&); QwtText axisTitle(int) const; void setAxisMaxMinor(int, int); int axisMaxMajor(int) const; void setAxisMaxMajor(int, int); int axisMaxMinor(int) const; void insertLegend(QwtLegend* /Transfer/, QwtPlot::LegendPosition = QwtPlot::RightLegend, double = -1); QwtLegend* legend(); // signature: const QwtLegend* legend() const; virtual void polish(); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual void updateLayout(); virtual bool event(QEvent*); signals: void legendClicked(QwtPlotItem*); void legendChecked(QwtPlotItem*, bool); public slots: void clear(); virtual void replot(); void autoRefresh(); protected slots: virtual void legendItemClicked(); virtual void legendItemChecked(bool); protected: static bool axisValid(int); virtual void drawCanvas(QPainter*); virtual void drawItems(QPainter*, const QRect&, SIP_PYLIST, const QwtPlotPrintFilter&) const [ void (QPainter*, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&)]; %MethodCode // PyQwt takes a list with QwtScaleMap objects in the first // QwtPlot::axisCnt elements. QwtScaleMap maps[QwtPlot::axisCnt]; sipIsErr = QwtPlot::axisCnt > PyList_GET_SIZE(a2); if (!sipIsErr) { for (int i=0; i(cpp); } } if (!sipIsErr) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_drawItems(sipSelfWasArg, a0, *a1, maps, *a3); Py_END_ALLOW_THREADS } %End %VirtualCatcherCode PyObject *maps = PyList_New(QwtPlot::axisCnt); sipIsErr = !maps; if (!sipIsErr) { for (int i=0; i(&a2[i]), sipClass_QwtScaleMap, 0); if (!object) { sipIsErr = true; break; } PyList_SET_ITEM(maps, i, object); } } if (!sipIsErr) { PyObject *result = sipCallMethod( &sipIsErr, sipMethod, "CCSC", a0, sipClass_QPainter, 0, &a1, sipClass_QRect, 0, maps, &a3, sipClass_QwtPlotPrintFilter, 0); if (result) { sipParseResult(&sipIsErr, sipMethod, result, "Z"); Py_DECREF(result); } } Py_XDECREF(maps); %End virtual void updateTabOrder(); void updateAxes(); virtual void resizeEvent(QResizeEvent*); virtual void printLegendItem(QPainter*, const QWidget*, const QRect&) const; virtual void printTitle(QPainter*, const QRect&) const; virtual void printScale(QPainter*, int, int, int, int, const QRect&) const; virtual void printCanvas(QPainter*, const QRect&, SIP_PYLIST, const QwtPlotPrintFilter&) const [ void (QPainter*, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&)]; %MethodCode // PyQwt takes a list with QwtScaleMap objects in the first // QwtPlot::axisCnt elements. QwtScaleMap maps[QwtPlot::axisCnt]; sipIsErr = QwtPlot::axisCnt > PyList_GET_SIZE(a2); if (!sipIsErr) { for (int i=0; i(cpp); } } if (!sipIsErr) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_printCanvas( sipSelfWasArg, a0, *a1, maps, *a3); Py_END_ALLOW_THREADS } End %VirtualCatcherCode PyObject *maps = PyList_New(QwtPlot::axisCnt); sipIsErr = !maps; if (!sipIsErr) { for (int i=0; i(&a2[i]), sipClass_QwtScaleMap, 0); if (!object) { sipIsErr = true; break; } PyList_SET_ITEM(maps, i, object); } } if (!sipIsErr) { PyObject *result = sipCallMethod( &sipIsErr, sipMethod, "CCSC", a0, sipClass_QPainter, 0, &a1, sipClass_QRect, 0, maps, &a3, sipClass_QwtPrintFilter, 0); if (result) { sipParseResult(&sipIsErr, sipMethod, result, "Z"); Py_DECREF(result); } } Py_XDECREF(maps); %End virtual void printLegend(QPainter*, const QRect&) const; }; // class QwtPlot %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - Qwt_5_2_0) class QwtPlot: QFrame, QwtPlotDict { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Axis { yLeft, yRight, xBottom, xTop, axisCnt }; // enum Axis enum LegendPosition { LeftLegend, RightLegend, BottomLegend, TopLegend, ExternalLegend }; // enum LegendPosition QwtPlot(QWidget* /TransferThis/ = 0); QwtPlot(const QwtText&, QWidget* /TransferThis/ = 0); QwtPlot(QWidget*, const char*); virtual ~QwtPlot(); void applyProperties(const QString&); QString grabProperties() const; void setAutoReplot(bool = true); bool autoReplot() const; void print(QPaintDevice&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; virtual void print(QPainter*, const QRect&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; QwtPlotLayout* plotLayout(); // signature: const QwtPlotLayout* plotLayout() const; virtual void setMargin(int); int margin() const; void setTitle(const QString&); void setTitle(const QwtText&); QwtText title() const; QwtTextLabel* titleLabel(); // signature: const QwtTextLabel* titleLabel() const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; void setCanvasBackground(const QColor&); const QColor& canvasBackground() const; void setCanvasLineWidth(int); int canvasLineWidth() const; virtual QwtScaleMap canvasMap(int) const; double invTransform(int, int) const; int transform(int, double) const; QwtScaleEngine* axisScaleEngine(int); // signature: const QwtScaleEngine* axisScaleEngine(int) const; void setAxisScaleEngine(int, QwtScaleEngine* /Transfer/); void setAxisAutoScale(int); bool axisAutoScale(int) const; void enableAxis(int, bool = true); bool axisEnabled(int) const; void setAxisFont(int, const QFont&); QFont axisFont(int) const; void setAxisScale(int, double, double, double = 0); void setAxisScaleDiv(int, const QwtScaleDiv&); void setAxisScaleDraw(int, QwtScaleDraw* /Transfer/); double axisStepSize(int) const; // signature: const QwtScaleDiv* axisScaleDiv(int) const; QwtScaleDiv* axisScaleDiv(int); // signature: const QwtScaleDraw* axisScaleDraw(int) const; QwtScaleDraw* axisScaleDraw(int); // signature: const QwtScaleWidget* axisWidget(int) const; QwtScaleWidget* axisWidget(int); void setAxisLabelAlignment(int, int); void setAxisLabelRotation(int, double); void setAxisTitle(int, const QString&); void setAxisTitle(int, const QwtText&); QwtText axisTitle(int) const; void setAxisMaxMinor(int, int); int axisMaxMajor(int) const; void setAxisMaxMajor(int, int); int axisMaxMinor(int) const; void insertLegend(QwtLegend* /Transfer/, QwtPlot::LegendPosition = QwtPlot::RightLegend, double = -1); QwtLegend* legend(); // signature: const QwtLegend* legend() const; virtual void polish(); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual void updateLayout(); virtual bool event(QEvent*); signals: void legendClicked(QwtPlotItem*); void legendChecked(QwtPlotItem*, bool); public slots: virtual void clear(); virtual void replot(); void autoRefresh(); protected slots: virtual void legendItemClicked(); virtual void legendItemChecked(bool); protected: static bool axisValid(int); virtual void drawCanvas(QPainter*); virtual void drawItems(QPainter*, const QRect&, SIP_PYLIST, const QwtPlotPrintFilter&) const [ void (QPainter*, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&)]; %MethodCode // PyQwt takes a list with QwtScaleMap objects in the first // QwtPlot::axisCnt elements. QwtScaleMap maps[QwtPlot::axisCnt]; sipIsErr = QwtPlot::axisCnt > PyList_GET_SIZE(a2); if (!sipIsErr) { for (int i=0; i(cpp); } } if (!sipIsErr) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_drawItems(sipSelfWasArg, a0, *a1, maps, *a3); Py_END_ALLOW_THREADS } %End %VirtualCatcherCode PyObject *maps = PyList_New(QwtPlot::axisCnt); sipIsErr = !maps; if (!sipIsErr) { for (int i=0; i(&a2[i]), sipClass_QwtScaleMap, 0); if (!object) { sipIsErr = true; break; } PyList_SET_ITEM(maps, i, object); } } if (!sipIsErr) { PyObject *result = sipCallMethod( &sipIsErr, sipMethod, "CCSC", a0, sipClass_QPainter, 0, &a1, sipClass_QRect, 0, maps, &a3, sipClass_QwtPlotPrintFilter, 0); if (result) { sipParseResult(&sipIsErr, sipMethod, result, "Z"); Py_DECREF(result); } } Py_XDECREF(maps); %End virtual void updateTabOrder(); void updateAxes(); virtual void resizeEvent(QResizeEvent*); virtual void printLegendItem(QPainter*, const QWidget*, const QRect&) const; virtual void printTitle(QPainter*, const QRect&) const; virtual void printScale(QPainter*, int, int, int, int, const QRect&) const; virtual void printCanvas(QPainter*, const QRect&, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&) const; virtual void printLegend(QPainter*, const QRect&) const; }; // class QwtPlot %End // (Qwt_5_1_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtPlot: QFrame, QwtPlotDict { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Axis { yLeft, yRight, xBottom, xTop, axisCnt }; // enum Axis enum LegendPosition { LeftLegend, RightLegend, BottomLegend, TopLegend, ExternalLegend }; // enum LegendPosition QwtPlot(QWidget* /TransferThis/ = 0); QwtPlot(const QwtText&, QWidget* /TransferThis/ = 0); QwtPlot(QWidget*, const char*); virtual ~QwtPlot(); void applyProperties(const QString&); QString grabProperties() const; void setAutoReplot(bool = true); bool autoReplot() const; void print(QPaintDevice&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; virtual void print(QPainter*, const QRect&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; QwtPlotLayout* plotLayout(); // signature: const QwtPlotLayout* plotLayout() const; virtual void setMargin(int); int margin() const; void setTitle(const QString&); void setTitle(const QwtText&); QwtText title() const; QwtTextLabel* titleLabel(); // signature: const QwtTextLabel* titleLabel() const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; void setCanvasBackground(const QColor&); const QColor& canvasBackground() const; void setCanvasLineWidth(int); int canvasLineWidth() const; virtual QwtScaleMap canvasMap(int) const; double invTransform(int, int) const; int transform(int, double) const; QwtScaleEngine* axisScaleEngine(int); // signature: const QwtScaleEngine* axisScaleEngine(int) const; void setAxisScaleEngine(int, QwtScaleEngine* /Transfer/); void setAxisAutoScale(int); bool axisAutoScale(int) const; void enableAxis(int, bool = true); bool axisEnabled(int) const; void setAxisFont(int, const QFont&); QFont axisFont(int) const; void setAxisScale(int, double, double, double = 0); void setAxisScaleDiv(int, const QwtScaleDiv&); void setAxisScaleDraw(int, QwtScaleDraw* /Transfer/); double axisStepSize(int) const; // signature: const QwtScaleDiv* axisScaleDiv(int) const; QwtScaleDiv* axisScaleDiv(int); // signature: const QwtScaleDraw* axisScaleDraw(int) const; QwtScaleDraw* axisScaleDraw(int); // signature: const QwtScaleWidget* axisWidget(int) const; QwtScaleWidget* axisWidget(int); void setAxisLabelAlignment(int, int); void setAxisLabelRotation(int, double); void setAxisTitle(int, const QString&); void setAxisTitle(int, const QwtText&); QwtText axisTitle(int) const; void setAxisMaxMinor(int, int); int axisMaxMajor(int) const; void setAxisMaxMajor(int, int); int axisMaxMinor(int) const; void insertLegend(QwtLegend* /Transfer/, QwtPlot::LegendPosition = QwtPlot::RightLegend, double = -1); QwtLegend* legend(); // signature: const QwtLegend* legend() const; virtual void polish(); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual void updateLayout(); virtual void drawCanvas(QPainter*); void updateAxes(); virtual bool event(QEvent*); signals: void legendClicked(QwtPlotItem*); void legendChecked(QwtPlotItem*, bool); public slots: virtual void clear(); virtual void replot(); void autoRefresh(); protected slots: virtual void legendItemClicked(); virtual void legendItemChecked(bool); protected: static bool axisValid(int); virtual void drawItems(QPainter*, const QRect&, SIP_PYLIST, const QwtPlotPrintFilter&) const [ void (QPainter*, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&)]; %MethodCode // PyQwt takes a list with QwtScaleMap objects in the first // QwtPlot::axisCnt elements. QwtScaleMap maps[QwtPlot::axisCnt]; sipIsErr = QwtPlot::axisCnt > PyList_GET_SIZE(a2); if (!sipIsErr) { for (int i=0; i(cpp); } } if (!sipIsErr) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_drawItems(sipSelfWasArg, a0, *a1, maps, *a3); Py_END_ALLOW_THREADS } %End %VirtualCatcherCode PyObject *maps = PyList_New(QwtPlot::axisCnt); sipIsErr = !maps; if (!sipIsErr) { for (int i=0; i(&a2[i]), sipClass_QwtScaleMap, 0); if (!object) { sipIsErr = true; break; } PyList_SET_ITEM(maps, i, object); } } if (!sipIsErr) { PyObject *result = sipCallMethod( &sipIsErr, sipMethod, "CCSC", a0, sipClass_QPainter, 0, &a1, sipClass_QRect, 0, maps, &a3, sipClass_QwtPlotPrintFilter, 0); if (result) { sipParseResult(&sipIsErr, sipMethod, result, "Z"); Py_DECREF(result); } } Py_XDECREF(maps); %End virtual void updateTabOrder(); virtual void resizeEvent(QResizeEvent*); virtual void printLegendItem(QPainter*, const QWidget*, const QRect&) const; virtual void printTitle(QPainter*, const QRect&) const; virtual void printScale(QPainter*, int, int, int, int, const QRect&) const; virtual void printCanvas(QPainter*, const QRect&, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&) const; virtual void printLegend(QPainter*, const QRect&) const; }; // class QwtPlot %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_round_scale_draw.sip0000444000175000017500000000421611130210270022675 0ustar poxpox// The SIP interface specification for: // QwtRoundScaleDraw. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtRoundScaleDraw: QwtAbstractScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtRoundScaleDraw(); QwtRoundScaleDraw(const QwtRoundScaleDraw&); virtual ~QwtRoundScaleDraw(); // Not Pythonic: QwtRoundScaleDraw& operator=(const QwtRoundScaleDraw&); void setRadius(int); int radius() const; void moveCenter(int, int); void moveCenter(const QPoint&); QPoint center() const; void setAngleRange(double, double); virtual int extent(const QPen&, const QFont&) const; protected: virtual void drawTick(QPainter*, double, int) const; virtual void drawBackbone(QPainter*) const; virtual void drawLabel(QPainter*, double) const; }; // class QwtRoundScaleDraw // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_rect.sip0000444000175000017500000000414511130210270020320 0ustar poxpox// The SIP interface specification for: // QwtRect. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtRect: QRect { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtRect(); QwtRect(const QRect&); QwtPolygon clip(const QwtPolygon&) const; }; // class QwtRect %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - Qwt_5_1_1) class QwtRect: QRect { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtRect(); QwtRect(const QRect&); }; // class QwtRect %End // (Qwt_5_1_0 - Qwt_5_1_1) %If (Qwt_5_1_1 - ) class QwtRect: QRect { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtRect(); QwtRect(const QRect&); QwtPolygon clip(const QwtPolygon&) const; }; // class QwtRect %End // (Qwt_5_1_1 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_paint_buffer.sip0000444000175000017500000000362511130210270022031 0ustar poxpox// The SIP interface specification for: // QwtPaintBuffer. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPaintBuffer { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPaintBuffer(); QwtPaintBuffer(QPaintDevice*, const QRect&, QPainter* = 0); virtual ~QwtPaintBuffer(); void open(QPaintDevice*, const QRect&, QPainter* = 0); void close(); QPainter* painter(); const QPaintDevice* device(); static void setEnabled(bool); static bool isEnabled(); const QPixmap& buffer() const; protected: void flush(); }; // class QwtPaintBuffer // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_symbol.sip0000444000175000017500000000725011130210270020670 0ustar poxpox// The SIP interface specification for: // QwtSymbol. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtSymbol { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Style { NoSymbol, Ellipse, Rect, Diamond, Triangle, DTriangle, UTriangle, LTriangle, RTriangle, Cross, XCross, HLine, VLine, Star1, Star2, Hexagon, StyleCnt }; // enum Style QwtSymbol(); QwtSymbol(QwtSymbol::Style, const QBrush&, const QPen&, const QSize&); virtual ~QwtSymbol(); bool operator!=(const QwtSymbol&) const; bool operator==(const QwtSymbol&) const; void setSize(const QSize&); void setSize(int, int = -1); void setBrush(const QBrush&); void setPen(const QPen&); void setStyle(QwtSymbol::Style); const QBrush& brush() const; const QPen& pen() const; const QSize& size() const; QwtSymbol::Style style() const; void draw(QPainter*, const QPoint&) const; void draw(QPainter*, int, int) const; virtual void draw(QPainter*, const QRect&) const; }; // class QwtSymbol %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtSymbol { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Style { NoSymbol, Ellipse, Rect, Diamond, Triangle, DTriangle, UTriangle, LTriangle, RTriangle, Cross, XCross, HLine, VLine, Star1, Star2, Hexagon, StyleCnt }; // enum Style QwtSymbol(); QwtSymbol(QwtSymbol::Style, const QBrush&, const QPen&, const QSize&); virtual ~QwtSymbol(); bool operator!=(const QwtSymbol&) const; virtual bool operator==(const QwtSymbol&) const; virtual QwtSymbol* clone() const /Factory/; void setSize(const QSize&); void setSize(int, int = -1); void setBrush(const QBrush&); void setPen(const QPen&); void setStyle(QwtSymbol::Style); const QBrush& brush() const; const QPen& pen() const; const QSize& size() const; QwtSymbol::Style style() const; void draw(QPainter*, const QPoint&) const; void draw(QPainter*, int, int) const; virtual void draw(QPainter*, const QRect&) const; }; // class QwtSymbol %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_curve.sip0000444000175000017500000001136511130210270021547 0ustar poxpox// The SIP interface specification for: // QwtPlotCurve. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotCurve: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum CurveType { Yfx, Xfy }; // enum CurveType enum CurveStyle { NoCurve, Lines, Sticks, Steps, Dots, UserCurve }; // enum CurveStyle enum CurveAttribute { Inverted, Fitted }; // enum CurveAttribute enum PaintAttribute { PaintFiltered, ClipPolygons }; // enum PaintAttribute QwtPlotCurve(); QwtPlotCurve(const QwtText&); QwtPlotCurve(const QString&); virtual ~QwtPlotCurve(); virtual int rtti() const; void setCurveType(QwtPlotCurve::CurveType); QwtPlotCurve::CurveType curveType() const; void setPaintAttribute(QwtPlotCurve::PaintAttribute, bool = true); bool testPaintAttribute(QwtPlotCurve::PaintAttribute) const; // Not Pythonic: void setRawData(const double*, const double*, int); void setData(SIP_PYOBJECT, SIP_PYOBJECT); %MethodCode QwtArray xArray; if (-1 == try_PyObject_to_QwtArray(a0, xArray)) return 0; QwtArray yArray; if (-1 == try_PyObject_to_QwtArray(a1, yArray)) return 0; sipCpp->QwtPlotCurve::setData(xArray, yArray); %End void setData(const QwtArrayDouble&, const QwtArrayDouble&); void setData(const QwtArrayQwtDoublePoint&); void setData(const QwtData&); int closestPoint(const QPoint&, double* = 0) const; QwtData& data(); // signature: const QwtData& data() const; int dataSize() const; double x(int) const; double y(int) const; virtual QwtDoubleRect boundingRect() const; double minXValue() const; double maxXValue() const; double minYValue() const; double maxYValue() const; void setCurveAttribute(QwtPlotCurve::CurveAttribute, bool = true); bool testCurveAttribute(QwtPlotCurve::CurveAttribute) const; void setPen(const QPen&); const QPen& pen() const; void setBrush(const QBrush&); const QBrush& brush() const; void setBaseline(double); double baseline() const; void setStyle(QwtPlotCurve::CurveStyle); QwtPlotCurve::CurveStyle style() const; void setSymbol(const QwtSymbol&); const QwtSymbol& symbol() const; void setCurveFitter(QwtCurveFitter* /Transfer/); QwtCurveFitter* curveFitter() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, int, int) const /PyName=drawFromTo/; void draw(int, int) const; virtual void updateLegend(QwtLegend*) const; protected: void init(); virtual void drawCurve(QPainter*, int, const QwtScaleMap&, const QwtScaleMap&, int, int) const; virtual void drawSymbols(QPainter*, const QwtSymbol&, const QwtScaleMap&, const QwtScaleMap&, int, int) const; void drawLines(QPainter*, const QwtScaleMap&, const QwtScaleMap&, int, int) const; void drawSticks(QPainter*, const QwtScaleMap&, const QwtScaleMap&, int, int) const; void drawDots(QPainter*, const QwtScaleMap&, const QwtScaleMap&, int, int) const; void drawSteps(QPainter*, const QwtScaleMap&, const QwtScaleMap&, int, int) const; void fillCurve(QPainter*, const QwtScaleMap&, const QwtScaleMap&, QwtPolygon&) const; void closePolyline(const QwtScaleMap&, const QwtScaleMap&, QwtPolygon&) const; }; // class QwtPlotCurve // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_magnifier.sip0000444000175000017500000000517711130210270021332 0ustar poxpox// The SIP interface specification for: // QwtMagnifier. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtMagnifier: QObject { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtMagnifier(QWidget* /TransferThis/); virtual ~QwtMagnifier(); QWidget* parentWidget(); // signature: const QWidget* parentWidget() const; void setEnabled(bool); bool isEnabled() const; void setMouseFactor(double); double mouseFactor() const; void setMouseButton(int, int = Qt::NoButton); void getMouseButton(int&, int&) const; void setWheelFactor(double); double wheelFactor() const; void setWheelButtonState(int); int wheelButtonState() const; void setKeyFactor(double); double keyFactor() const; void setZoomInKey(int, int); void getZoomInKey(int&, int&) const; void setZoomOutKey(int, int); void getZoomOutKey(int&, int&) const; virtual bool eventFilter(QObject*, QEvent*); protected: virtual void rescale(double) = 0; virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetWheelEvent(QWheelEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); }; // class QwtMagnifier // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_picker.sip0000444000175000017500000001015611172321327021711 0ustar poxpox// The SIP interface specification for: // QwtPlotPicker. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtPlotPicker: QwtPicker { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotPicker(QwtPlotCanvas* /TransferThis/); QwtPlotPicker(int, int, QwtPlotCanvas* /TransferThis/); QwtPlotPicker(int, int, int, QwtPicker::RubberBand, QwtPicker::DisplayMode, QwtPlotCanvas* /TransferThis/); virtual void setAxis(int, int); int xAxis() const; int yAxis() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; signals: void selected(const QwtDoublePoint&); void selected(const QwtDoubleRect&); void selected(const QwtArrayQwtDoublePoint&); void appended(const QwtDoublePoint&); void moved(const QwtDoublePoint&); protected: QwtDoubleRect scaleRect() const; QwtDoubleRect invTransform(const QRect&) const; QRect transform(const QwtDoubleRect&) const; QwtDoublePoint invTransform(const QPoint&) const; QPoint transform(const QwtDoublePoint&) const; virtual QwtText trackerText(const QPoint&) const; virtual QwtText trackerText(const QwtDoublePoint&) const /PyName=trackerTextF/; virtual void move(const QPoint&); virtual void append(const QPoint&); virtual bool end(bool = true); }; // class QwtPlotPicker %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtPlotPicker: QwtPicker { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotPicker(QwtPlotCanvas* /TransferThis/); virtual ~QwtPlotPicker(); QwtPlotPicker(int, int, QwtPlotCanvas* /TransferThis/); QwtPlotPicker(int, int, int, QwtPicker::RubberBand, QwtPicker::DisplayMode, QwtPlotCanvas* /TransferThis/); virtual void setAxis(int, int); int xAxis() const; int yAxis() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; signals: void selected(const QwtDoublePoint&); void selected(const QwtDoubleRect&); void selected(const QwtArrayQwtDoublePoint&); void appended(const QwtDoublePoint&); void moved(const QwtDoublePoint&); protected: QwtDoubleRect scaleRect() const; QwtDoubleRect invTransform(const QRect&) const; QRect transform(const QwtDoubleRect&) const; QwtDoublePoint invTransform(const QPoint&) const; QPoint transform(const QwtDoublePoint&) const; virtual QwtText trackerText(const QPoint&) const; virtual QwtText trackerText(const QwtDoublePoint&) const /PyName=trackerTextF/; virtual void move(const QPoint&); virtual void append(const QPoint&); virtual bool end(bool = true); }; // class QwtPlotPicker %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_interval_data.sip0000444000175000017500000000535611172321327022221 0ustar poxpox// The SIP interface specification for: // QwtIntervalData. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtIntervalData { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtIntervalData(); QwtIntervalData(const QMemArray&, const QwtArrayDouble&); void setData(const QMemArray&, const QwtArrayDouble&); size_t size() const; const QwtDoubleInterval& interval(size_t) const; double value(size_t) const; QwtDoubleRect boundingRect() const; QwtIntervalData(const QwtArrayQwtDoubleInterval&, const QwtArrayDouble&); void setData(const QwtArrayQwtDoubleInterval&, const QwtArrayDouble&); }; // class QwtIntervalData %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtIntervalData { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtIntervalData(); QwtIntervalData(const QMemArray&, const QwtArrayDouble&); ~QwtIntervalData(); void setData(const QMemArray&, const QwtArrayDouble&); size_t size() const; const QwtDoubleInterval& interval(size_t) const; double value(size_t) const; QwtDoubleRect boundingRect() const; QwtIntervalData(const QwtArrayQwtDoubleInterval&, const QwtArrayDouble&); void setData(const QwtArrayQwtDoubleInterval&, const QwtArrayDouble&); }; // class QwtIntervalData %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_scale_div.sip0000444000175000017500000001251211172321327021325 0ustar poxpox// The SIP interface specification for: // QwtScaleDiv. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtScaleDiv { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum TickType { NoTick, MinorTick, MediumTick, MajorTick, NTickTypes }; // enum TickType QwtScaleDiv(); QwtScaleDiv(const QwtDoubleInterval&, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a1, *a2, *a3}; sipCpp = new QwtScaleDiv(*a0, ticks); Py_END_ALLOW_THREADS %End QwtScaleDiv(double, double, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a2, *a3, *a4}; sipCpp = new QwtScaleDiv(a0, a1, ticks); Py_END_ALLOW_THREADS %End int operator==(const QwtScaleDiv&) const; int operator!=(const QwtScaleDiv&) const; double lBound() const; double hBound() const; double range() const; bool contains(double) const; const QwtValueList& ticks(int) const; void invalidate(); bool isValid() const; void invert(); }; // class QwtScaleDiv %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - Qwt_5_2_0) class QwtScaleDiv { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum TickType { NoTick, MinorTick, MediumTick, MajorTick, NTickTypes }; // enum TickType QwtScaleDiv(); QwtScaleDiv(const QwtDoubleInterval&, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a1, *a2, *a3}; sipCpp = new QwtScaleDiv(*a0, ticks); Py_END_ALLOW_THREADS %End QwtScaleDiv(double, double, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a2, *a3, *a4}; sipCpp = new QwtScaleDiv(a0, a1, ticks); Py_END_ALLOW_THREADS %End int operator==(const QwtScaleDiv&) const; int operator!=(const QwtScaleDiv&) const; void setInterval(double, double); void setInterval(const QwtDoubleInterval&); QwtDoubleInterval interval() const; double lBound() const; double hBound() const; double range() const; bool contains(double) const; void setTicks(int, const QwtValueList&); const QwtValueList& ticks(int) const; void invalidate(); bool isValid() const; void invert(); }; // class QwtScaleDiv %End // (Qwt_5_1_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtScaleDiv { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum TickType { NoTick, MinorTick, MediumTick, MajorTick, NTickTypes }; // enum TickType QwtScaleDiv(); QwtScaleDiv(const QwtDoubleInterval&, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a1, *a2, *a3}; sipCpp = new QwtScaleDiv(*a0, ticks); Py_END_ALLOW_THREADS %End QwtScaleDiv(double, double, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a2, *a3, *a4}; sipCpp = new QwtScaleDiv(a0, a1, ticks); Py_END_ALLOW_THREADS %End int operator==(const QwtScaleDiv&) const; int operator!=(const QwtScaleDiv&) const; void setInterval(double, double); void setInterval(const QwtDoubleInterval&); QwtDoubleInterval interval() const; double lowerBound() const; double upperBound() const; double range() const; bool contains(double) const; void setTicks(int, const QwtValueList&); const QwtValueList& ticks(int) const; void invalidate(); bool isValid() const; void invert(); }; // class QwtScaleDiv %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_abstract_slider.sip0000444000175000017500000001176011163672235022554 0ustar poxpox// The SIP interface specification for: // QwtAbstractSlider. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtAbstractSlider: QWidget, QwtDoubleRange { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum ScrollMode { ScrNone, ScrMouse, ScrTimer, ScrDirect, ScrPage }; // enum ScrollMode QwtAbstractSlider(Qt::Orientation, QWidget* /TransferThis/ = 0); virtual ~QwtAbstractSlider(); void setUpdateTime(int); void stopMoving(); void setTracking(bool); virtual void setMass(double); virtual double mass() const; virtual void setOrientation(Qt::Orientation); Qt::Orientation orientation() const; bool isReadOnly() const; bool isValid() const; void setValid(bool); public slots: virtual void setValue(double); virtual void fitValue(double); virtual void incValue(int); virtual void setReadOnly(bool); signals: void valueChanged(double); void sliderPressed(); void sliderReleased(); void sliderMoved(double); protected: virtual void setPosition(const QPoint&); virtual void valueChange(); virtual void timerEvent(QTimerEvent*); virtual void mousePressEvent(QMouseEvent*); virtual void mouseReleaseEvent(QMouseEvent*); virtual void mouseMoveEvent(QMouseEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void wheelEvent(QWheelEvent*); virtual double getValue(const QPoint&) = 0; virtual void getScrollMode(const QPoint&, int&, int&) = 0; void setMouseOffset(double); double mouseOffset() const; int scrollMode() const; // python mksccode PyQt4.Qwt5 %ConvertToSubClassCode static struct class_graph { const char *name; sipWrapperType **type; int yes, no; } graph[] = { {sipName_QwtAbstractSlider, &sipClass_QwtAbstractSlider, 13, 1}, #if QWT_VERSION >= 0x050100 {sipName_QwtPanner, &sipClass_QwtPanner, 19, 2}, #else {0, 0, 19, 2}, #endif {sipName_QwtDynGridLayout, &sipClass_QwtDynGridLayout, -1, 3}, {sipName_QwtCounter, &sipClass_QwtCounter, -1, 4}, {sipName_QwtLegend, &sipClass_QwtLegend, -1, 5}, {sipName_QwtArrowButton, &sipClass_QwtArrowButton, -1, 6}, {sipName_QwtScaleWidget, &sipClass_QwtScaleWidget, -1, 7}, {sipName_QwtTextLabel, &sipClass_QwtTextLabel, 20, 8}, {sipName_QwtPlotCanvas, &sipClass_QwtPlotCanvas, -1, 9}, {sipName_QwtThermo, &sipClass_QwtThermo, -1, 10}, #if QWT_VERSION >= 0x050100 {sipName_QwtMagnifier, &sipClass_QwtMagnifier, 21, 11}, #else {0, 0, 21, 11}, #endif {sipName_QwtPlot, &sipClass_QwtPlot, -1, 12}, {sipName_QwtPicker, &sipClass_QwtPicker, 22, -1}, {sipName_QwtDial, &sipClass_QwtDial, 17, 14}, {sipName_QwtSlider, &sipClass_QwtSlider, -1, 15}, {sipName_QwtWheel, &sipClass_QwtWheel, -1, 16}, {sipName_QwtKnob, &sipClass_QwtKnob, -1, -1}, {sipName_QwtAnalogClock, &sipClass_QwtAnalogClock, -1, 18}, {sipName_QwtCompass, &sipClass_QwtCompass, -1, -1}, {sipName_QwtPlotPanner, &sipClass_QwtPlotPanner, -1, -1}, {sipName_QwtLegendItem, &sipClass_QwtLegendItem, -1, -1}, {sipName_QwtPlotMagnifier, &sipClass_QwtPlotMagnifier, -1, -1}, {sipName_QwtPlotPicker, &sipClass_QwtPlotPicker, 23, -1}, {sipName_QwtPlotZoomer, &sipClass_QwtPlotZoomer, -1, -1}, }; int i = 0; sipClass = NULL; do { struct class_graph *cg = &graph[i]; if (cg->name != NULL && sipCpp->inherits(cg->name)) { sipClass = *cg->type; i = cg->yes; } else { i = cg->no; } } while (i >= 0); %End }; // class QwtAbstractSlider // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_zoomer.sip0000444000175000017500000001016111130210270021727 0ustar poxpox// The SIP interface specification for: // QwtPlotZoomer. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlotZoomer: QwtPlotPicker { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotZoomer(QwtPlotCanvas* /TransferThis/, bool = true); QwtPlotZoomer(int, int, QwtPlotCanvas* /TransferThis/, bool = true); QwtPlotZoomer(int, int, int, QwtPicker::DisplayMode, QwtPlotCanvas* /TransferThis/, bool = true); virtual ~QwtPlotZoomer(); virtual void setZoomBase(); virtual void setZoomBase(const QwtDoubleRect&); QwtDoubleRect zoomBase() const; QwtDoubleRect zoomRect() const; virtual void setAxis(int, int); void setMaxStackDepth(int); int maxStackDepth() const; const QValueStack& zoomStack() const; uint zoomRectIndex() const; virtual void setSelectionFlags(int); public slots: void moveBy(double, double); virtual void move(double, double); virtual void zoom(const QwtDoubleRect&); virtual void zoom(int); signals: void zoomed(const QwtDoubleRect&); protected: virtual void rescale(); virtual QwtDoubleSize minZoomSize() const; virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void begin(); virtual bool end(bool = true); virtual bool accept(QwtPolygon&) const; }; // class QwtPlotZoomer %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPlotZoomer: QwtPlotPicker { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotZoomer(QwtPlotCanvas* /TransferThis/, bool = true); QwtPlotZoomer(int, int, QwtPlotCanvas* /TransferThis/, bool = true); QwtPlotZoomer(int, int, int, QwtPicker::DisplayMode, QwtPlotCanvas* /TransferThis/, bool = true); virtual ~QwtPlotZoomer(); virtual void setZoomBase(bool = true); virtual void setZoomBase(const QwtDoubleRect&); QwtDoubleRect zoomBase() const; QwtDoubleRect zoomRect() const; virtual void setAxis(int, int); void setMaxStackDepth(int); int maxStackDepth() const; const QValueStack& zoomStack() const; void setZoomStack(const QValueStack&, int = -1); uint zoomRectIndex() const; virtual void setSelectionFlags(int); public slots: void moveBy(double, double); virtual void move(double, double); virtual void zoom(const QwtDoubleRect&); virtual void zoom(int); signals: void zoomed(const QwtDoubleRect&); protected: virtual void rescale(); virtual QwtDoubleSize minZoomSize() const; virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void begin(); virtual bool end(bool = true); virtual bool accept(QwtPolygon&) const; }; // class QwtPlotZoomer %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_legend_item.sip0000444000175000017500000001111711172321327021650 0ustar poxpox// The SIP interface specification for: // QwtLegendItem. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtLegendItem: QwtTextLabel { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum IdentifierMode { NoIdentifier, ShowLine, ShowSymbol, ShowText }; // enum IdentifierMode QwtLegendItem(QWidget* /TransferThis/ = 0); QwtLegendItem(const QwtSymbol&, const QPen&, const QwtText&, QWidget* /TransferThis/ = 0); virtual ~QwtLegendItem(); virtual void setText(const QwtText&); void setItemMode(QwtLegend::LegendItemMode); QwtLegend::LegendItemMode itemMode() const; void setIdentifierMode(int); int identifierMode() const; void setIdentfierWidth(int); int identifierWidth() const; void setSpacing(int); int spacing() const; void setSymbol(const QwtSymbol&); const QwtSymbol& symbol() const; void setCurvePen(const QPen&); const QPen& curvePen() const; virtual void drawIdentifier(QPainter*, const QRect&) const; virtual void drawItem(QPainter*, const QRect&) const; virtual QSize sizeHint() const; bool isChecked() const; public slots: void setChecked(bool); signals: void clicked(); void pressed(); void released(); void checked(bool); protected: void setDown(bool); bool isDown() const; virtual void paintEvent(QPaintEvent*); virtual void mousePressEvent(QMouseEvent*); virtual void mouseReleaseEvent(QMouseEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void keyReleaseEvent(QKeyEvent*); virtual void drawText(QPainter*, const QRect&); }; // class QwtLegendItem %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtLegendItem: QwtTextLabel { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum IdentifierMode { NoIdentifier, ShowLine, ShowSymbol, ShowText }; // enum IdentifierMode QwtLegendItem(QWidget* /TransferThis/ = 0); QwtLegendItem(const QwtSymbol&, const QPen&, const QwtText&, QWidget* /TransferThis/ = 0); virtual ~QwtLegendItem(); virtual void setText(const QwtText&); void setItemMode(QwtLegend::LegendItemMode); QwtLegend::LegendItemMode itemMode() const; void setIdentifierMode(int); int identifierMode() const; void setIdentifierWidth(int); int identifierWidth() const; void setSpacing(int); int spacing() const; void setSymbol(const QwtSymbol&); const QwtSymbol& symbol() const; void setCurvePen(const QPen&); const QPen& curvePen() const; virtual void drawIdentifier(QPainter*, const QRect&) const; virtual void drawItem(QPainter*, const QRect&) const; virtual QSize sizeHint() const; bool isChecked() const; public slots: void setChecked(bool); signals: void clicked(); void pressed(); void released(); void checked(bool); protected: void setDown(bool); bool isDown() const; virtual void paintEvent(QPaintEvent*); virtual void mousePressEvent(QMouseEvent*); virtual void mouseReleaseEvent(QMouseEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void keyReleaseEvent(QKeyEvent*); virtual void drawText(QPainter*, const QRect&); }; // class QwtLegendItem %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_rescaler.sip0000444000175000017500000000646311172321327022242 0ustar poxpox// The SIP interface specification for: // QwtPlotRescaler. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotRescaler: QObject { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum RescalePolicy { Fixed, Expanding, Fitting }; // enum RescalePolicy enum ExpandingDirection { ExpandUp, ExpandDown, ExpandBoth }; // enum ExpandingDirection QwtPlotRescaler(QwtPlotCanvas*, int = QwtPlot::xBottom, QwtPlotRescaler::RescalePolicy = Expanding); virtual ~QwtPlotRescaler(); void setEnabled(bool); bool isEnabled() const; void setRescalePolicy(QwtPlotRescaler::RescalePolicy); QwtPlotRescaler::RescalePolicy rescalePolicy() const; void setExpandingDirection(QwtPlotRescaler::ExpandingDirection); void setExpandingDirection(int, QwtPlotRescaler::ExpandingDirection); QwtPlotRescaler::ExpandingDirection expandingDirection(int) const; void setReferenceAxis(int); int referenceAxis() const; void setAspectRatio(double); void setAspectRatio(int, double); double aspectRatio(int) const; void setIntervalHint(int, const QwtDoubleInterval&); QwtDoubleInterval intervalHint(int) const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; virtual bool eventFilter(QObject*, QEvent*); void rescale() const; protected: virtual void canvasResizeEvent(QResizeEvent*); virtual void rescale(const QSize&, const QSize&) const; virtual QwtDoubleInterval expandScale(int, const QSize&, const QSize&) const; virtual QwtDoubleInterval syncScale(int, const QwtDoubleInterval&, const QSize&) const; virtual void updateScales(QwtDoubleInterval*) const; Qt::Orientation orientation(int) const; QwtDoubleInterval interval(int) const; QwtDoubleInterval expandInterval(const QwtDoubleInterval&, double, QwtPlotRescaler::ExpandingDirection) const; }; // class QwtPlotRescaler // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_dyngrid_layout.sip0000444000175000017500000000505211130210270022416 0ustar poxpox// The SIP interface specification for: // QwtDynGridLayout. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtDynGridLayout: QLayout { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDynGridLayout(QWidget* /TransferThis/, int = 0, int = -1); QwtDynGridLayout(QLayout*, int = -1); QwtDynGridLayout(int = -1); virtual ~QwtDynGridLayout(); virtual void invalidate(); void setMaxCols(uint); uint maxCols() const; uint numRows() const; uint numCols() const; virtual void addItem(QLayoutItem* /Transfer/); virtual QLayoutIterator iterator(); void setExpanding(QSizePolicy::ExpandData); virtual QSizePolicy::ExpandData expanding() const; QValueList layoutItems(const QRect&, uint) const; virtual int maxItemWidth() const; virtual void setGeometry(const QRect&); virtual bool hasHeightForWidth() const; virtual int heightForWidth(int) const; virtual QSize sizeHint() const; virtual bool isEmpty() const; uint itemCount() const; virtual uint columnsForWidth(int) const; protected: void layoutGrid(uint, QwtArrayInt&, QwtArrayInt&) const; void stretchGrid(const QRect&, uint, QwtArrayInt&, QwtArrayInt&) const; }; // class QwtDynGridLayout // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/QwtArrayQwtDoubleInterval.sip0000444000175000017500000001234111163711320023603 0ustar poxpox// The SIP interface specification for: // QwtArrayDoubleInterval. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrayQwtDoubleInterval { %TypeHeaderCode #include #include typedef QwtArray QwtArrayQwtDoubleInterval; %End // %TypeHeaderCode public: QwtArrayQwtDoubleInterval(); QwtArrayQwtDoubleInterval(int); QwtArrayQwtDoubleInterval(const QwtArrayQwtDoubleInterval &); QwtArrayQwtDoubleInterval(SIP_PYLIST); %MethodCode // FIXME QwtArray array(PyList_GET_SIZE(a0)); for (int i = 0; i < PyList_GET_SIZE(a0); ++i) { #if SIP_VERSION < 0x040800 void *cpp = sipForceConvertToInstance( PyList_GET_ITEM(a0, i), sipClass_QwtDoubleInterval, NULL, SIP_NO_CONVERTORS, NULL, &sipIsErr); #else void *cpp = sipForceConvertToType( PyList_GET_ITEM(a0, i), sipType_QwtDoubleInterval, NULL, SIP_NO_CONVERTORS, NULL, &sipIsErr); #endif array[i] = *reinterpret_cast(cpp); } sipCpp = new QwtArrayQwtDoubleInterval(array); %End // QwtArrayQwtDoubleInterval() // not Pythonic: type *data() const; // not Pythonic: uint nrefs() const; uint size() const; uint count() const; bool isEmpty() const; bool isNull() const; bool resize(uint); bool truncate(uint); bool fill(const QwtDoubleInterval, int = -1); void detach(); QwtArrayQwtDoubleInterval copy() const; QwtArrayQwtDoubleInterval & assign(const QwtArrayQwtDoubleInterval &); // not Pythonic: QwtArray & assign(const type *, uint); QwtArrayQwtDoubleInterval & duplicate(const QwtArrayQwtDoubleInterval &); // not Pythonic: QwtArray & duplicate(const type *, uint); // not Pythonic: QwtArray & setRawData(const type *, uint); // not Pythonic: void resetRawData(const type *, uint); int find(const QwtDoubleInterval &, uint = 0) const; int contains(const QwtDoubleInterval &) const; void sort(); int bsearch(const QwtDoubleInterval &) const; // see __getitem__: type & operator[](int) const; QwtDoubleInterval & at(uint) const; // pulls in unwanted operators: bool operator==(const QwtArrayQwtDoubleInterval &) const; // pulls in unwanted operators: bool operator!=(const QwtArrayQwtDoubleInterval &) const; // No iterators, yet: Iterator begin(); // No iterators, yet: Iterator end(); // No iterators, yet: ConstIterator begin() const; // No iterators, yes: ConstIterator end() const; QwtDoubleInterval & __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = &(*sipCpp)[a0]; %End // __getitem__() int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End // __len__() void __setitem__(int, QwtDoubleInterval); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = *a1; %End // __setitem__() void __setitem__(SIP_PYSLICE, const QwtArrayQwtDoubleInterval &); %MethodCode int len = sipCpp -> size(); Py_ssize_t start, stop, step, slicelength; if (0 > sipConvertFromSliceObject(a0, len, &start, &stop, &step, &slicelength)) sipIsErr = 1; else { int vlen = a1 -> size(); if (vlen != slicelength) { sipBadLengthForSlice(vlen, slicelength); sipIsErr = 1; } else { QwtArrayQwtDoubleInterval::ConstIterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[int(start)] = *it; start += step; ++it; } } } %End // __setitem__() }; // class QwtArrayQwtDoubleInterval // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_double_range.sip0000444000175000017500000000434311130210270022011 0ustar poxpox// The SIP interface specification for: // QwtDoubleRange. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtDoubleRange { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDoubleRange(); virtual ~QwtDoubleRange(); void setRange(double, double, double = 0.0, int = 1); void setValid(bool); bool isValid() const; virtual void setValue(double); double value() const; void setPeriodic(bool); bool periodic() const; void setStep(double); double step() const; double maxValue() const; double minValue() const; int pageSize() const; virtual void incValue(int); virtual void incPages(int); virtual void fitValue(double); protected: double exactValue() const; double exactPrevValue() const; double prevValue() const; virtual void valueChange(); virtual void stepChange(); virtual void rangeChange(); }; // class QwtDoubleRange // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_scale_widget.sip0000444000175000017500000000666111207550767022051 0ustar poxpox// The SIP interface specification for: // QwtScaleWidget. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtScaleWidget: QWidget { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtScaleWidget(QWidget* = 0); QwtScaleWidget(QWidget*, const char*); QwtScaleWidget(QwtScaleDraw::Alignment, QWidget* /TransferThis/ = 0); virtual ~QwtScaleWidget(); signals: void scaleDivChanged(); public: void setTitle(const QString&); void setTitle(const QwtText&); QwtText title() const; void setBorderDist(int, int); int startBorderDist() const; int endBorderDist() const; void getBorderDistHint(int&, int&) const; void getMinBorderDist(int& /Out/, int& /Out/) const; void setMinBorderDist(int, int); void setMargin(int); int margin() const; void setSpacing(int); int spacing() const; void setPenWidth(int); int penWidth() const; void setScaleDiv(QwtScaleTransformation*, const QwtScaleDiv&); void setScaleDraw(QwtScaleDraw*); // signature: const QwtScaleDraw* scaleDraw() const; QwtScaleDraw* scaleDraw(); void setLabelAlignment(int); void setLabelRotation(double); void setColorBarEnabled(bool); bool isColorBarEnabled() const; void setColorBarWidth(int); int colorBarWidth() const; void setColorMap(const QwtDoubleInterval&, const QwtColorMap&); QwtDoubleInterval colorBarInterval() const; const QwtColorMap& colorMap() const; virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; int titleHeightForWidth(int) const; int dimForLength(int, const QFont&) const; void drawColorBar(QPainter*, const QRect&) const; void drawTitle(QPainter*, QwtScaleDraw::Alignment, const QRect&) const; void setAlignment(QwtScaleDraw::Alignment); QwtScaleDraw::Alignment alignment() const; QRect colorBarRect(const QRect&) const; protected: virtual void paintEvent(QPaintEvent*); virtual void resizeEvent(QResizeEvent*); virtual void fontChange(const QFont&); void draw(QPainter*) const; void scaleChange(); void layoutScale(bool = true); }; // class QwtScaleWidget // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_double_rect.sip0000444000175000017500000002251411130210270021652 0ustar poxpox// The SIP interface specification for: // QwtDoublePoint, // QwtDoubleRect, // QwtDoubleSize. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtDoublePoint { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDoublePoint(); QwtDoublePoint(double, double); QwtDoublePoint(const QPoint&); QPoint toPoint() const; bool isNull() const; double x() const; double y() const; double rx(); double ry(); void setX(double); void setY(double); bool operator==(const QwtDoublePoint&) const; bool operator!=(const QwtDoublePoint&) const; const QwtDoublePoint __neg__() const; const QwtDoublePoint operator+(const QwtDoublePoint&) const; const QwtDoublePoint operator-(const QwtDoublePoint&) const; const QwtDoublePoint operator*(double) const; const QwtDoublePoint operator/(double) const; QwtDoublePoint& __iadd__(const QwtDoublePoint&); QwtDoublePoint& __isub__(const QwtDoublePoint&); QwtDoublePoint& __imul__(double); QwtDoublePoint& __idiv__(double); }; // class QwtDoublePoint class QwtDoubleRect { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDoubleRect(); QwtDoubleRect(double, double, double, double); QwtDoubleRect(const QwtDoublePoint&, const QwtDoubleSize&); bool isNull() const; bool isEmpty() const; bool isValid() const; QwtDoubleRect normalized() const; double x() const; double y() const; double left() const; double right() const; double top() const; double bottom() const; void setX(double); void setY(double); void setLeft(double); void setRight(double); void setTop(double); void setBottom(double); QwtDoublePoint center() const; void moveLeft(double); void moveRight(double); void moveTop(double); void moveBottom(double); void moveTo(double, double); void moveTo(const QwtDoublePoint&); void moveBy(double, double); void moveCenter(const QwtDoublePoint&); void moveCenter(double, double); void setRect(double, double, double, double); double width() const; double height() const; QwtDoubleSize size() const; void setWidth(double); void setHeight(double); void setSize(const QwtDoubleSize&); QwtDoubleRect operator|(const QwtDoubleRect&) const; QwtDoubleRect operator&(const QwtDoubleRect&) const; QwtDoubleRect& __ior__(const QwtDoubleRect&); QwtDoubleRect& __iand__(const QwtDoubleRect&); bool operator==(const QwtDoubleRect&) const; bool operator!=(const QwtDoubleRect&) const; bool contains(const QwtDoublePoint&, bool = false) const; bool contains(double, double, bool = false) const; bool contains(const QwtDoubleRect&, bool = false) const; QwtDoubleRect unite(const QwtDoubleRect&) const; QwtDoubleRect intersect(const QwtDoubleRect&) const; bool intersects(const QwtDoubleRect&) const; }; // class QwtDoubleRect class QwtDoubleSize { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDoubleSize(); QwtDoubleSize(double, double); QwtDoubleSize(const QSize&); bool isNull() const; bool isEmpty() const; bool isValid() const; double width() const; double height() const; void setWidth(double); void setHeight(double); void transpose(); QwtDoubleSize expandedTo(const QwtDoubleSize&) const; QwtDoubleSize boundedTo(const QwtDoubleSize&) const; bool operator==(const QwtDoubleSize&) const; bool operator!=(const QwtDoubleSize&) const; const QwtDoubleSize operator+(const QwtDoubleSize&) const; const QwtDoubleSize operator-(const QwtDoubleSize&) const; const QwtDoubleSize operator*(double) const; const QwtDoubleSize operator/(double) const; QwtDoubleSize& __iadd__(const QwtDoubleSize&); QwtDoubleSize& __isub__(const QwtDoubleSize&); QwtDoubleSize& __imul__(double); QwtDoubleSize& __idiv__(double); }; // class QwtDoubleSize %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtDoublePoint { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDoublePoint(); QwtDoublePoint(double, double); QwtDoublePoint(const QPoint&); QPoint toPoint() const; bool isNull() const; double x() const; double y() const; double rx(); double ry(); void setX(double); void setY(double); bool operator==(const QwtDoublePoint&) const; bool operator!=(const QwtDoublePoint&) const; const QwtDoublePoint __neg__() const; const QwtDoublePoint operator+(const QwtDoublePoint&) const; const QwtDoublePoint operator-(const QwtDoublePoint&) const; const QwtDoublePoint operator*(double) const; const QwtDoublePoint operator/(double) const; QwtDoublePoint& __iadd__(const QwtDoublePoint&); QwtDoublePoint& __isub__(const QwtDoublePoint&); QwtDoublePoint& __imul__(double); QwtDoublePoint& __idiv__(double); }; // class QwtDoublePoint class QwtDoubleRect { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDoubleRect(); QwtDoubleRect(double, double, double, double); QwtDoubleRect(const QwtDoublePoint&, const QwtDoubleSize&); QwtDoubleRect(const QRect&); QRect toRect() const; bool isNull() const; bool isEmpty() const; bool isValid() const; QwtDoubleRect normalized() const; double x() const; double y() const; double left() const; double right() const; double top() const; double bottom() const; void setX(double); void setY(double); void setLeft(double); void setRight(double); void setTop(double); void setBottom(double); QwtDoublePoint center() const; void moveLeft(double); void moveRight(double); void moveTop(double); void moveBottom(double); void moveTo(double, double); void moveTo(const QwtDoublePoint&); void moveBy(double, double); void moveCenter(const QwtDoublePoint&); void moveCenter(double, double); void setRect(double, double, double, double); double width() const; double height() const; QwtDoubleSize size() const; void setWidth(double); void setHeight(double); void setSize(const QwtDoubleSize&); QwtDoubleRect operator|(const QwtDoubleRect&) const; QwtDoubleRect operator&(const QwtDoubleRect&) const; QwtDoubleRect& __ior__(const QwtDoubleRect&); QwtDoubleRect& __iand__(const QwtDoubleRect&); bool operator==(const QwtDoubleRect&) const; bool operator!=(const QwtDoubleRect&) const; bool contains(const QwtDoublePoint&, bool = false) const; bool contains(double, double, bool = false) const; bool contains(const QwtDoubleRect&, bool = false) const; QwtDoubleRect unite(const QwtDoubleRect&) const; QwtDoubleRect intersect(const QwtDoubleRect&) const; bool intersects(const QwtDoubleRect&) const; QwtDoublePoint bottomRight() const; QwtDoublePoint topRight() const; QwtDoublePoint topLeft() const; QwtDoublePoint bottomLeft() const; }; // class QwtDoubleRect class QwtDoubleSize { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDoubleSize(); QwtDoubleSize(double, double); QwtDoubleSize(const QSize&); bool isNull() const; bool isEmpty() const; bool isValid() const; double width() const; double height() const; void setWidth(double); void setHeight(double); void transpose(); QwtDoubleSize expandedTo(const QwtDoubleSize&) const; QwtDoubleSize boundedTo(const QwtDoubleSize&) const; bool operator==(const QwtDoubleSize&) const; bool operator!=(const QwtDoubleSize&) const; const QwtDoubleSize operator+(const QwtDoubleSize&) const; const QwtDoubleSize operator-(const QwtDoubleSize&) const; const QwtDoubleSize operator*(double) const; const QwtDoubleSize operator/(double) const; QwtDoubleSize& __iadd__(const QwtDoubleSize&); QwtDoubleSize& __isub__(const QwtDoubleSize&); QwtDoubleSize& __imul__(double); QwtDoubleSize& __idiv__(double); }; // class QwtDoubleSize %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_item.sip0000444000175000017500000001672411130210270021365 0ustar poxpox// The SIP interface specification for: // QwtPlotItem. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum RttiValues { Rtti_PlotItem, Rtti_PlotGrid, Rtti_PlotMarker, Rtti_PlotCurve, Rtti_PlotHistogram, Rtti_PlotSpectrogram, Rtti_PlotSVG, Rtti_PlotUserItem }; // enum RttiValues enum ItemAttribute { Legend, AutoScale }; // enum ItemAttribute QwtPlotItem(const QwtText& = QwtText(QString::null, QwtText::AutoText)); virtual ~QwtPlotItem(); void attach(QwtPlot* /TransferThis/); void detach(); %MethodCode sipCpp->QwtPlotItem::detach(); sipTransferBack(sipSelf); %End QwtPlot* plot() const; void setTitle(const QString&); void setTitle(const QwtText&); const QwtText& title() const; virtual int rtti() const; void setItemAttribute(QwtPlotItem::ItemAttribute, bool = true); bool testItemAttribute(QwtPlotItem::ItemAttribute) const; double z() const; void setZ(double); void show(); void hide(); virtual void setVisible(bool); bool isVisible() const; void setAxis(int, int); void setXAxis(int); int xAxis() const; void setYAxis(int); int yAxis() const; virtual void itemChanged(); virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const = 0; virtual QwtDoubleRect boundingRect() const; virtual void updateLegend(QwtLegend*) const; virtual void updateScaleDiv(const QwtScaleDiv&, const QwtScaleDiv&); virtual QWidget* legendItem() const; QwtDoubleRect scaleRect(const QwtScaleMap&, const QwtScaleMap&) const; QRect paintRect(const QwtScaleMap&, const QwtScaleMap&) const; QRect transform(const QwtScaleMap&, const QwtScaleMap&, const QwtDoubleRect&) const; QwtDoubleRect invTransform(const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; private: QwtPlotItem(const QwtPlotItem&); %If (HAS_QWT5) %ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS switch (sipCpp->rtti()) { case QwtPlotItem::Rtti_PlotItem: sipClass = sipClass_QwtPlotItem; break; case QwtPlotItem::Rtti_PlotGrid: sipClass = sipClass_QwtPlotGrid; break; #ifdef sipClass_QwtPlotScaleItem case QwtPlotItem::Rtti_PlotScale: sipClass = sipClass_QwtPlotScaleItem; break; #endif // sipClass_QwtPlotScaleItem case QwtPlotItem::Rtti_PlotMarker: sipClass = sipClass_QwtPlotMarker; break; case QwtPlotItem::Rtti_PlotCurve: sipClass = sipClass_QwtPlotCurve; break; #ifdef sipClass_QwtPlotHistogram case QwtPlotItem::Rtti_PlotHistogram: sipClass = sipClass_QwtPlotHistogram; break; #endif // sipClass_QwtPlotHistogram case QwtPlotItem::Rtti_PlotSpectrogram: sipClass = sipClass_QwtPlotSpectrogram; break; #ifdef sipClass_QwtPlotSvgItem case QwtPlotItem::Rtti_PlotSVG: sipClass = sipClass_QwtPlotSvgItem; break; #endif // sipClass_QwtPlotSvgItem default: sipClass = 0; } Py_END_ALLOW_THREADS %End // %ConvertToSubClassCode %End // HAS_QWT5 }; // class QwtPlotItem %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPlotItem: QwtLegendItemManager { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum RttiValues { Rtti_PlotItem, Rtti_PlotGrid, Rtti_PlotScale, Rtti_PlotMarker, Rtti_PlotCurve, Rtti_PlotHistogram, Rtti_PlotSpectrogram, Rtti_PlotSVG, Rtti_PlotUserItem }; // enum RttiValues enum ItemAttribute { Legend, AutoScale }; // enum ItemAttribute QwtPlotItem(const QwtText& = QwtText(QString::null, QwtText::AutoText)); virtual ~QwtPlotItem(); void attach(QwtPlot* /TransferThis/); void detach(); %MethodCode sipCpp->QwtPlotItem::detach(); sipTransferBack(sipSelf); %End QwtPlot* plot() const; void setTitle(const QString&); void setTitle(const QwtText&); const QwtText& title() const; virtual int rtti() const; void setItemAttribute(QwtPlotItem::ItemAttribute, bool = true); bool testItemAttribute(QwtPlotItem::ItemAttribute) const; double z() const; void setZ(double); void show(); void hide(); virtual void setVisible(bool); bool isVisible() const; void setAxis(int, int); void setXAxis(int); int xAxis() const; void setYAxis(int); int yAxis() const; virtual void itemChanged(); virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const = 0; virtual QwtDoubleRect boundingRect() const; virtual void updateLegend(QwtLegend*) const; virtual void updateScaleDiv(const QwtScaleDiv&, const QwtScaleDiv&); virtual QWidget* legendItem() const; QwtDoubleRect scaleRect(const QwtScaleMap&, const QwtScaleMap&) const; QRect paintRect(const QwtScaleMap&, const QwtScaleMap&) const; QRect transform(const QwtScaleMap&, const QwtScaleMap&, const QwtDoubleRect&) const; QwtDoubleRect invTransform(const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; private: QwtPlotItem(const QwtPlotItem&); %If (HAS_QWT5) %ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS switch (sipCpp->rtti()) { case QwtPlotItem::Rtti_PlotItem: sipClass = sipClass_QwtPlotItem; break; case QwtPlotItem::Rtti_PlotGrid: sipClass = sipClass_QwtPlotGrid; break; #ifdef sipClass_QwtPlotScaleItem case QwtPlotItem::Rtti_PlotScale: sipClass = sipClass_QwtPlotScaleItem; break; #endif // sipClass_QwtPlotScaleItem case QwtPlotItem::Rtti_PlotMarker: sipClass = sipClass_QwtPlotMarker; break; case QwtPlotItem::Rtti_PlotCurve: sipClass = sipClass_QwtPlotCurve; break; #ifdef sipClass_QwtPlotHistogram case QwtPlotItem::Rtti_PlotHistogram: sipClass = sipClass_QwtPlotHistogram; break; #endif // sipClass_QwtPlotHistogram case QwtPlotItem::Rtti_PlotSpectrogram: sipClass = sipClass_QwtPlotSpectrogram; break; #ifdef sipClass_QwtPlotSvgItem case QwtPlotItem::Rtti_PlotSVG: sipClass = sipClass_QwtPlotSvgItem; break; #endif // sipClass_QwtPlotSvgItem default: sipClass = 0; } Py_END_ALLOW_THREADS %End // %ConvertToSubClassCode %End // HAS_QWT5 }; // class QwtPlotItem %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_data.sip0000444000175000017500000000764411130210270020303 0ustar poxpox// The SIP interface specification for: // QwtArrayData, // QwtData, // QwtPolygonFData. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrayData: QwtData { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtArrayData(const QwtArrayDouble&, const QwtArrayDouble&); QwtArrayData(SIP_PYOBJECT, SIP_PYOBJECT) [(const double*, const double*, size_t)]; %MethodCode QwtArray xArray; if (-1 == try_PyObject_to_QwtArray(a0, xArray)) return 0; QwtArray yArray; if (-1 == try_PyObject_to_QwtArray(a1, yArray)) return 0; sipCpp = new sipQwtArrayData(xArray, yArray); %End // Not Pythonic: QwtArrayData& operator=(const QwtArrayData&); virtual QwtData* copy() const /Factory/; virtual size_t size() const; virtual double x(size_t) const; virtual double y(size_t) const; const QwtArrayDouble& xData() const; const QwtArrayDouble& yData() const; virtual QwtDoubleRect boundingRect() const; }; // class QwtArrayData class QwtData { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtData(); virtual ~QwtData(); virtual QwtData* copy() const = 0 /Factory/; virtual size_t size() const = 0; virtual double x(size_t) const = 0; virtual double y(size_t) const = 0; virtual QwtDoubleRect boundingRect() const; protected: // Not Pythonic: QwtData& operator=(const QwtData&); private: QwtData(const QwtData&); %If (CXX_DYNAMIC_CAST) %ConvertToSubClassCode // Walk the inheritance tree depth first in alphabetical order // This code is for Qwt4 and Qwt5 #ifdef sipClass_QwtArrayData if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtArrayData; else #endif #ifdef sipClass_QwtDoublePointData if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtDoublePointData; else #endif #ifdef sipClass_QwtPolygonFData if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPolygonFData; else #endif #ifdef sipClass_QwtData if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtData; else #endif sipClass = 0; %End %End }; // class QwtData class QwtPolygonFData: QwtData { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPolygonFData(const QwtArrayQwtDoublePoint&); // Not Pythonic: QwtPolygonFData& operator=(const QwtPolygonFData&); virtual QwtData* copy() const; virtual size_t size() const; virtual double x(size_t) const; virtual double y(size_t) const; const QwtArrayQwtDoublePoint& data() const; }; // class QwtPolygonFData // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_layout.sip0000444000175000017500000000656511130210270021746 0ustar poxpox// The SIP interface specification for: // QwtPlotLayout. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotLayout { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Options { AlignScales, IgnoreScrollbars, IgnoreFrames, IgnoreMargin, IgnoreLegend }; // enum Options QwtPlotLayout(); virtual ~QwtPlotLayout(); void setMargin(int); int margin() const; void setCanvasMargin(int, int = -1); int canvasMargin(int) const; void setAlignCanvasToScales(bool); bool alignCanvasToScales() const; void setSpacing(int); int spacing() const; void setLegendPosition(QwtPlot::LegendPosition, double); void setLegendPosition(QwtPlot::LegendPosition); QwtPlot::LegendPosition legendPosition() const; void setLegendRatio(double); double legendRatio() const; virtual QSize minimumSizeHint(const QwtPlot*) const; virtual void activate(const QwtPlot*, const QRect&, int = 0); virtual void invalidate(); const QRect& titleRect() const; const QRect& legendRect() const; const QRect& scaleRect(int) const; const QRect& canvasRect() const; protected: QRect layoutLegend(int, const QRect&) const; QRect alignLegend(const QRect&, const QRect&) const; SIP_PYTUPLE expandLineBreaks(int, const QRect&) const [ void (int, const QRect&, int&, int*)]; %MethodCode int title, axes[QwtPlot::axisCnt]; sipCpp->sipProtect_expandLineBreaks(a0, *a1, title, axes); sipRes = Py_BuildValue("i(iiii)", title, axes[0], axes[1], axes[2], axes[3]); %End SIP_PYTUPLE alignScales(int, QRect&) const [ void (int, QRect&, QRect*)]; %MethodCode QRect scales[QwtPlot::axisCnt]; sipCpp->sipProtect_alignScales(a0, *a1, scales); sipRes = sipBuildResult(0, "(BBBB)", new QRect(scales[0]), sipClass_QRect, 0, new QRect(scales[1]), sipClass_QRect, 0, new QRect(scales[2]), sipClass_QRect, 0, new QRect(scales[3]), sipClass_QRect, 0); %End }; // class QwtPlotLayout // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_scale_engine.sip0000444000175000017500000001464411172321327022020 0ustar poxpox// The SIP interface specification for: // QwtLinearScaleEngine, // QwtLog10ScaleEngine, // QwtScaleArithmetic, // QwtScaleEngine. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtLinearScaleEngine: QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual void autoScale(int, double&, double&, double&) const; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const; virtual QwtScaleTransformation* transformation() const; protected: QwtDoubleInterval align(const QwtDoubleInterval&, double) const; }; // class QwtLinearScaleEngine class QwtLog10ScaleEngine: QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual void autoScale(int, double&, double&, double&) const; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const; virtual QwtScaleTransformation* transformation() const; protected: QwtDoubleInterval log10(const QwtDoubleInterval&) const; QwtDoubleInterval pow10(const QwtDoubleInterval&) const; }; // class QwtLog10ScaleEngine class QwtScaleArithmetic { %TypeHeaderCode #include %End // %TypeHeaderCode public: static int compareEps(double, double, double); static double ceilEps(double, double); static double floorEps(double, double); static double divideEps(double, double); static double ceil125(double); static double floor125(double); }; // class QwtScaleArithmetic class QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Attribute { NoAttribute, IncludeReference, Symmetric, Floating, Inverted }; // enum Attribute QwtScaleEngine(); virtual ~QwtScaleEngine(); void setAttribute(QwtScaleEngine::Attribute, bool = true); bool testAttribute(QwtScaleEngine::Attribute) const; void setAttributes(int); int attributes() const; void setReference(double); double reference() const; void setMargins(double, double); double loMargin() const; double hiMargin() const; virtual void autoScale(int, double&, double&, double&) const = 0; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const = 0; virtual QwtScaleTransformation* transformation() const = 0; protected: bool contains(const QwtDoubleInterval&, double) const; QwtValueList strip(const QwtValueList&, const QwtDoubleInterval&) const; double divideInterval(double, int) const; QwtDoubleInterval buildInterval(double) const; }; // class QwtScaleEngine %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtLinearScaleEngine: QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual void autoScale(int, double&, double&, double&) const; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const; virtual QwtScaleTransformation* transformation() const; protected: QwtDoubleInterval align(const QwtDoubleInterval&, double) const; }; // class QwtLinearScaleEngine class QwtLog10ScaleEngine: QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual void autoScale(int, double&, double&, double&) const; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const; virtual QwtScaleTransformation* transformation() const; protected: QwtDoubleInterval log10(const QwtDoubleInterval&) const; QwtDoubleInterval pow10(const QwtDoubleInterval&) const; }; // class QwtLog10ScaleEngine class QwtScaleArithmetic { %TypeHeaderCode #include %End // %TypeHeaderCode public: static int compareEps(double, double, double); static double ceilEps(double, double); static double floorEps(double, double); static double divideEps(double, double); static double ceil125(double); static double floor125(double); }; // class QwtScaleArithmetic class QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Attribute { NoAttribute, IncludeReference, Symmetric, Floating, Inverted }; // enum Attribute QwtScaleEngine(); virtual ~QwtScaleEngine(); void setAttribute(QwtScaleEngine::Attribute, bool = true); bool testAttribute(QwtScaleEngine::Attribute) const; void setAttributes(int); int attributes() const; void setReference(double); double reference() const; void setMargins(double, double); double lowerMargin() const; double upperMargin() const; virtual void autoScale(int, double&, double&, double&) const = 0; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const = 0; virtual QwtScaleTransformation* transformation() const = 0; protected: bool contains(const QwtDoubleInterval&, double) const; QwtValueList strip(const QwtValueList&, const QwtDoubleInterval&) const; double divideInterval(double, int) const; QwtDoubleInterval buildInterval(double) const; }; // class QwtScaleEngine %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_scale_draw.sip0000444000175000017500000001075611130210270021474 0ustar poxpox// The SIP interface specification for: // QwtScaleDraw. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtScaleDraw: QwtAbstractScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Alignment { BottomScale, TopScale, LeftScale, RightScale }; // enum Alignment QwtScaleDraw(); QwtScaleDraw(const QwtScaleDraw&); virtual ~QwtScaleDraw(); // Not Pythonic: QwtScaleDraw& operator=(const QwtScaleDraw&); void getBorderDistHint(const QFont&, int& /Out/, int& /Out/) const; int minLabelDist(const QFont&) const; int minLength(const QPen&, const QFont&) const; virtual int extent(const QPen&, const QFont&) const; void move(int, int); void move(const QPoint&); void setLength(int); QwtScaleDraw::Alignment alignment() const; void setAlignment(QwtScaleDraw::Alignment); Qt::Orientation orientation() const; QPoint pos() const; int length() const; void setLabelAlignment(int); int labelAlignment() const; void setLabelRotation(double); double labelRotation() const; int maxLabelHeight(const QFont&) const; int maxLabelWidth(const QFont&) const; QPoint labelPosition(double) const; QRect labelRect(const QFont&, double) const; QSize labelSize(const QFont&, double) const; protected: QWMatrix labelMatrix(const QPoint&, const QSize&) const; virtual void drawTick(QPainter*, double, int) const; virtual void drawBackbone(QPainter*) const; virtual void drawLabel(QPainter*, double) const; }; // class QwtScaleDraw %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtScaleDraw: QwtAbstractScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Alignment { BottomScale, TopScale, LeftScale, RightScale }; // enum Alignment QwtScaleDraw(); QwtScaleDraw(const QwtScaleDraw&); virtual ~QwtScaleDraw(); // Not Pythonic: QwtScaleDraw& operator=(const QwtScaleDraw&); void getBorderDistHint(const QFont&, int& /Out/, int& /Out/) const; int minLabelDist(const QFont&) const; int minLength(const QPen&, const QFont&) const; virtual int extent(const QPen&, const QFont&) const; void move(int, int); void move(const QPoint&); void setLength(int); QwtScaleDraw::Alignment alignment() const; void setAlignment(QwtScaleDraw::Alignment); Qt::Orientation orientation() const; QPoint pos() const; int length() const; void setLabelAlignment(int); int labelAlignment() const; void setLabelRotation(double); double labelRotation() const; int maxLabelHeight(const QFont&) const; int maxLabelWidth(const QFont&) const; QPoint labelPosition(double) const; QRect labelRect(const QFont&, double) const; QSize labelSize(const QFont&, double) const; QRect boundingLabelRect(const QFont&, double) const; protected: QWMatrix labelMatrix(const QPoint&, const QSize&) const; virtual void drawTick(QPainter*, double, int) const; virtual void drawBackbone(QPainter*) const; virtual void drawLabel(QPainter*, double) const; }; // class QwtScaleDraw %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_counter.sip0000444000175000017500000000541611130210270021044 0ustar poxpox// The SIP interface specification for: // QwtCounter. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtCounter: QWidget, QwtDoubleRange { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Button { Button1, Button2, Button3, ButtonCnt }; // enum Button QwtCounter(QWidget* /TransferThis/ = 0); QwtCounter(QWidget*, const char*); virtual ~QwtCounter(); bool editable() const; void setEditable(bool); void setNumButtons(int); int numButtons() const; void setIncSteps(QwtCounter::Button, int); int incSteps(QwtCounter::Button) const; virtual void setValue(double); virtual QSize sizeHint() const; virtual void polish(); double step() const; void setStep(double); double minVal() const; void setMinValue(double); double maxVal() const; void setMaxValue(double); void setStepButton1(int); int stepButton1() const; void setStepButton2(int); int stepButton2() const; void setStepButton3(int); int stepButton3() const; virtual double value() const; signals: void buttonReleased(double); void valueChanged(double); protected: virtual bool event(QEvent*); virtual void wheelEvent(QWheelEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void rangeChange(); private slots: void btnReleased(); void btnClicked(); void textChanged(); private: virtual void valueChange(); }; // class QwtCounter // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_plot_panner.sip0000444000175000017500000000360711130210270021706 0ustar poxpox// The SIP interface specification for: // QwtPlotPanner. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotPanner: QwtPanner { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotPanner(QwtPlotCanvas* /TransferThis/); virtual ~QwtPlotPanner(); QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; void setAxisEnabled(int, bool); bool isAxisEnabled(int) const; protected slots: virtual void moveCanvas(int, int); }; // class QwtPlotPanner // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_text_engine.sip0000444000175000017500000000615011130210270021672 0ustar poxpox// The SIP interface specification for: // QwtPlainTextEngine, // QwtRichTextEngine, // QwtTextEngine. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlainTextEngine: QwtTextEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlainTextEngine(); virtual ~QwtPlainTextEngine(); virtual int heightForWidth(const QFont&, int, const QString&, int) const; virtual QSize textSize(const QFont&, int, const QString&) const; virtual void draw(QPainter*, const QRect&, int, const QString&) const; virtual bool mightRender(const QString&) const; virtual void textMargins(const QFont&, const QString&, int&, int&, int&, int&) const; }; // class QwtPlainTextEngine class QwtRichTextEngine: QwtTextEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtRichTextEngine(); virtual int heightForWidth(const QFont&, int, const QString&, int) const; virtual QSize textSize(const QFont&, int, const QString&) const; virtual void draw(QPainter*, const QRect&, int, const QString&) const; virtual bool mightRender(const QString&) const; virtual void textMargins(const QFont&, const QString&, int&, int&, int&, int&) const; }; // class QwtRichTextEngine class QwtTextEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual ~QwtTextEngine(); virtual int heightForWidth(const QFont&, int, const QString&, int) const = 0; virtual QSize textSize(const QFont&, int, const QString&) const = 0; virtual bool mightRender(const QString&) const = 0; virtual void textMargins(const QFont&, const QString&, int&, int&, int&, int&) const = 0; virtual void draw(QPainter*, const QRect&, int, const QString&) const = 0; protected: QwtTextEngine(); }; // class QwtTextEngine // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt3/qwt_clipper.sip0000444000175000017500000000323311130210270021016 0ustar poxpox// The SIP interface specification for: // QwtClipper. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtClipper { %TypeHeaderCode #include %End // %TypeHeaderCode public: static QwtPolygon clipPolygon(const QRect&, const QwtPolygon&); static QwtPolygonF clipPolygonF(const QwtDoubleRect&, const QwtPolygonF&); }; // class QwtClipper // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/0000755000175000017500000000000011275562661016002 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_canvas.sip0000444000175000017500000001136711172321327021715 0ustar poxpox// The SIP interface specification for: // QwtPlotCanvas. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlotCanvas: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum PaintAttribute { PaintCached, PaintPacked }; // enum PaintAttribute enum FocusIndicator { NoFocusIndicator, CanvasFocusIndicator, ItemFocusIndicator }; // enum FocusIndicator void setFocusIndicator(QwtPlotCanvas::FocusIndicator); QwtPlotCanvas::FocusIndicator focusIndicator() const; void setPaintAttribute(QwtPlotCanvas::PaintAttribute, bool = true); bool testPaintAttribute(QwtPlotCanvas::PaintAttribute) const; QPixmap* paintCache(); // signature: const QPixmap* paintCache() const; void invalidatePaintCache(); protected: QwtPlotCanvas(QwtPlot* /TransferThis/); virtual ~QwtPlotCanvas(); virtual void hideEvent(QHideEvent*); virtual void paintEvent(QPaintEvent*); virtual void drawContents(QPainter*); virtual void drawFocusIndicator(QPainter*); void drawCanvas(QPainter* = 0); }; // class QwtPlotCanvas %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - Qwt_5_2_0) class QwtPlotCanvas: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum PaintAttribute { PaintCached, PaintPacked }; // enum PaintAttribute enum FocusIndicator { NoFocusIndicator, CanvasFocusIndicator, ItemFocusIndicator }; // enum FocusIndicator QwtPlotCanvas(QwtPlot* /TransferThis/); virtual ~QwtPlotCanvas(); QwtPlot* plot(); // signature: const QwtPlot* plot() const; void setFocusIndicator(QwtPlotCanvas::FocusIndicator); QwtPlotCanvas::FocusIndicator focusIndicator() const; void setPaintAttribute(QwtPlotCanvas::PaintAttribute, bool = true); bool testPaintAttribute(QwtPlotCanvas::PaintAttribute) const; QPixmap* paintCache(); // signature: const QPixmap* paintCache() const; void invalidatePaintCache(); protected: virtual void hideEvent(QHideEvent*); virtual void paintEvent(QPaintEvent*); virtual void drawContents(QPainter*); virtual void drawFocusIndicator(QPainter*); void drawCanvas(QPainter* = 0); }; // class QwtPlotCanvas %End // (Qwt_5_1_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtPlotCanvas: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum PaintAttribute { PaintCached, PaintPacked }; // enum PaintAttribute enum FocusIndicator { NoFocusIndicator, CanvasFocusIndicator, ItemFocusIndicator }; // enum FocusIndicator QwtPlotCanvas(QwtPlot* /TransferThis/); virtual ~QwtPlotCanvas(); QwtPlot* plot(); // signature: const QwtPlot* plot() const; void setFocusIndicator(QwtPlotCanvas::FocusIndicator); QwtPlotCanvas::FocusIndicator focusIndicator() const; void setPaintAttribute(QwtPlotCanvas::PaintAttribute, bool = true); bool testPaintAttribute(QwtPlotCanvas::PaintAttribute) const; QPixmap* paintCache(); // signature: const QPixmap* paintCache() const; void invalidatePaintCache(); void replot(); protected: virtual void hideEvent(QHideEvent*); virtual void paintEvent(QPaintEvent*); virtual void drawContents(QPainter*); virtual void drawFocusIndicator(QPainter*); void drawCanvas(QPainter* = 0); }; // class QwtPlotCanvas %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_text.sip0000444000175000017500000000647711130210270020362 0ustar poxpox// The SIP interface specification for: // QwtText. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtText { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum TextFormat { AutoText, PlainText, RichText, MathMLText, TeXText, OtherFormat }; // enum TextFormat enum PaintAttribute { PaintUsingTextFont, PaintUsingTextColor, PaintBackground }; // enum PaintAttribute enum LayoutAttribute { MinimumLayout }; // enum LayoutAttribute QwtText(const QString& = QString::null, QwtText::TextFormat = QwtText::AutoText); QwtText(const QwtText&); ~QwtText(); // Not Pythonic: QwtText& operator=(const QwtText&); int operator==(const QwtText&) const; int operator!=(const QwtText&) const; void setText(const QString&, QwtText::TextFormat = QwtText::AutoText); QString text() const; bool isNull() const; bool isEmpty() const; void setFont(const QFont&); QFont font() const; QFont usedFont(const QFont&) const; void setRenderFlags(int); int renderFlags() const; void setColor(const QColor&); QColor color() const; QColor usedColor(const QColor&) const; void setBackgroundPen(const QPen&); QPen backgroundPen() const; void setBackgroundBrush(const QBrush&); QBrush backgroundBrush() const; void setPaintAttribute(QwtText::PaintAttribute, bool = true); bool testPaintAttribute(QwtText::PaintAttribute) const; void setLayoutAttribute(QwtText::LayoutAttribute, bool = true); bool testLayoutAttribute(QwtText::LayoutAttribute) const; int heightForWidth(int, const QFont& = QFont()) const; QSize textSize(const QFont& = QFont()) const; void draw(QPainter*, const QRect&) const; static const QwtTextEngine* textEngine(const QString&, QwtText::TextFormat = QwtText::AutoText); static const QwtTextEngine* textEngine(QwtText::TextFormat); static void setTextEngine(QwtText::TextFormat, QwtTextEngine*); }; // class QwtText // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_panner.sip0000444000175000017500000000667511130210270020661 0ustar poxpox// The SIP interface specification for: // QwtPanner. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPanner: QWidget { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPanner(QWidget* /TransferThis/); virtual ~QwtPanner(); void setEnabled(bool); bool isEnabled() const; void setMouseButton(int, int = Qt::NoButton); void getMouseButton(int&, int&) const; void setAbortKey(int, int = Qt::NoButton); void getAbortKey(int&, int&) const; void setCursor(const QCursor&); const QCursor cursor() const; virtual bool eventFilter(QObject*, QEvent*); signals: void panned(int, int); void moved(int, int); protected: virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); virtual void paintEvent(QPaintEvent*); }; // class QwtPanner %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPanner: QWidget { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPanner(QWidget* /TransferThis/); virtual ~QwtPanner(); void setEnabled(bool); bool isEnabled() const; void setMouseButton(int, int = Qt::NoButton); void getMouseButton(int&, int&) const; void setAbortKey(int, int = Qt::NoButton); void getAbortKey(int&, int&) const; void setCursor(const QCursor&); const QCursor cursor() const; void setOrientations(Qt::Orientations); Qt::Orientations orientations() const; bool isOrientationEnabled(Qt::Orientation) const; virtual bool eventFilter(QObject*, QEvent*); signals: void panned(int, int); void moved(int, int); protected: virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); virtual void paintEvent(QPaintEvent*); }; // class QwtPanner %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_dial_needle.sip0000444000175000017500000001014111130210270021602 0ustar poxpox// The SIP interface specification for: // QwtCompassMagnetNeedle, // QwtCompassWindArrow, // QwtDialNeedle, // QwtDialSimpleNeedle. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtCompassMagnetNeedle: QwtDialNeedle { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Style { TriangleStyle, ThinStyle }; // enum Style QwtCompassMagnetNeedle(QwtCompassMagnetNeedle::Style = TriangleStyle, const QColor& = Qt::white, const QColor& = Qt::red); virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const; static void drawTriangleNeedle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, double); static void drawThinNeedle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, double); protected: static void drawPointer(QPainter*, const QBrush&, int, const QPoint&, int, int, double); }; // class QwtCompassMagnetNeedle class QwtCompassWindArrow: QwtDialNeedle { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Style { Style1, Style2 }; // enum Style QwtCompassWindArrow(QwtCompassWindArrow::Style, const QColor& = Qt::white, const QColor& = Qt::gray); virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const; static void drawStyle1Needle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, double); static void drawStyle2Needle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, double); }; // class QwtCompassWindArrow class QwtDialNeedle { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDialNeedle(); virtual ~QwtDialNeedle(); virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const = 0; virtual void setPalette(const QPalette&); const QPalette& palette() const; protected: static void drawKnob(QPainter*, const QPoint&, int, const QBrush&, bool); }; // class QwtDialNeedle class QwtDialSimpleNeedle: QwtDialNeedle { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Style { Arrow, Ray }; // enum Style QwtDialSimpleNeedle(QwtDialSimpleNeedle::Style, bool = true, const QColor& = Qt::gray, const QColor& = Qt::darkGray); virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const; static void drawArrowNeedle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, int, double, bool); static void drawRayNeedle(QPainter*, const QPalette&, QPalette::ColorGroup, const QPoint&, int, int, double, bool); void setWidth(int); int width() const; }; // class QwtDialSimpleNeedle // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_analog_clock.sip0000444000175000017500000000452011130210270021775 0ustar poxpox// The SIP interface specification for: // QwtAnalogClock. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtAnalogClock: QwtDial { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Hand { SecondHand, MinuteHand, HourHand, NHands }; // enum Hand QwtAnalogClock(QWidget* /TransferThis/ = 0); virtual ~QwtAnalogClock(); virtual void setHand(QwtAnalogClock::Hand, QwtDialNeedle* /Transfer/); // signature: const QwtDialNeedle* hand(QwtAnalogClock::Hand) const; QwtDialNeedle* hand(QwtAnalogClock::Hand); public slots: void setCurrentTime(); void setTime(const QTime& = QTime::currentTime()); protected: virtual QwtText scaleLabel(double) const; virtual void drawNeedle(QPainter*, const QPoint&, int, double, QPalette::ColorGroup) const; virtual void drawHand(QPainter*, QwtAnalogClock::Hand, const QPoint&, int, double, QPalette::ColorGroup) const; private: virtual void setNeedle(QwtDialNeedle* /Transfer/); }; // class QwtAnalogClock // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_event_pattern.sip0000444000175000017500000000657611130210270022254 0ustar poxpox// The SIP interface specification for: // QwtEventPattern. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtEventPattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum MousePatternCode { MouseSelect1, MouseSelect2, MouseSelect3, MouseSelect4, MouseSelect5, MouseSelect6, MousePatternCount }; // enum MousePatternCode enum KeyPatternCode { KeySelect1, KeySelect2, KeyAbort, KeyLeft, KeyRight, KeyUp, KeyDown, KeyRedo, KeyUndo, KeyHome, KeyPatternCount }; // enum KeyPatternCode class MousePattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: int button; int state; MousePattern(int = Qt::NoButton, int = Qt::NoButton); }; // class MousePattern class KeyPattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: int key; int state; KeyPattern(int = 0, int = Qt::NoButton); }; // class KeyPattern QwtEventPattern(); virtual ~QwtEventPattern(); void initMousePattern(int); void initKeyPattern(); void setMousePattern(uint, int, int = Qt::NoButton); void setKeyPattern(uint, int, int = Qt::NoButton); void setMousePattern(const QVector&); void setKeyPattern(const QVector&); // signature: const QVector& mousePattern() const; // signature: const QVector& keyPattern() const; QVector& mousePattern(); QVector& keyPattern(); bool mouseMatch(uint, const QMouseEvent*) const; bool keyMatch(uint, const QKeyEvent*) const; protected: virtual bool mouseMatch(const QwtEventPattern::MousePattern&, const QMouseEvent*) const; virtual bool keyMatch(const QwtEventPattern::KeyPattern&, const QKeyEvent*) const; }; // class QwtEventPattern // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/QwtStack.sip0000444000175000017500000000572610554700524020257 0ustar poxpox// The SIP interface specification for: // QStack. // // Copyright (C) 2001-2007 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. // QStack is implemented as a Python list. template %MappedType QStack { %TypeHeaderCode #include %End %ConvertFromTypeCode // Create the list. PyObject *l = PyList_New(sipCpp->size()); if (!l) return 0; // Set the list elements. for (int i=0; isize(); ++i) { Type *t = new Type(sipCpp->at(i)); PyObject *o = sipConvertFromNewInstance(t, sipClass_Type, sipTransferObj); if (0 == o) { Py_XDECREF(o); Py_DECREF(l); return 0; } PyList_SetItem(l, i, o); } return l; %End %ConvertToTypeCode // Type checking if only that is required. if (!sipIsErr) { if (!PyList_Check(sipPy)) return 0; // check elements for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_Type, 0)) return 0; return 1; } // Return the QStack. QStack *s = new QStack; for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) { int state; Type *t = reinterpret_cast(sipConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_Type, 0, SIP_NOT_NONE, &state, sipIsErr)); if (*sipIsErr) { sipReleaseInstance(t, sipClass_Type, state); delete s; return 0; } s->append(*t); sipReleaseInstance(t, sipClass_Type, state); } *sipCppPtr = s; return sipGetState(sipTransferObj); %End }; // template %MappedType QStack // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_marker.sip0000444000175000017500000000750011172321327021715 0ustar poxpox// The SIP interface specification for: // QwtPlotMarker. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtPlotMarker: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum LineStyle { NoLine, HLine, VLine, Cross }; // enum LineStyle QwtPlotMarker(); virtual ~QwtPlotMarker(); virtual int rtti() const; double xValue() const; double yValue() const; QwtDoublePoint value() const; void setXValue(double); void setYValue(double); void setValue(double, double); void setValue(const QwtDoublePoint&); void setLineStyle(QwtPlotMarker::LineStyle); QwtPlotMarker::LineStyle lineStyle() const; void setLinePen(const QPen&); const QPen& linePen() const; void setSymbol(const QwtSymbol&); const QwtSymbol& symbol() const; void setLabel(const QwtText&); QwtText label() const; void setLabelAlignment(Qt::Alignment); Qt::Alignment labelAlignment() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual QwtDoubleRect boundingRect() const; }; // class QwtPlotMarker %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtPlotMarker: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum LineStyle { NoLine, HLine, VLine, Cross }; // enum LineStyle QwtPlotMarker(); virtual ~QwtPlotMarker(); virtual int rtti() const; double xValue() const; double yValue() const; QwtDoublePoint value() const; void setXValue(double); void setYValue(double); void setValue(double, double); void setValue(const QwtDoublePoint&); void setLineStyle(QwtPlotMarker::LineStyle); QwtPlotMarker::LineStyle lineStyle() const; void setLinePen(const QPen&); const QPen& linePen() const; void setSymbol(const QwtSymbol&); const QwtSymbol& symbol() const; void setLabel(const QwtText&); QwtText label() const; void setLabelAlignment(Qt::Alignment); Qt::Alignment labelAlignment() const; void setLabelOrientation(Qt::Orientation); Qt::Orientation labelOrientation() const; void setSpacing(int); int spacing() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual QwtDoubleRect boundingRect() const; protected: void drawAt(QPainter*, const QRect&, const QPoint&) const; }; // class QwtPlotMarker %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_grid.sip0000444000175000017500000000444611130210270021353 0ustar poxpox// The SIP interface specification for: // QwtPlotGrid. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotGrid: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotGrid(); virtual ~QwtPlotGrid(); virtual int rtti() const; void enableX(bool); bool xEnabled() const; void enableY(bool); bool yEnabled() const; void enableXMin(bool); bool xMinEnabled() const; void enableYMin(bool); bool yMinEnabled() const; void setXDiv(const QwtScaleDiv&); const QwtScaleDiv& xScaleDiv() const; void setYDiv(const QwtScaleDiv&); const QwtScaleDiv& yScaleDiv() const; void setPen(const QPen&); void setMajPen(const QPen&); const QPen& majPen() const; void setMinPen(const QPen&); const QPen& minPen() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual void updateScaleDiv(const QwtScaleDiv&, const QwtScaleDiv&); }; // class QwtPlotGrid // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_wheel.sip0000444000175000017500000000503011130210270020462 0ustar poxpox// The SIP interface specification for: // QwtWheel. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtWheel: QwtAbstractSlider { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtWheel(QWidget* /TransferThis/ = 0); virtual ~QwtWheel(); virtual void setOrientation(Qt::Orientation); double totalAngle() const; double viewAngle() const; int tickCnt() const; int internalBorder() const; virtual double mass() const; void setTotalAngle(double); void setTickCnt(int); void setViewAngle(double); void setInternalBorder(int); virtual void setMass(double); void setWheelWidth(int); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; protected: virtual void resizeEvent(QResizeEvent*); virtual void paintEvent(QPaintEvent*); void layoutWheel(bool = true); void draw(QPainter*, const QRect&); void drawWheel(QPainter*, const QRect&); void drawWheelBackground(QPainter*, const QRect&); void setColorArray(); virtual void valueChange(); virtual void paletteChange(const QPalette&); virtual double getValue(const QPoint&); virtual void getScrollMode(const QPoint&, int& /Out/, int& /Out/); }; // class QwtWheel // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/QwtArrayInt.sip0000444000175000017500000000725511130210270020723 0ustar poxpox// The SIP interface specification for: // QwtArrayInt. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrayInt { %TypeHeaderCode #include typedef QwtArray QwtArrayInt; %End // %TypeHeaderCode public: QwtArrayInt(); QwtArrayInt(int); QwtArrayInt(const QwtArrayInt &); QwtArrayInt(SIP_PYOBJECT); %MethodCode QwtArray array; // Numeric is not thread-safe if (-1 == try_PyObject_to_QwtArray(a0, array)) return 0; sipCpp = new QwtArrayInt(array); %End // QwtArrayInt() ~QwtArrayInt(); // not possible: QwtArray &operator=(const QwtArray &); // pulls in unwanted operators: bool operator==(const QVector &) const; // pulls in unwanted operators: bool operator!=(const QVector &) const; int size() const; bool isEmpty() const; void resize(int); int capacity() const; void reserve(int); void squeeze(); void detach(); bool isDetached() const; void setSharable(bool sharable); // not Pythonic: T *data(); // not Pythonic: const T *data() const; // not Pythonic: const T *constData() const; void clear(); int __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = (*sipCpp)[a0]; %End // __getitem__() int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End // __len__() void __setitem__(int, int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = a1; %End // __setitem__() void __setitem__(SIP_PYSLICE, const QwtArrayInt &); %MethodCode int len = sipCpp -> size(); Py_ssize_t start, stop, step, slicelength; if (0 > sipConvertFromSliceObject(a0, len, &start, &stop, &step, &slicelength)) sipIsErr = 1; else { int vlen = a1 -> size(); if (vlen != slicelength) { sipBadLengthForSlice(vlen, slicelength); sipIsErr = 1; } else { QwtArrayInt::ConstIterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[int(start)] = *it; start += step; ++it; } } } %End // __setitem__() }; // class QwtArrayInt // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_legend.sip0000444000175000017500000001041311130210270020615 0ustar poxpox// The SIP interface specification for: // QwtLegend. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtLegend: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum LegendDisplayPolicy { NoIdentifier, FixedIdentifier, AutoIdentifier }; // enum LegendDisplayPolicy enum LegendItemMode { ReadOnlyItem, ClickableItem, CheckableItem }; // enum LegendItemMode QwtLegend(QWidget* /TransferThis/ = 0); virtual ~QwtLegend(); void setDisplayPolicy(QwtLegend::LegendDisplayPolicy, int); QwtLegend::LegendDisplayPolicy displayPolicy() const; void setItemMode(QwtLegend::LegendItemMode); QwtLegend::LegendItemMode itemMode() const; int identifierMode() const; QWidget* contentsWidget(); // signature: const QWidget* contentsWidget() const; void insert(const QwtPlotItem*, QWidget* /Transfer/); void remove(const QwtPlotItem*); QWidget* find(const QwtPlotItem*) const; QwtPlotItem* find(const QWidget*) const; virtual QList legendItems() const; void clear(); bool isEmpty() const; uint itemCount() const; virtual bool eventFilter(QObject*, QEvent*); virtual QSize sizeHint() const; virtual int heightForWidth(int) const; QScrollBar* horizontalScrollBar() const; QScrollBar* verticalScrollBar() const; protected: virtual void resizeEvent(QResizeEvent*); virtual void layoutContents(); }; // class QwtLegend %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtLegend: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum LegendDisplayPolicy { NoIdentifier, FixedIdentifier, AutoIdentifier }; // enum LegendDisplayPolicy enum LegendItemMode { ReadOnlyItem, ClickableItem, CheckableItem }; // enum LegendItemMode QwtLegend(QWidget* /TransferThis/ = 0); virtual ~QwtLegend(); void setDisplayPolicy(QwtLegend::LegendDisplayPolicy, int); QwtLegend::LegendDisplayPolicy displayPolicy() const; void setItemMode(QwtLegend::LegendItemMode); QwtLegend::LegendItemMode itemMode() const; int identifierMode() const; QWidget* contentsWidget(); // signature: const QWidget* contentsWidget() const; void insert(const QwtLegendItemManager*, QWidget*); void remove(const QwtLegendItemManager*); QWidget* find(const QwtLegendItemManager*) const; QwtLegendItemManager* find(const QWidget*) const; virtual QList legendItems() const; void clear(); bool isEmpty() const; uint itemCount() const; virtual bool eventFilter(QObject*, QEvent*); virtual QSize sizeHint() const; virtual int heightForWidth(int) const; QScrollBar* horizontalScrollBar() const; QScrollBar* verticalScrollBar() const; protected: virtual void resizeEvent(QResizeEvent*); virtual void layoutContents(); }; // class QwtLegend %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_picker_machine.sip0000444000175000017500000001077011130210270022326 0ustar poxpox// The SIP interface specification for: // QwtPickerClickPointMachine, // QwtPickerClickRectMachine, // QwtPickerDragPointMachine, // QwtPickerDragRectMachine, // QwtPickerMachine, // QwtPickerPolygonMachine. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPickerClickPointMachine: QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual QList transition(const QwtEventPattern&, const QEvent*); }; // class QwtPickerClickPointMachine class QwtPickerClickRectMachine: QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual QList transition(const QwtEventPattern&, const QEvent*); }; // class QwtPickerClickRectMachine class QwtPickerDragPointMachine: QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual QList transition(const QwtEventPattern&, const QEvent*); }; // class QwtPickerDragPointMachine class QwtPickerDragRectMachine: QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual QList transition(const QwtEventPattern&, const QEvent*); }; // class QwtPickerDragRectMachine class QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Command { Begin, Append, Move, End }; // enum Command virtual ~QwtPickerMachine(); virtual QList transition(const QwtEventPattern&, const QEvent*) = 0; void reset(); int state() const; void setState(int); protected: QwtPickerMachine(); %If (CXX_DYNAMIC_CAST) %ConvertToSubClassCode // Walk the inheritance tree depth first in alphabetical order #ifdef sipClass_QwtPickerClickPointMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerClickPointMachine; else #endif #ifdef sipClass_QwtPickerClickRectMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerClickRectMachine; else #endif #ifdef sipClass_QwtPickerDragPointMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerDragPointMachine; else #endif #ifdef sipClass_QwtPickerDragRectMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerDragRectMachine; else #endif #ifdef sipClass_QwtPickerPolygonMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerPolygonMachine; else #endif #ifdef sipClass_QwtPickerMachine if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPickerMachine; else #endif sipClass = 0; %End %End }; // class QwtPickerMachine class QwtPickerPolygonMachine: QwtPickerMachine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual QList transition(const QwtEventPattern&, const QEvent*); }; // class QwtPickerPolygonMachine // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_spline.sip0000444000175000017500000000603511172321327020672 0ustar poxpox// The SIP interface specification for: // QwtSpline. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtSpline { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum SplineType { Natural, Periodic }; // enum SplineType QwtSpline(); QwtSpline(const QwtSpline&); ~QwtSpline(); // Not Pythonic: QwtSpline& operator=(const QwtSpline&); void setSplineType(QwtSpline::SplineType); QwtSpline::SplineType splineType() const; bool setPoints(const QPolygonF&); %If (Qwt_5_0_1 - ) QPolygonF points() const; %End // (Qwt_5_0_1 - ) void reset(); bool isValid() const; double value(double) const; protected: bool buildNaturalSpline(const QPolygonF&); bool buildPeriodicSpline(const QPolygonF&); }; // class QwtSpline %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtSpline { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum SplineType { Natural, Periodic }; // enum SplineType QwtSpline(); QwtSpline(const QwtSpline&); ~QwtSpline(); // Not Pythonic: QwtSpline& operator=(const QwtSpline&); void setSplineType(QwtSpline::SplineType); QwtSpline::SplineType splineType() const; bool setPoints(const QPolygonF&); %If (Qwt_5_0_1 - ) QPolygonF points() const; %End // (Qwt_5_0_1 - ) void reset(); bool isValid() const; double value(double) const; const QwtArrayDouble& coefficientsA() const; const QwtArrayDouble& coefficientsB() const; const QwtArrayDouble& coefficientsC() const; protected: bool buildNaturalSpline(const QPolygonF&); bool buildPeriodicSpline(const QPolygonF&); }; // class QwtSpline %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_double_interval.sip0000444000175000017500000001054711172321327022561 0ustar poxpox// The SIP interface specification for: // QwtDoubleInterval. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtDoubleInterval { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDoubleInterval(); QwtDoubleInterval(double, double); void setInterval(double, double); QwtDoubleInterval normalized() const; QwtDoubleInterval inverted() const; QwtDoubleInterval limited(double, double) const; int operator==(const QwtDoubleInterval&) const; int operator!=(const QwtDoubleInterval&) const; double minValue() const; double maxValue() const; double width() const; void setMinValue(double); void setMaxValue(double); bool contains(double) const; bool intersects(const QwtDoubleInterval&) const; QwtDoubleInterval intersect(const QwtDoubleInterval&) const; QwtDoubleInterval unite(const QwtDoubleInterval&) const; QwtDoubleInterval operator|(const QwtDoubleInterval&) const; QwtDoubleInterval operator&(const QwtDoubleInterval&) const; QwtDoubleInterval& __ior__(const QwtDoubleInterval&); QwtDoubleInterval& __iand__(const QwtDoubleInterval&); QwtDoubleInterval extend(double) const; QwtDoubleInterval operator|(double) const; QwtDoubleInterval& __ior__(double); bool isValid() const; bool isNull() const; void invalidate(); QwtDoubleInterval symmetrize(double) const; }; // class QwtDoubleInterval %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtDoubleInterval { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum BorderMode { IncludeBorders, ExcludeMinimum, ExcludeMaximum, ExcludeBorders }; // enum BorderMode QwtDoubleInterval(); QwtDoubleInterval(double, double, int = IncludeBorders); void setInterval(double, double, int = IncludeBorders); QwtDoubleInterval normalized() const; QwtDoubleInterval inverted() const; QwtDoubleInterval limited(double, double) const; int operator==(const QwtDoubleInterval&) const; int operator!=(const QwtDoubleInterval&) const; void setBorderFlags(int); int borderFlags() const; double minValue() const; double maxValue() const; double width() const; void setMinValue(double); void setMaxValue(double); bool contains(double) const; bool intersects(const QwtDoubleInterval&) const; QwtDoubleInterval intersect(const QwtDoubleInterval&) const; QwtDoubleInterval unite(const QwtDoubleInterval&) const; QwtDoubleInterval operator|(const QwtDoubleInterval&) const; QwtDoubleInterval operator&(const QwtDoubleInterval&) const; QwtDoubleInterval& __ior__(const QwtDoubleInterval&); QwtDoubleInterval& __iand__(const QwtDoubleInterval&); QwtDoubleInterval extend(double) const; QwtDoubleInterval operator|(double) const; QwtDoubleInterval& __ior__(double); bool isValid() const; bool isNull() const; void invalidate(); QwtDoubleInterval symmetrize(double) const; }; // class QwtDoubleInterval %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/QwtArrayQwtDoublePoint.sip0000444000175000017500000001071711163711320023116 0ustar poxpox// The SIP interface specification for: // QwtArrayQwtDoublePoint. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrayQwtDoublePoint { %TypeHeaderCode #include #include #if defined(_MSC_VER) && defined(QT_DLL) template class __declspec(dllimport) QVector; #endif typedef QwtArray QwtArrayQwtDoublePoint; %End // %TypeHeaderCode public: QwtArrayQwtDoublePoint(); QwtArrayQwtDoublePoint(int); QwtArrayQwtDoublePoint(const QwtArrayQwtDoublePoint &); QwtArrayQwtDoublePoint(SIP_PYLIST); %MethodCode // FIXME QwtArray array(PyList_GET_SIZE(a0)); for (int i = 0; i < PyList_GET_SIZE(a0); ++i) { #if SIP_VERSION < 0x040800 void *cpp = sipForceConvertToInstance( PyList_GET_ITEM(a0, i), sipClass_QPointF, NULL, SIP_NO_CONVERTORS, NULL, &sipIsErr); #else void *cpp = sipForceConvertToType( PyList_GET_ITEM(a0, i), sipType_QPointF, NULL, SIP_NO_CONVERTORS, NULL, &sipIsErr); #endif array[i] = *reinterpret_cast(cpp); } sipCpp = new QwtArrayQwtDoublePoint(array); %End // QwtArrayQwtDoublePoint() ~QwtArrayQwtDoublePoint(); // not possible: QwtArray &operator=(const QwtArray &); // pulls in unwanted operators: bool operator==(const QVector &) const; // pulls in unwanted operators: bool operator!=(const QVector &) const; int size() const; bool isEmpty() const; void resize(int); int capacity() const; void reserve(int); void squeeze(); void detach(); bool isDetached() const; void setSharable(bool sharable); // not Pythonic: T *data(); // not Pythonic: const T *data() const; // not Pythonic: const T *constData() const; void clear(); QPointF & __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = &(*sipCpp)[a0]; %End // __getitem__() int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End // __len__() void __setitem__(int, QPointF); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = *a1; %End // __setitem__() void __setitem__(SIP_PYSLICE, const QwtArrayQwtDoublePoint &); %MethodCode int len = sipCpp -> size(); Py_ssize_t start, stop, step, slicelength; if (0 > sipConvertFromSliceObject(a0, len, &start, &stop, &step, &slicelength)) sipIsErr = 1; else { int vlen = a1 -> size(); if (vlen != slicelength) { sipBadLengthForSlice(vlen, slicelength); sipIsErr = 1; } else { QwtArrayQwtDoublePoint::ConstIterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[int(start)] = *it; start += step; ++it; } } } %End // __setitem__() }; // class QwtArrayQwtDoublePoint // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_magnifier.sip0000444000175000017500000000656711130210270022375 0ustar poxpox// The SIP interface specification for: // QwtPlotMagnifier. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlotMagnifier: QObject { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotMagnifier(QwtPlotCanvas* /TransferThis/); virtual ~QwtPlotMagnifier(); void setEnabled(bool); bool isEnabled() const; void setAxisEnabled(int, bool); bool isAxisEnabled(int) const; void setMouseFactor(double); double mouseFactor() const; void setMouseButton(int, int = Qt::NoButton); void getMouseButton(int&, int&) const; void setWheelFactor(double); double wheelFactor() const; void setWheelButtonState(int); int wheelButtonState() const; void setKeyFactor(double); double keyFactor() const; void setZoomInKey(int, int); void getZoomInKey(int&, int&); void setZoomOutKey(int, int); void getZoomOutKey(int&, int&); QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; virtual bool eventFilter(QObject*, QEvent*); protected: virtual void rescale(double); virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetWheelEvent(QWheelEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); }; // class QwtPlotMagnifier %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPlotMagnifier: QwtMagnifier { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotMagnifier(QwtPlotCanvas* /TransferThis/); virtual ~QwtPlotMagnifier(); void setAxisEnabled(int, bool); bool isAxisEnabled(int) const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; protected: virtual void rescale(double); }; // class QwtPlotMagnifier %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_slider.sip0000444000175000017500000000617111130210270020647 0ustar poxpox// The SIP interface specification for: // QwtSlider. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtSlider: QwtAbstractSlider, QwtAbstractScale { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum ScalePos { NoScale, LeftScale, RightScale, TopScale, BottomScale }; // enum ScalePos enum BGSTYLE { BgTrough, BgSlot, BgBoth }; // enum BGSTYLE QwtSlider(QWidget* /TransferThis/, Qt::Orientation = Qt::Horizontal, QwtSlider::ScalePos = NoScale, QwtSlider::BGSTYLE = BgTrough); virtual ~QwtSlider(); virtual void setOrientation(Qt::Orientation); void setBgStyle(QwtSlider::BGSTYLE); QwtSlider::BGSTYLE bgStyle() const; void setScalePosition(QwtSlider::ScalePos); QwtSlider::ScalePos scalePosition() const; int thumbLength() const; int thumbWidth() const; int borderWidth() const; void setThumbLength(int); void setThumbWidth(int); void setBorderWidth(int); void setMargins(int, int); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; void setScaleDraw(QwtScaleDraw* /Transfer/); // signature: const QwtScaleDraw* scaleDraw() const; protected: virtual double getValue(const QPoint&); virtual void getScrollMode(const QPoint&, int& /Out/, int& /Out/); void draw(QPainter*, const QRect&); virtual void drawSlider(QPainter*, const QRect&); virtual void drawThumb(QPainter*, const QRect&, int); virtual void resizeEvent(QResizeEvent*); virtual void paintEvent(QPaintEvent*); virtual void valueChange(); virtual void rangeChange(); virtual void scaleChange(); virtual void fontChange(const QFont&); void layoutSlider(bool = true); int xyPosition(double) const; QwtScaleDraw* scaleDraw(); }; // class QwtSlider // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_color_map.sip0000444000175000017500000000722211130210270021336 0ustar poxpox// The SIP interface specification for: // QwtAlphaColorMap, // QwtColorMap, // QwtLinearColorMap. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtAlphaColorMap: QwtColorMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtAlphaColorMap(const QColor& = QColor(Qt::gray)); QwtAlphaColorMap(const QwtAlphaColorMap&); virtual ~QwtAlphaColorMap(); // Not Pythonic: QwtAlphaColorMap& operator=(const QwtAlphaColorMap&); virtual QwtColorMap* copy() const; void setColor(const QColor&); QColor color() const; virtual QRgb rgb(const QwtDoubleInterval&, double) const; private: virtual unsigned char colorIndex(const QwtDoubleInterval&, double) const; }; // class QwtAlphaColorMap class QwtColorMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Format { RGB, Indexed }; // enum Format QwtColorMap(QwtColorMap::Format = QwtColorMap::RGB); virtual ~QwtColorMap(); QwtColorMap::Format format() const; virtual QwtColorMap* copy() const = 0; virtual QRgb rgb(const QwtDoubleInterval&, double) const = 0; virtual unsigned char colorIndex(const QwtDoubleInterval&, double) const = 0; QColor color(const QwtDoubleInterval&, double) const; virtual QVector colorTable(const QwtDoubleInterval&) const; }; // class QwtColorMap class QwtLinearColorMap: QwtColorMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Mode { FixedColors, ScaledColors }; // enum Mode QwtLinearColorMap(QwtColorMap::Format = QwtColorMap::RGB); QwtLinearColorMap(const QColor&, const QColor&, QwtColorMap::Format = QwtColorMap::RGB); QwtLinearColorMap(const QwtLinearColorMap&); virtual ~QwtLinearColorMap(); // Not Pythonic: QwtLinearColorMap& operator=(const QwtLinearColorMap&); virtual QwtColorMap* copy() const; void setMode(QwtLinearColorMap::Mode); QwtLinearColorMap::Mode mode() const; void setColorInterval(const QColor&, const QColor&); void addColorStop(double, const QColor&); QwtArrayDouble colorStops() const; QColor color1() const; QColor color2() const; virtual QRgb rgb(const QwtDoubleInterval&, double) const; virtual unsigned char colorIndex(const QwtDoubleInterval&, double) const; }; // class QwtLinearColorMap // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_spectrogram.sip0000444000175000017500000000601111207550770022763 0ustar poxpox// The SIP interface specification for: // QwtPlotSpectrogram. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotSpectrogram: QwtPlotRasterItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum DisplayMode { ImageMode, ContourMode }; // enum DisplayMode QwtPlotSpectrogram(const QString& = QString::null); virtual ~QwtPlotSpectrogram(); void setDisplayMode(QwtPlotSpectrogram::DisplayMode, bool = true); bool testDisplayMode(QwtPlotSpectrogram::DisplayMode) const; void setData(const QwtRasterData&); const QwtRasterData& data() const; void setColorMap(const QwtColorMap&); const QwtColorMap& colorMap() const; virtual QwtDoubleRect boundingRect() const; virtual QSize rasterHint(const QwtDoubleRect&) const; void setDefaultContourPen(const QPen&); QPen defaultContourPen() const; virtual QPen contourPen(double) const; void setConrecAttribute(QwtRasterData::ConrecAttribute, bool); bool testConrecAttribute(QwtRasterData::ConrecAttribute) const; void setContourLevels(const QwtValueList&); QwtValueList contourLevels() const; virtual int rtti() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; protected: virtual QImage renderImage(const QwtScaleMap&, const QwtScaleMap&, const QwtDoubleRect&) const; virtual QSize contourRasterSize(const QwtDoubleRect&, const QRect&) const; // FIXME: virtual QMap renderContourLines(const QwtDoubleRect&, const QSize&) const; // FIXME: virtual void drawContourLines(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QMap&) const; }; // class QwtPlotSpectrogram // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_layout_metrics.sip0000444000175000017500000000550511130210270022430 0ustar poxpox// The SIP interface specification for: // QwtMetricsMap. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtMetricsMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtMetricsMap(); bool isIdentity() const; void setMetrics(const QPaintDevice*, const QPaintDevice*); int layoutToDeviceX(int) const; int deviceToLayoutX(int) const; int screenToLayoutX(int) const; int layoutToScreenX(int) const; int layoutToDeviceY(int) const; int deviceToLayoutY(int) const; int screenToLayoutY(int) const; int layoutToScreenY(int) const; QPoint layoutToDevice(const QPoint&, const QPainter* = 0) const; QPoint deviceToLayout(const QPoint&, const QPainter* = 0) const; QPoint screenToLayout(const QPoint&) const; QPoint layoutToScreen(const QPoint&) const; QSize layoutToDevice(const QSize&) const; QSize deviceToLayout(const QSize&) const; QSize screenToLayout(const QSize&) const; QSize layoutToScreen(const QSize&) const; QRect layoutToDevice(const QRect&, const QPainter* = 0) const; QRect deviceToLayout(const QRect&, const QPainter* = 0) const; QRect screenToLayout(const QRect&) const; QRect layoutToScreen(const QRect&) const; QwtPolygon layoutToDevice(const QwtPolygon&, const QPainter* = 0) const; QwtPolygon deviceToLayout(const QwtPolygon&, const QPainter* = 0) const; static QwtPolygon translate(const QMatrix&, const QwtPolygon&); static QRect translate(const QMatrix&, const QRect&); }; // class QwtMetricsMap // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_picker.sip0000444000175000017500000002632611130210270020646 0ustar poxpox// The SIP interface specification for: // QwtPicker. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_0_3) class QwtPicker: QObject, QwtEventPattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum SelectionType { NoSelection, PointSelection, RectSelection, PolygonSelection }; // enum SelectionType enum RectSelectionType { CornerToCorner, CenterToCorner, CenterToRadius }; // enum RectSelectionType enum SelectionMode { ClickSelection, DragSelection }; // enum SelectionMode enum RubberBand { NoRubberBand, HLineRubberBand, VLineRubberBand, CrossRubberBand, RectRubberBand, EllipseRubberBand, PolygonRubberBand, UserRubberBand }; // enum RubberBand enum DisplayMode { AlwaysOff, AlwaysOn, ActiveOnly }; // enum DisplayMode enum ResizeMode { Stretch, KeepSize }; // enum ResizeMode QwtPicker(QWidget* /TransferThis/); QwtPicker(int, QwtPicker::RubberBand, QwtPicker::DisplayMode, QWidget* /TransferThis/); virtual ~QwtPicker(); virtual void setSelectionFlags(int); int selectionFlags() const; virtual void setRubberBand(QwtPicker::RubberBand); QwtPicker::RubberBand rubberBand() const; virtual void setTrackerMode(QwtPicker::DisplayMode); QwtPicker::DisplayMode trackerMode() const; virtual void setResizeMode(QwtPicker::ResizeMode); QwtPicker::ResizeMode resizeMode() const; virtual void setRubberBandPen(const QPen&); QPen rubberBandPen() const; virtual void setTrackerPen(const QPen&); QPen trackerPen() const; virtual void setTrackerFont(const QFont&); QFont trackerFont() const; bool isEnabled() const; virtual void setEnabled(bool); bool isActive() const; virtual bool eventFilter(QObject*, QEvent*); QWidget* parentWidget(); // signature: const QWidget* parentWidget() const; virtual QRect pickRect() const; const QwtPolygon& selection() const; virtual void drawRubberBand(QPainter*) const; virtual void drawTracker(QPainter*) const; signals: void selected(const QwtPolygon&); void appended(const QPoint&); void moved(const QPoint&); void changed(const QwtPolygon&); protected: virtual bool accept(QwtPolygon&) const; virtual void transition(const QEvent*); virtual void begin(); virtual void append(const QPoint&); virtual void move(const QPoint&); virtual bool end(bool = true); virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseDoubleClickEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetWheelEvent(QWheelEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); virtual void widgetLeaveEvent(QEvent*); QRect trackerRect(QPainter*) const; virtual void stretchSelection(const QSize&, const QSize&); virtual QwtText trackerText(const QPoint&) const; virtual QwtPickerMachine* stateMachine(int) const /Factory/; virtual void updateDisplay(); const QWidget* rubberBandWidget() const; const QWidget* trackerWidget() const; }; // class QwtPicker %End // (Qwt_5_0_0 - Qwt_5_0_3) %If (Qwt_5_0_3 - Qwt_5_1_0) class QwtPicker: QObject, QwtEventPattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum SelectionType { NoSelection, PointSelection, RectSelection, PolygonSelection }; // enum SelectionType enum RectSelectionType { CornerToCorner, CenterToCorner, CenterToRadius }; // enum RectSelectionType enum SelectionMode { ClickSelection, DragSelection }; // enum SelectionMode enum RubberBand { NoRubberBand, HLineRubberBand, VLineRubberBand, CrossRubberBand, RectRubberBand, EllipseRubberBand, PolygonRubberBand, UserRubberBand }; // enum RubberBand enum DisplayMode { AlwaysOff, AlwaysOn, ActiveOnly }; // enum DisplayMode enum ResizeMode { Stretch, KeepSize }; // enum ResizeMode QwtPicker(QWidget* /TransferThis/); QwtPicker(int, QwtPicker::RubberBand, QwtPicker::DisplayMode, QWidget* /TransferThis/); virtual ~QwtPicker(); virtual void setSelectionFlags(int); int selectionFlags() const; virtual void setRubberBand(QwtPicker::RubberBand); QwtPicker::RubberBand rubberBand() const; virtual void setTrackerMode(QwtPicker::DisplayMode); QwtPicker::DisplayMode trackerMode() const; virtual void setResizeMode(QwtPicker::ResizeMode); QwtPicker::ResizeMode resizeMode() const; virtual void setRubberBandPen(const QPen&); QPen rubberBandPen() const; virtual void setTrackerPen(const QPen&); QPen trackerPen() const; virtual void setTrackerFont(const QFont&); QFont trackerFont() const; bool isEnabled() const; virtual void setEnabled(bool); bool isActive() const; virtual bool eventFilter(QObject*, QEvent*); QWidget* parentWidget(); // signature: const QWidget* parentWidget() const; virtual QRect pickRect() const; const QwtPolygon& selection() const; virtual void drawRubberBand(QPainter*) const; virtual void drawTracker(QPainter*) const; virtual QwtText trackerText(const QPoint&) const; QRect trackerRect(QPainter*) const; signals: void selected(const QwtPolygon&); void appended(const QPoint&); void moved(const QPoint&); void changed(const QwtPolygon&); protected: virtual bool accept(QwtPolygon&) const; virtual void transition(const QEvent*); virtual void begin(); virtual void append(const QPoint&); virtual void move(const QPoint&); virtual bool end(bool = true); virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseDoubleClickEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetWheelEvent(QWheelEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); virtual void widgetLeaveEvent(QEvent*); virtual void stretchSelection(const QSize&, const QSize&); virtual QwtPickerMachine* stateMachine(int) const /Factory/; virtual void updateDisplay(); const QWidget* rubberBandWidget() const; const QWidget* trackerWidget() const; }; // class QwtPicker %End // (Qwt_5_0_3 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPicker: QObject, QwtEventPattern { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum SelectionType { NoSelection, PointSelection, RectSelection, PolygonSelection }; // enum SelectionType enum RectSelectionType { CornerToCorner, CenterToCorner, CenterToRadius }; // enum RectSelectionType enum SelectionMode { ClickSelection, DragSelection }; // enum SelectionMode enum RubberBand { NoRubberBand, HLineRubberBand, VLineRubberBand, CrossRubberBand, RectRubberBand, EllipseRubberBand, PolygonRubberBand, UserRubberBand }; // enum RubberBand enum DisplayMode { AlwaysOff, AlwaysOn, ActiveOnly }; // enum DisplayMode enum ResizeMode { Stretch, KeepSize }; // enum ResizeMode QwtPicker(QWidget* /TransferThis/); QwtPicker(int, QwtPicker::RubberBand, QwtPicker::DisplayMode, QWidget* /TransferThis/); virtual ~QwtPicker(); virtual void setSelectionFlags(int); int selectionFlags() const; virtual void setRubberBand(QwtPicker::RubberBand); QwtPicker::RubberBand rubberBand() const; virtual void setTrackerMode(QwtPicker::DisplayMode); QwtPicker::DisplayMode trackerMode() const; virtual void setResizeMode(QwtPicker::ResizeMode); QwtPicker::ResizeMode resizeMode() const; virtual void setRubberBandPen(const QPen&); QPen rubberBandPen() const; virtual void setTrackerPen(const QPen&); QPen trackerPen() const; virtual void setTrackerFont(const QFont&); QFont trackerFont() const; bool isEnabled() const; virtual void setEnabled(bool); bool isActive() const; virtual bool eventFilter(QObject*, QEvent*); QWidget* parentWidget(); // signature: const QWidget* parentWidget() const; virtual QRect pickRect() const; const QwtPolygon& selection() const; virtual void drawRubberBand(QPainter*) const; virtual void drawTracker(QPainter*) const; virtual QwtText trackerText(const QPoint&) const; QPoint trackerPosition() const; QRect trackerRect(const QFont&) const; signals: void selected(const QwtPolygon&); void appended(const QPoint&); void moved(const QPoint&); void changed(const QwtPolygon&); protected: virtual bool accept(QwtPolygon&) const; virtual void transition(const QEvent*); virtual void begin(); virtual void append(const QPoint&); virtual void move(const QPoint&); virtual bool end(bool = true); virtual void reset(); virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseDoubleClickEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetWheelEvent(QWheelEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); virtual void widgetLeaveEvent(QEvent*); virtual void stretchSelection(const QSize&, const QSize&); virtual QwtPickerMachine* stateMachine(int) const /Factory/; virtual void updateDisplay(); const QWidget* rubberBandWidget() const; const QWidget* trackerWidget() const; }; // class QwtPicker %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_abstract_scale_draw.sip0000444000175000017500000000553711130210270023361 0ustar poxpox// The SIP interface specification for: // QwtAbstractScaleDraw. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtAbstractScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum ScaleComponent { Backbone, Ticks, Labels }; // enum ScaleComponent QwtAbstractScaleDraw(); QwtAbstractScaleDraw(const QwtAbstractScaleDraw&); virtual ~QwtAbstractScaleDraw(); // Not Pythonic: QwtAbstractScaleDraw& operator=(const QwtAbstractScaleDraw&); void setScaleDiv(const QwtScaleDiv&); const QwtScaleDiv& scaleDiv() const; void setTransformation(QwtScaleTransformation*); const QwtScaleMap& map() const; void enableComponent(QwtAbstractScaleDraw::ScaleComponent, bool = true); bool hasComponent(QwtAbstractScaleDraw::ScaleComponent) const; void setTickLength(QwtScaleDiv::TickType, int); int tickLength(QwtScaleDiv::TickType) const; int majTickLength() const; void setSpacing(int); int spacing() const; virtual void draw(QPainter*, const QPalette&) const; virtual QwtText label(double) const; virtual int extent(const QPen&, const QFont&) const = 0; void setMinimumExtent(int); int minimumExtent() const; QwtScaleMap& scaleMap(); protected: virtual void drawTick(QPainter*, double, int) const = 0; virtual void drawBackbone(QPainter*) const = 0; virtual void drawLabel(QPainter*, double) const = 0; void invalidateCache(); const QwtText& tickLabel(const QFont&, double) const; }; // class QwtAbstractScaleDraw // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_text_label.sip0000444000175000017500000000435611130210270021513 0ustar poxpox// The SIP interface specification for: // QwtTextLabel. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtTextLabel: QFrame { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtTextLabel(QWidget* /TransferThis/ = 0); QwtTextLabel(const QwtText&, QWidget* /TransferThis/ = 0); virtual ~QwtTextLabel(); public slots: void setText(const QString&, QwtText::TextFormat = QwtText::AutoText); virtual void setText(const QwtText&); void clear(); public: const QwtText& text() const; int indent() const; void setIndent(int); int margin() const; void setMargin(int); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual int heightForWidth(int) const; QRect textRect() const; protected: virtual void paintEvent(QPaintEvent*); virtual void drawContents(QPainter*); virtual void drawText(QPainter*, const QRect&); }; // class QwtTextLabel // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/QwtMap.sip0000444000175000017500000000770711163711320017721 0ustar poxpox// The SIP interface specification for: // QMap. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %MappedType QMap { %TypeHeaderCode #include %End %ConvertFromTypeCode PyObject *d = PyDict_New(); if (!d) return 0; QMap::const_iterator i = sipCpp->constBegin(); while (i != sipCpp->constEnd()) { QString *t = new QString(i.value()); PyObject *kobj = PyFloat_FromDouble(i.key()); #if SIP_VERSION < 0x040800 PyObject *tobj = sipConvertFromNewInstance( t, sipClass_QString, sipTransferObj); #else PyObject *tobj = sipConvertFromNewType( t, sipType_QString, sipTransferObj); #endif if ((0 == kobj) || (0 == tobj) || (0 > PyDict_SetItem(d, kobj, tobj))) { Py_DECREF(d); if (kobj) Py_DECREF(kobj); if (tobj) Py_DECREF(tobj); else delete t; return 0; } Py_DECREF(kobj); Py_DECREF(tobj); ++i; } return d; %End // ConvertFromTypeCode %ConvertToTypeCode PyObject *kobj, *tobj; SIP_SSIZE_T i = 0; if (0 == sipIsErr) { if (!PyDict_Check(sipPy)) return 0; while (PyDict_Next(sipPy, &i, &kobj, &tobj)) #if SIP_VERSION < 0x040800 if (!sipCanConvertToInstance(tobj, sipClass_QString, SIP_NOT_NONE)) #else if (!sipCanConvertToType(tobj, sipType_QString, SIP_NOT_NONE)) #endif return 0; return 1; } QMap *qm = new QMap; while (PyDict_Next(sipPy, &i, &kobj, &tobj)) { int state; double k = PyFloat_AS_DOUBLE(kobj); #if SIP_VERSION < 0x040800 QString *t = reinterpret_cast( sipConvertToInstance(tobj, sipClass_QString, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); #else QString *t = reinterpret_cast( sipConvertToType(tobj, sipType_QString, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); #endif if (*sipIsErr) { #if SIP_VERSION < 0x040800 sipReleaseInstance(t, sipClass_QString, state); #else sipReleaseType(t, sipType_QString, state); #endif delete qm; return 0; } qm->insert(k, *t); #if SIP_VERSION < 0x040800 sipReleaseInstance(t, sipClass_QString, state); #else sipReleaseType(t, sipType_QString, state); #endif } *sipCppPtr = qm; return sipGetState(sipTransferObj); %End // ConvertToTypeCode }; // QMap // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_compass.sip0000444000175000017500000000417611130210270021035 0ustar poxpox// The SIP interface specification for: // QwtCompass. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtCompass: QwtDial { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtCompass(QWidget* /TransferThis/ = 0); virtual ~QwtCompass(); void setRose(QwtCompassRose* /Transfer/); // signature: const QwtCompassRose* rose() const; QwtCompassRose* rose(); // signature: const QMap& labelMap() const; QMap& labelMap(); void setLabelMap(const QMap&); protected: virtual QwtText scaleLabel(double) const; virtual void drawRose(QPainter*, const QPoint&, int, double, QPalette::ColorGroup) const; virtual void drawScaleContents(QPainter*, const QPoint&, int) const; virtual void keyPressEvent(QKeyEvent*); }; // class QwtCompass // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_thermo.sip0000444000175000017500000000624311130210270020663 0ustar poxpox// The SIP interface specification for: // QwtThermo. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtThermo: QWidget, QwtAbstractScale { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum ScalePos { NoScale, LeftScale, RightScale, TopScale, BottomScale }; // enum ScalePos QwtThermo(QWidget* /TransferThis/ = 0); virtual ~QwtThermo(); void setOrientation(Qt::Orientation, QwtThermo::ScalePos); void setScalePosition(QwtThermo::ScalePos); QwtThermo::ScalePos scalePosition() const; void setBorderWidth(int); int borderWidth() const; void setFillBrush(const QBrush&); const QBrush& fillBrush() const; void setFillColor(const QColor&); const QColor& fillColor() const; void setAlarmBrush(const QBrush&); const QBrush& alarmBrush() const; void setAlarmColor(const QColor&); const QColor& alarmColor() const; void setAlarmLevel(double); double alarmLevel() const; void setAlarmEnabled(bool); bool alarmEnabled() const; void setPipeWidth(int); int pipeWidth() const; void setMaxValue(double); double maxValue() const; void setMinValue(double); double minValue() const; double value() const; void setRange(double, double, bool = false); void setMargin(int); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; void setScaleDraw(QwtScaleDraw* /Transfer/); // signature: const QwtScaleDraw* scaleDraw() const; public slots: void setValue(double); protected: void draw(QPainter*, const QRect&); void drawThermo(QPainter*); void layoutThermo(bool = true); virtual void scaleChange(); virtual void fontChange(const QFont&); virtual void paintEvent(QPaintEvent*); virtual void resizeEvent(QResizeEvent*); QwtScaleDraw* scaleDraw(); }; // class QwtThermo // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_abstract_scale.sip0000444000175000017500000000456211130210270022341 0ustar poxpox// The SIP interface specification for: // QwtAbstractScale. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtAbstractScale { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtAbstractScale(); virtual ~QwtAbstractScale(); void setScale(double, double, double = 0.0); void setScale(const QwtDoubleInterval&, double = 0.0); void setScale(const QwtScaleDiv&); void setAutoScale(); bool autoScale() const; void setScaleMaxMajor(int); int scaleMaxMinor() const; void setScaleMaxMinor(int); int scaleMaxMajor() const; void setScaleEngine(QwtScaleEngine* /Transfer/); // signature: const QwtScaleEngine* scaleEngine() const; QwtScaleEngine* scaleEngine(); const QwtScaleMap& scaleMap() const; protected: void rescale(double, double, double = 0.0); void setAbstractScaleDraw(QwtAbstractScaleDraw* /Transfer/); // signature: const QwtAbstractScaleDraw* abstractScaleDraw() const; QwtAbstractScaleDraw* abstractScaleDraw(); virtual void scaleChange(); }; // class QwtAbstractScale // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_rasteritem.sip0000444000175000017500000000632011130210270022576 0ustar poxpox// The SIP interface specification for: // QwtPlotRasterItem. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_0_1) class QwtPlotRasterItem: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum CachePolicy { NoCache, PaintCache, ScreenCache }; // enum CachePolicy QwtPlotRasterItem(const QString& = QString::null); QwtPlotRasterItem(const QwtText&); virtual ~QwtPlotRasterItem(); void setAlpha(int); int alpha() const; void setCachePolicy(QwtPlotRasterItem::CachePolicy); QwtPlotRasterItem::CachePolicy cachePolicy() const; void invalidateCache(); virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual QSize rasterHint(const QwtDoubleRect&) const; protected: virtual QImage renderImage(const QwtScaleMap&, const QwtScaleMap&, const QwtDoubleRect&) const = 0; }; // class QwtPlotRasterItem %End // (Qwt_5_0_0 - Qwt_5_0_1) %If (Qwt_5_0_1 - ) class QwtPlotRasterItem: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum CachePolicy { NoCache, PaintCache, ScreenCache }; // enum CachePolicy QwtPlotRasterItem(const QString& = QString::null); QwtPlotRasterItem(const QwtText&); virtual ~QwtPlotRasterItem(); void setAlpha(int); int alpha() const; void setCachePolicy(QwtPlotRasterItem::CachePolicy); QwtPlotRasterItem::CachePolicy cachePolicy() const; void invalidateCache(); virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual QSize rasterHint(const QwtDoubleRect&) const; protected: virtual QImage renderImage(const QwtScaleMap&, const QwtScaleMap&, const QwtDoubleRect&) const = 0; private: QwtPlotRasterItem(const QwtPlotRasterItem&); }; // class QwtPlotRasterItem %End // (Qwt_5_0_1 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_legend_itemmanager.sip0000444000175000017500000000332411130210270023171 0ustar poxpox// The SIP interface specification for: // QwtLegendItemManager. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtLegendItemManager { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtLegendItemManager(); virtual ~QwtLegendItemManager(); virtual void updateLegend(QwtLegend*) const = 0; virtual QWidget* legendItem() const = 0; }; // class QwtLegendItemManager // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_knob.sip0000444000175000017500000000517411130210270020320 0ustar poxpox// The SIP interface specification for: // QwtKnob. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtKnob: QwtAbstractSlider, QwtAbstractScale { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Symbol { Line, Dot }; // enum Symbol QwtKnob(QWidget* /TransferThis/ = 0); virtual ~QwtKnob(); void setKnobWidth(int); int knobWidth() const; void setTotalAngle(double); double totalAngle() const; void setBorderWidth(int); int borderWidth() const; void setSymbol(QwtKnob::Symbol); QwtKnob::Symbol symbol() const; virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; void setScaleDraw(QwtRoundScaleDraw* /Transfer/); // signature: const QwtRoundScaleDraw* scaleDraw() const; QwtRoundScaleDraw* scaleDraw(); protected: virtual void paintEvent(QPaintEvent*); virtual void resizeEvent(QResizeEvent*); void draw(QPainter*, const QRect&); void drawKnob(QPainter*, const QRect&); void drawMarker(QPainter*, double, const QColor&); private: virtual double getValue(const QPoint&); virtual void getScrollMode(const QPoint&, int& /Out/, int& /Out/); virtual void valueChange(); virtual void rangeChange(); virtual void scaleChange(); virtual void fontChange(const QFont&); }; // class QwtKnob // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_dict.sip0000444000175000017500000000334511130210270021346 0ustar poxpox// The SIP interface specification for: // QwtPlotDict. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotDict { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotDict(); ~QwtPlotDict(); void setAutoDelete(bool); bool autoDelete() const; const QList& itemList() const; void detachItems(int = QwtPlotItem::Rtti_PlotItem, bool = true); }; // class QwtPlotDict // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_printfilter.sip0000444000175000017500000000702411130210270022763 0ustar poxpox// The SIP interface specification for: // QwtPlotPrintFilter. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlotPrintFilter { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Options { PrintAll, PrintMargin, PrintTitle, PrintLegend, PrintGrid, PrintCanvasBackground, PrintWidgetBackground }; // enum Options enum Item { Title, Legend, Curve, CurveSymbol, Marker, MarkerSymbol, MajorGrid, MinorGrid, CanvasBackground, AxisScale, AxisTitle, WidgetBackground }; // enum Item QwtPlotPrintFilter(); virtual ~QwtPlotPrintFilter(); virtual QColor color(const QColor&, QwtPlotPrintFilter::Item) const; virtual QFont font(const QFont&, QwtPlotPrintFilter::Item) const; void setOptions(int); int options() const; virtual void apply(QwtPlot*) const; virtual void reset(QwtPlot*) const; virtual void apply(QwtPlotItem*) const; virtual void reset(QwtPlotItem*) const; }; // class QwtPlotPrintFilter %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPlotPrintFilter { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Options { PrintAll, PrintMargin, PrintTitle, PrintLegend, PrintGrid, PrintBackground, PrintFrameWithScales }; // enum Options enum Item { Title, Legend, Curve, CurveSymbol, Marker, MarkerSymbol, MajorGrid, MinorGrid, CanvasBackground, AxisScale, AxisTitle, WidgetBackground }; // enum Item QwtPlotPrintFilter(); virtual ~QwtPlotPrintFilter(); virtual QColor color(const QColor&, QwtPlotPrintFilter::Item) const; virtual QFont font(const QFont&, QwtPlotPrintFilter::Item) const; void setOptions(int); int options() const; virtual void apply(QwtPlot*) const; virtual void reset(QwtPlot*) const; virtual void apply(QwtPlotItem*) const; virtual void reset(QwtPlotItem*) const; }; // class QwtPlotPrintFilter %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_scale_map.sip0000444000175000017500000001141511231447464021331 0ustar poxpox// The SIP interface specification for: // QwtScaleMap, // QwtScaleTransformation. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_0_1) class QwtScaleMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: static const double LogMin; static const double LogMax; QwtScaleMap(); QwtScaleMap(const QwtScaleMap&); ~QwtScaleMap(); // Not Pythonic: QwtScaleMap& operator=(const QwtScaleMap&); void setTransformation(QwtScaleTransformation* /Transfer/); const QwtScaleTransformation* transformation() const; void setPaintInterval(int, int); void setPaintXInterval(double, double); void setScaleInterval(double, double); int transform(double) const; double invTransform(double) const; double xTransform(double) const; double p1() const; double p2() const; double s1() const; double s2() const; double pDist() const; double sDist() const; public: QwtScaleMap(int, int, double, double); %MethodCode sipCpp = new QwtScaleMap(); sipCpp->setPaintInterval(a0, a1); sipCpp->setScaleInterval(a2, a3); %End }; // class QwtScaleMap class QwtScaleTransformation { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Type { Linear, Log10, Other }; // enum Type QwtScaleTransformation(QwtScaleTransformation::Type); virtual ~QwtScaleTransformation(); virtual double xForm(double, double, double, double, double) const; virtual double invXForm(double, double, double, double, double) const; QwtScaleTransformation::Type type() const; virtual QwtScaleTransformation* copy() const /Factory/; private: QwtScaleTransformation(const QwtScaleTransformation&); }; // class QwtScaleTransformation %End // (Qwt_5_0_0 - Qwt_5_0_1) %If (Qwt_5_0_1 - ) class QwtScaleMap { %TypeHeaderCode #include %End // %TypeHeaderCode public: static const double LogMin; static const double LogMax; QwtScaleMap(); QwtScaleMap(const QwtScaleMap&); ~QwtScaleMap(); // Not Pythonic: QwtScaleMap& operator=(const QwtScaleMap&); void setTransformation(QwtScaleTransformation* /Transfer/); const QwtScaleTransformation* transformation() const; void setPaintInterval(int, int); void setPaintXInterval(double, double); void setScaleInterval(double, double); int transform(double) const; double invTransform(double) const; double xTransform(double) const; double p1() const; double p2() const; double s1() const; double s2() const; double pDist() const; double sDist() const; public: QwtScaleMap(int, int, double, double); %MethodCode sipCpp = new QwtScaleMap(); sipCpp->setPaintInterval(a0, a1); sipCpp->setScaleInterval(a2, a3); %End }; // class QwtScaleMap class QwtScaleTransformation { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Type { Linear, Log10, Other }; // enum Type QwtScaleTransformation(QwtScaleTransformation::Type); virtual ~QwtScaleTransformation(); virtual double xForm(double, double, double, double, double) const; virtual double invXForm(double, double, double, double, double) const; QwtScaleTransformation::Type type() const; virtual QwtScaleTransformation* copy() const /Factory/; private: QwtScaleTransformation(); private: QwtScaleTransformation(const QwtScaleTransformation&); }; // class QwtScaleTransformation %End // (Qwt_5_0_1 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_compass_rose.sip0000444000175000017500000000465711130210270022071 0ustar poxpox// The SIP interface specification for: // QwtCompassRose, // QwtSimpleCompassRose. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtCompassRose { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual ~QwtCompassRose(); virtual void setPalette(const QPalette&); const QPalette& palette() const; virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const = 0; }; // class QwtCompassRose class QwtSimpleCompassRose: QwtCompassRose { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtSimpleCompassRose(int = 8, int = -1); void setWidth(double); double width() const; void setNumThorns(int); int numThorns() const; void setNumThornLevels(int); int numThornLevels() const; void setShrinkFactor(double); double shrinkFactor() const; virtual void draw(QPainter*, const QPoint&, int, double, QPalette::ColorGroup = QPalette::Active) const; static void drawRose(QPainter*, const QPalette&, const QPoint&, int, double, double, int, int, double); }; // class QwtSimpleCompassRose // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_painter.sip0000444000175000017500000001201211172321327021032 0ustar poxpox// The SIP interface specification for: // QwtPainter. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtPainter { %TypeHeaderCode #include %End // %TypeHeaderCode public: static void setMetricsMap(const QPaintDevice*, const QPaintDevice*); static void setMetricsMap(const QwtMetricsMap&); static void resetMetricsMap(); static const QwtMetricsMap& metricsMap(); static void setDeviceClipping(bool); static bool deviceClipping(); static void setClipRect(QPainter*, const QRect&); static void drawText(QPainter*, int, int, const QString&); static void drawText(QPainter*, const QPoint&, const QString&); static void drawText(QPainter*, int, int, int, int, int, const QString&); static void drawText(QPainter*, const QRect&, int, const QString&); static void drawSimpleRichText(QPainter*, const QRect&, int, QTextDocument&); static void drawRect(QPainter*, int, int, int, int); static void drawRect(QPainter*, const QRect&); static void fillRect(QPainter*, const QRect&, const QBrush&); static void drawEllipse(QPainter*, const QRect&); static void drawPie(QPainter*, const QRect&, int, int); static void drawLine(QPainter*, int, int, int, int); static void drawLine(QPainter*, const QPoint&, const QPoint&); static void drawPolygon(QPainter*, const QwtPolygon&); static void drawPolyline(QPainter*, const QwtPolygon&); static void drawPoint(QPainter*, int, int); static void drawRoundFrame(QPainter*, const QRect&, int, const QPalette&, bool); static void drawFocusRect(QPainter*, QWidget*); static void drawFocusRect(QPainter*, QWidget*, const QRect&); static QwtPolygon clip(const QwtPolygon&); static void drawColorBar(QPainter*, const QwtColorMap&, const QwtDoubleInterval&, const QwtScaleMap&, Qt::Orientation, const QRect&); }; // class QwtPainter %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtPainter { %TypeHeaderCode #include %End // %TypeHeaderCode public: static void setMetricsMap(const QPaintDevice*, const QPaintDevice*); static void setMetricsMap(const QwtMetricsMap&); static void resetMetricsMap(); static const QwtMetricsMap& metricsMap(); static void setDeviceClipping(bool); static bool deviceClipping(); static const QRect& deviceClipRect(); static void setClipRect(QPainter*, const QRect&); static void drawText(QPainter*, int, int, const QString&); static void drawText(QPainter*, const QPoint&, const QString&); static void drawText(QPainter*, int, int, int, int, int, const QString&); static void drawText(QPainter*, const QRect&, int, const QString&); static void drawSimpleRichText(QPainter*, const QRect&, int, QTextDocument&); static void drawRect(QPainter*, int, int, int, int); static void drawRect(QPainter*, const QRect&); static void fillRect(QPainter*, const QRect&, const QBrush&); static void drawEllipse(QPainter*, const QRect&); static void drawPie(QPainter*, const QRect&, int, int); static void drawLine(QPainter*, int, int, int, int); static void drawLine(QPainter*, const QPoint&, const QPoint&); static void drawPolygon(QPainter*, const QwtPolygon&); static void drawPolyline(QPainter*, const QwtPolygon&); static void drawPoint(QPainter*, int, int); static void drawRoundFrame(QPainter*, const QRect&, int, const QPalette&, bool); static void drawFocusRect(QPainter*, QWidget*); static void drawFocusRect(QPainter*, QWidget*, const QRect&); static void drawColorBar(QPainter*, const QwtColorMap&, const QwtDoubleInterval&, const QwtScaleMap&, Qt::Orientation, const QRect&); static QPen scaledPen(const QPen&); }; // class QwtPainter %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/QwtArrayDouble.sip0000444000175000017500000000734311130210270021401 0ustar poxpox// The SIP interface specification for: // QwtArrayDouble. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrayDouble { %TypeHeaderCode #include typedef QwtArray QwtArrayDouble; %End // %TypeHeaderCode public: QwtArrayDouble(); QwtArrayDouble(int); QwtArrayDouble(const QwtArrayDouble &); QwtArrayDouble(SIP_PYOBJECT); %MethodCode QwtArray array; // Numeric is not thread-safe if (-1 == try_PyObject_to_QwtArray(a0, array)) return 0; sipCpp = new QwtArrayDouble(array); %End // QwtArrayDouble() ~QwtArrayDouble(); // not possible: QwtArray &operator=(const QwtArray &); // pulls in unwanted operators: bool operator==(const QVector &) const; // pulls in unwanted operators: bool operator!=(const QVector &) const; int size() const; bool isEmpty() const; void resize(int); int capacity() const; void reserve(int); void squeeze(); void detach(); bool isDetached() const; void setSharable(bool sharable); // not Pythonic: T *data(); // not Pythonic: const T *data() const; // not Pythonic: const T *constData() const; void clear(); double __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = (*sipCpp)[a0]; %End // __getitem__() int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End // __len__() void __setitem__(int, double); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = a1; %End // __setitem__() void __setitem__(SIP_PYSLICE, const QwtArrayDouble &); %MethodCode int len = sipCpp -> size(); Py_ssize_t start, stop, step, slicelength; if (0 > sipConvertFromSliceObject(a0, len, &start, &stop, &step, &slicelength)) sipIsErr = 1; else { int vlen = a1 -> size(); if (vlen != slicelength) { sipBadLengthForSlice(vlen, slicelength); sipIsErr = 1; } else { QwtArrayDouble::ConstIterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[int(start)] = *it; start += step; ++it; } } } %End // __setitem__() }; // class QwtArrayDouble // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_dial.sip0000444000175000017500000001567211172321327020320 0ustar poxpox// The SIP interface specification for: // QwtDial, // QwtDialScaleDraw. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtDial: QwtAbstractSlider { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Shadow { Plain, Raised, Sunken }; // enum Shadow enum ScaleOptions { ScaleBackbone, ScaleTicks, ScaleLabel }; // enum ScaleOptions enum Mode { RotateNeedle, RotateScale }; // enum Mode QwtDial(QWidget* /TransferThis/ = 0); virtual ~QwtDial(); void setFrameShadow(QwtDial::Shadow); QwtDial::Shadow frameShadow() const; bool hasVisibleBackground() const; void showBackground(bool); void setLineWidth(int); int lineWidth() const; void setMode(QwtDial::Mode); QwtDial::Mode mode() const; virtual void setWrapping(bool); bool wrapping() const; virtual void setScale(int, int, double = 0.0); void setScaleArc(double, double); void setScaleOptions(int); void setScaleTicks(int, int, int, int = 1); double minScaleArc() const; double maxScaleArc() const; virtual void setOrigin(double); double origin() const; virtual void setNeedle(QwtDialNeedle* /Transfer/); // signature: const QwtDialNeedle* needle() const; QwtDialNeedle* needle(); QRect boundingRect() const; QRect contentsRect() const; virtual QRect scaleContentsRect() const; virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual void setScaleDraw(QwtDialScaleDraw* /Transfer/); QwtDialScaleDraw* scaleDraw(); // signature: const QwtDialScaleDraw* scaleDraw() const; protected: virtual void paintEvent(QPaintEvent*); virtual void resizeEvent(QResizeEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void updateMask(); virtual void drawFrame(QPainter*); virtual void drawContents(QPainter*) const; virtual void drawFocusIndicator(QPainter*) const; virtual void drawScale(QPainter*, const QPoint&, int, double, double, double) const; virtual void drawScaleContents(QPainter*, const QPoint&, int) const; virtual void drawNeedle(QPainter*, const QPoint&, int, double, QPalette::ColorGroup) const; virtual QwtText scaleLabel(double) const; void updateScale(); virtual void rangeChange(); virtual void valueChange(); virtual double getValue(const QPoint&); virtual void getScrollMode(const QPoint&, int& /Out/, int& /Out/); }; // class QwtDial class QwtDialScaleDraw: QwtRoundScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDialScaleDraw(QwtDial*); virtual QwtText label(double) const; void setPenWidth(uint); uint penWidth() const; }; // class QwtDialScaleDraw %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtDial: QwtAbstractSlider { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Shadow { Plain, Raised, Sunken }; // enum Shadow enum ScaleOptions { ScaleBackbone, ScaleTicks, ScaleLabel }; // enum ScaleOptions enum Mode { RotateNeedle, RotateScale }; // enum Mode enum Direction { Clockwise, CounterClockwise }; // enum Direction QwtDial(QWidget* /TransferThis/ = 0); virtual ~QwtDial(); void setFrameShadow(QwtDial::Shadow); QwtDial::Shadow frameShadow() const; bool hasVisibleBackground() const; void showBackground(bool); void setLineWidth(int); int lineWidth() const; void setMode(QwtDial::Mode); QwtDial::Mode mode() const; virtual void setWrapping(bool); bool wrapping() const; virtual void setScale(int, int, double = 0.0); void setScaleArc(double, double); void setScaleOptions(int); void setScaleTicks(int, int, int, int = 1); double minScaleArc() const; double maxScaleArc() const; virtual void setOrigin(double); double origin() const; void setDirection(QwtDial::Direction); QwtDial::Direction direction() const; virtual void setNeedle(QwtDialNeedle* /Transfer/); // signature: const QwtDialNeedle* needle() const; QwtDialNeedle* needle(); QRect boundingRect() const; QRect contentsRect() const; virtual QRect scaleContentsRect() const; virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual void setScaleDraw(QwtDialScaleDraw* /Transfer/); QwtDialScaleDraw* scaleDraw(); // signature: const QwtDialScaleDraw* scaleDraw() const; protected: virtual void paintEvent(QPaintEvent*); virtual void resizeEvent(QResizeEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void updateMask(); virtual void drawFrame(QPainter*); virtual void drawContents(QPainter*) const; virtual void drawFocusIndicator(QPainter*) const; virtual void drawScale(QPainter*, const QPoint&, int, double, double, double) const; virtual void drawScaleContents(QPainter*, const QPoint&, int) const; virtual void drawNeedle(QPainter*, const QPoint&, int, double, QPalette::ColorGroup) const; virtual QwtText scaleLabel(double) const; void updateScale(); virtual void rangeChange(); virtual void valueChange(); virtual double getValue(const QPoint&); virtual void getScrollMode(const QPoint&, int& /Out/, int& /Out/); }; // class QwtDial class QwtDialScaleDraw: QwtRoundScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDialScaleDraw(QwtDial*); virtual QwtText label(double) const; void setPenWidth(uint); uint penWidth() const; }; // class QwtDialScaleDraw %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_curve_fitter.sip0000444000175000017500000000456311130210270022071 0ustar poxpox// The SIP interface specification for: // QwtCurveFitter, // QwtSplineCurveFitter. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtCurveFitter { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual ~QwtCurveFitter(); virtual QPolygonF fitCurve(const QPolygonF&) const = 0; protected: QwtCurveFitter(); private: QwtCurveFitter(const QwtCurveFitter&); }; // class QwtCurveFitter class QwtSplineCurveFitter: QwtCurveFitter { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum FitMode { Auto, Spline, ParametricSpline }; // enum FitMode QwtSplineCurveFitter(); virtual ~QwtSplineCurveFitter(); void setFitMode(QwtSplineCurveFitter::FitMode); QwtSplineCurveFitter::FitMode fitMode() const; void setSpline(const QwtSpline&); // signature: const QwtSpline& spline() const; QwtSpline& spline(); void setSplineSize(int); int splineSize() const; virtual QPolygonF fitCurve(const QPolygonF&) const; }; // class QwtSplineCurveFitter // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/QwtModule.sip0000444000175000017500000001227211231257034020425 0ustar poxpox// The SIP interface definition for the Qwt module of PyQwt. // // Copyright (C) 2001-2007 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %Module PyQt4.Qwt5.Qwt 0 %Timeline {Qwt_5_0_0 Qwt_5_0_1 Qwt_5_0_3 Qwt_5_1_0 Qwt_5_1_1 Qwt_5_2_0} %Feature CXX_DYNAMIC_CAST %Feature HAS_NUMARRAY %Feature HAS_NUMERIC %Feature HAS_NUMPY %Feature HAS_QWT5 %Feature HAS_QWT4 %Feature HAS_QWT_SVG %Import QtCore/QtCoremod.sip %Import QtGui/QtGuimod.sip %If (HAS_QWT_SVG) %Import QtSvg/QtSvgmod.sip %End // HAS_QWT_SVG %Include QwtTypes.sip %ModuleHeaderCode #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #endif #include #include %End %PostInitialisationCode #ifdef HAS_NUMARRAY qwt_import_numarray(); #endif #ifdef HAS_NUMERIC qwt_import_numeric(); #endif #ifdef HAS_NUMPY qwt_import_numpy(); #endif %End typedef QPointF QwtDoublePoint; typedef QPolygon QwtPolygon; %If (Qwt_5_1_0 - ) typedef QPolygonF QwtPolygonF; %End // (Qwt_5_1_0 - ) typedef QRectF QwtDoubleRect; typedef QSizeF QwtDoubleSize; // Converter code %Include QwtMap.sip %Include QwtList.sip %Include QwtStack.sip // Template code %Include QwtArrayDouble.sip %Include QwtArrayInt.sip %Include QwtArrayQwtDoubleInterval.sip %Include QwtArrayQwtDoublePoint.sip // Wrapper code %Include qwt_abstract_scale.sip %Include qwt_abstract_scale_draw.sip %Include qwt_abstract_slider.sip %Include qwt_analog_clock.sip %Include qwt_arrow_button.sip %If (Qwt_5_1_0 - ) %Include qwt_clipper.sip %End // (Qwt_5_1_0 - ) %Include qwt_color_map.sip %Include qwt_compass.sip %Include qwt_compass_rose.sip %Include qwt_counter.sip %Include qwt_curve_fitter.sip %Include qwt_data.sip %Include qwt_dial.sip %Include qwt_dial_needle.sip %Include qwt_double_interval.sip %Include qwt_double_range.sip %Include qwt_dyngrid_layout.sip %Include qwt_event_pattern.sip %Include qwt_interval_data.sip %Include qwt_knob.sip %Include qwt_layout_metrics.sip %Include qwt_legend.sip %Include qwt_legend_item.sip %If (Qwt_5_1_0 - ) %Include qwt_legend_itemmanager.sip %Include qwt_magnifier.sip %End // (Qwt_5_1_0 - ) %Include qwt_panner.sip %Include qwt_painter.sip %Include qwt_picker.sip %Include qwt_picker_machine.sip %Include qwt_plot.sip %Include qwt_plot_canvas.sip %Include qwt_plot_curve.sip %Include qwt_plot_dict.sip %Include qwt_plot_grid.sip %Include qwt_plot_item.sip %Include qwt_plot_layout.sip %Include qwt_plot_magnifier.sip %Include qwt_plot_marker.sip %Include qwt_plot_panner.sip %Include qwt_plot_picker.sip %Include qwt_plot_printfilter.sip %Include qwt_plot_rasteritem.sip %If (Qwt_5_2_0 - ) %Include qwt_plot_rescaler.sip %End // (Qwt_5_2_0 - ) %If (Qwt_5_1_0 - ) %Include qwt_plot_scaleitem.sip %End // (Qwt_5_1_0 - ) %Include qwt_plot_spectrogram.sip %If (HAS_QWT_SVG) %Include qwt_plot_svgitem.sip %End // HAS_QWT_SVG %Include qwt_plot_zoomer.sip %Include qwt_raster_data.sip %If ( - Qwt_5_2_0) %Include qwt_rect.sip %End // ( - Qwt_5_2_0) %Include qwt_round_scale_draw.sip %Include qwt_scale_div.sip %Include qwt_scale_draw.sip %Include qwt_scale_engine.sip %Include qwt_scale_map.sip %Include qwt_scale_widget.sip %Include qwt_slider.sip %Include qwt_spline.sip %Include qwt_symbol.sip %Include qwt_text.sip %Include qwt_text_engine.sip %Include qwt_text_label.sip %Include qwt_thermo.sip %Include qwt_wheel.sip // qwt_global.h const int QWT_VERSION; const char *QWT_VERSION_STR; // qwt_math.h // Those functions have no equivalent in Python QPoint qwtPolar2Pos(const QPoint &, double, double); QPoint qwtDegree2Pos(const QPoint &, double, double); // Image support QImage toQImage(SIP_PYOBJECT); %MethodCode // Numeric is not thread-safe sipRes = 0; if (-1 == try_PyObject_to_QImage(a0, &sipRes)) return 0; %End %If (HAS_NUMARRAY) SIP_PYOBJECT toNumarray(const QImage &); %End %If (HAS_NUMERIC) SIP_PYOBJECT toNumeric(const QImage &); %End %If (HAS_NUMPY) SIP_PYOBJECT toNumpy(const QImage &); %End // Local Variables: // mode: C++ // c-file-style: "stroustrup" // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_svgitem.sip0000444000175000017500000000423411130210270022077 0ustar poxpox// The SIP interface specification for: // QwtPlotSvgItem. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotSvgItem: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotSvgItem(const QString& = QString::null); QwtPlotSvgItem(const QwtText&); virtual ~QwtPlotSvgItem(); bool loadFile(const QwtDoubleRect&, const QString&); bool loadData(const QwtDoubleRect&, const QByteArray&); virtual QwtDoubleRect boundingRect() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual int rtti() const; protected: // signature: const QSvgRenderer& renderer() const; QSvgRenderer& renderer(); void render(QPainter*, const QwtDoubleRect&, const QRect&) const; QwtDoubleRect viewBox(const QwtDoubleRect&) const; }; // class QwtPlotSvgItem // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_arrow_button.sip0000444000175000017500000000412111130210270022103 0ustar poxpox// The SIP interface specification for: // QwtArrowButton. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrowButton: QPushButton { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtArrowButton(int, Qt::ArrowType, QWidget* /TransferThis/ = 0); virtual ~QwtArrowButton(); Qt::ArrowType arrowType() const; int num() const; virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; protected: virtual void paintEvent(QPaintEvent*); virtual void drawButtonLabel(QPainter*); virtual void drawArrow(QPainter*, const QRect&, Qt::ArrowType) const; virtual QRect labelRect() const; virtual QSize arrowSize(Qt::ArrowType, const QSize&) const; virtual void keyPressEvent(QKeyEvent*); }; // class QwtArrowButton // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_scaleitem.sip0000444000175000017500000000470011231524521022376 0ustar poxpox// The SIP interface specification for: // QwtPlotScaleItem. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotScaleItem: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotScaleItem(QwtScaleDraw::Alignment = QwtScaleDraw::BottomScale, const double = 0.0); virtual ~QwtPlotScaleItem(); virtual int rtti() const; void setScaleDiv(const QwtScaleDiv&); const QwtScaleDiv& scaleDiv() const; void setScaleDivFromAxis(bool); bool isScaleDivFromAxis() const; void setPalette(const QPalette&); QPalette palette() const; void setFont(const QFont&); QFont font() const; void setScaleDraw(QwtScaleDraw* /Transfer/); // signature: const QwtScaleDraw* scaleDraw() const; QwtScaleDraw* scaleDraw(); void setPosition(double); double position() const; void setBorderDistance(int); int borderDistance() const; void setAlignment(QwtScaleDraw::Alignment); virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual void updateScaleDiv(const QwtScaleDiv&, const QwtScaleDiv&); }; // class QwtPlotScaleItem // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_raster_data.sip0000444000175000017500000000440011130210270021647 0ustar poxpox// The SIP interface specification for: // QwtRasterData. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtRasterData { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum ConrecAttribute { IgnoreAllVerticesOnLevel, IgnoreOutOfRange }; // enum ConrecAttribute QwtRasterData(); QwtRasterData(const QwtDoubleRect&); virtual ~QwtRasterData(); virtual QwtRasterData* copy() const = 0 /Factory/; virtual void setBoundingRect(const QwtDoubleRect&); QwtDoubleRect boundingRect() const; virtual QSize rasterHint(const QwtDoubleRect&) const; virtual void initRaster(const QwtDoubleRect&, const QSize&); virtual void discardRaster(); virtual double value(double, double) const = 0; virtual QwtDoubleInterval range() const = 0; // FIXME: virtual QMap contourLines(const QwtDoubleRect&, const QSize&, const QList&, int) const; }; // class QwtRasterData // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot.sip0000444000175000017500000005153211172321327020360 0ustar poxpox// The SIP interface specification for: // QwtPlot. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlot: QFrame, QwtPlotDict { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Axis { yLeft, yRight, xBottom, xTop, axisCnt }; // enum Axis enum LegendPosition { LeftLegend, RightLegend, BottomLegend, TopLegend, ExternalLegend }; // enum LegendPosition QwtPlot(QWidget* /TransferThis/ = 0); QwtPlot(const QwtText&, QWidget* /TransferThis/ = 0); virtual ~QwtPlot(); void applyProperties(const QString&); QString grabProperties() const; void setAutoReplot(bool = true); bool autoReplot() const; void print(QPaintDevice&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; virtual void print(QPainter*, const QRect&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; QwtPlotLayout* plotLayout(); // signature: const QwtPlotLayout* plotLayout() const; void setMargin(int); int margin() const; void setTitle(const QString&); void setTitle(const QwtText&); QwtText title() const; QwtTextLabel* titleLabel(); // signature: const QwtTextLabel* titleLabel() const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; void setCanvasBackground(const QColor&); const QColor& canvasBackground() const; void setCanvasLineWidth(int); int canvasLineWidth() const; virtual QwtScaleMap canvasMap(int) const; double invTransform(int, int) const; int transform(int, double) const; QwtScaleEngine* axisScaleEngine(int); // signature: const QwtScaleEngine* axisScaleEngine(int) const; void setAxisScaleEngine(int, QwtScaleEngine* /Transfer/); void setAxisAutoScale(int); bool axisAutoScale(int) const; void enableAxis(int, bool = true); bool axisEnabled(int) const; void setAxisFont(int, const QFont&); QFont axisFont(int) const; void setAxisScale(int, double, double, double = 0); void setAxisScaleDiv(int, const QwtScaleDiv&); void setAxisScaleDraw(int, QwtScaleDraw* /Transfer/); // signature: const QwtScaleDiv* axisScaleDiv(int) const; QwtScaleDiv* axisScaleDiv(int); // signature: const QwtScaleDraw* axisScaleDraw(int) const; QwtScaleDraw* axisScaleDraw(int); // signature: const QwtScaleWidget* axisWidget(int) const; QwtScaleWidget* axisWidget(int); void setAxisLabelAlignment(int, Qt::Alignment); void setAxisLabelRotation(int, double); void setAxisTitle(int, const QString&); void setAxisTitle(int, const QwtText&); QwtText axisTitle(int) const; void setAxisMaxMinor(int, int); int axisMaxMajor(int) const; void setAxisMaxMajor(int, int); int axisMaxMinor(int) const; void insertLegend(QwtLegend* /Transfer/, QwtPlot::LegendPosition = QwtPlot::RightLegend, double = -1); QwtLegend* legend(); // signature: const QwtLegend* legend() const; virtual void polish(); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual void updateLayout(); virtual bool event(QEvent*); signals: void legendClicked(QwtPlotItem*); void legendChecked(QwtPlotItem*, bool); public slots: void clear(); virtual void replot(); void autoRefresh(); protected slots: virtual void legendItemClicked(); virtual void legendItemChecked(bool); protected: static bool axisValid(int); virtual void drawCanvas(QPainter*); virtual void drawItems(QPainter*, const QRect&, SIP_PYLIST, const QwtPlotPrintFilter&) const [ void (QPainter*, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&)]; %MethodCode // PyQwt takes a list with QwtScaleMap objects in the first // QwtPlot::axisCnt elements. QwtScaleMap maps[QwtPlot::axisCnt]; sipIsErr = QwtPlot::axisCnt > PyList_GET_SIZE(a2); if (!sipIsErr) { for (int i=0; i(cpp); } } if (!sipIsErr) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_drawItems(sipSelfWasArg, a0, *a1, maps, *a3); Py_END_ALLOW_THREADS } %End %VirtualCatcherCode PyObject *maps = PyList_New(QwtPlot::axisCnt); sipIsErr = !maps; if (!sipIsErr) { for (int i=0; i(&a2[i]), sipClass_QwtScaleMap, 0); if (!object) { sipIsErr = true; break; } PyList_SET_ITEM(maps, i, object); } } if (!sipIsErr) { PyObject *result = sipCallMethod( &sipIsErr, sipMethod, "CCSC", a0, sipClass_QPainter, 0, &a1, sipClass_QRect, 0, maps, &a3, sipClass_QwtPlotPrintFilter, 0); if (result) { sipParseResult(&sipIsErr, sipMethod, result, "Z"); Py_DECREF(result); } } Py_XDECREF(maps); %End virtual void updateTabOrder(); void updateAxes(); virtual void resizeEvent(QResizeEvent*); virtual void printLegendItem(QPainter*, const QWidget*, const QRect&) const; virtual void printTitle(QPainter*, const QRect&) const; virtual void printScale(QPainter*, int, int, int, int, const QRect&) const; virtual void printCanvas(QPainter*, const QRect&, SIP_PYLIST, const QwtPlotPrintFilter&) const [ void (QPainter*, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&)]; %MethodCode // PyQwt takes a list with QwtScaleMap objects in the first // QwtPlot::axisCnt elements. QwtScaleMap maps[QwtPlot::axisCnt]; sipIsErr = QwtPlot::axisCnt > PyList_GET_SIZE(a2); if (!sipIsErr) { for (int i=0; i(cpp); } } if (!sipIsErr) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_printCanvas( sipSelfWasArg, a0, *a1, maps, *a3); Py_END_ALLOW_THREADS } End %VirtualCatcherCode PyObject *maps = PyList_New(QwtPlot::axisCnt); sipIsErr = !maps; if (!sipIsErr) { for (int i=0; i(&a2[i]), sipClass_QwtScaleMap, 0); if (!object) { sipIsErr = true; break; } PyList_SET_ITEM(maps, i, object); } } if (!sipIsErr) { PyObject *result = sipCallMethod( &sipIsErr, sipMethod, "CCSC", a0, sipClass_QPainter, 0, &a1, sipClass_QRect, 0, maps, &a3, sipClass_QwtPrintFilter, 0); if (result) { sipParseResult(&sipIsErr, sipMethod, result, "Z"); Py_DECREF(result); } } Py_XDECREF(maps); %End virtual void printLegend(QPainter*, const QRect&) const; }; // class QwtPlot %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - Qwt_5_2_0) class QwtPlot: QFrame, QwtPlotDict { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Axis { yLeft, yRight, xBottom, xTop, axisCnt }; // enum Axis enum LegendPosition { LeftLegend, RightLegend, BottomLegend, TopLegend, ExternalLegend }; // enum LegendPosition QwtPlot(QWidget* /TransferThis/ = 0); QwtPlot(const QwtText&, QWidget* /TransferThis/ = 0); virtual ~QwtPlot(); void applyProperties(const QString&); QString grabProperties() const; void setAutoReplot(bool = true); bool autoReplot() const; void print(QPaintDevice&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; virtual void print(QPainter*, const QRect&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; QwtPlotLayout* plotLayout(); // signature: const QwtPlotLayout* plotLayout() const; void setMargin(int); int margin() const; void setTitle(const QString&); void setTitle(const QwtText&); QwtText title() const; QwtTextLabel* titleLabel(); // signature: const QwtTextLabel* titleLabel() const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; void setCanvasBackground(const QColor&); const QColor& canvasBackground() const; void setCanvasLineWidth(int); int canvasLineWidth() const; virtual QwtScaleMap canvasMap(int) const; double invTransform(int, int) const; int transform(int, double) const; QwtScaleEngine* axisScaleEngine(int); // signature: const QwtScaleEngine* axisScaleEngine(int) const; void setAxisScaleEngine(int, QwtScaleEngine* /Transfer/); void setAxisAutoScale(int); bool axisAutoScale(int) const; void enableAxis(int, bool = true); bool axisEnabled(int) const; void setAxisFont(int, const QFont&); QFont axisFont(int) const; void setAxisScale(int, double, double, double = 0); void setAxisScaleDiv(int, const QwtScaleDiv&); void setAxisScaleDraw(int, QwtScaleDraw* /Transfer/); double axisStepSize(int) const; // signature: const QwtScaleDiv* axisScaleDiv(int) const; QwtScaleDiv* axisScaleDiv(int); // signature: const QwtScaleDraw* axisScaleDraw(int) const; QwtScaleDraw* axisScaleDraw(int); // signature: const QwtScaleWidget* axisWidget(int) const; QwtScaleWidget* axisWidget(int); void setAxisLabelAlignment(int, Qt::Alignment); void setAxisLabelRotation(int, double); void setAxisTitle(int, const QString&); void setAxisTitle(int, const QwtText&); QwtText axisTitle(int) const; void setAxisMaxMinor(int, int); int axisMaxMajor(int) const; void setAxisMaxMajor(int, int); int axisMaxMinor(int) const; void insertLegend(QwtLegend* /Transfer/, QwtPlot::LegendPosition = QwtPlot::RightLegend, double = -1); QwtLegend* legend(); // signature: const QwtLegend* legend() const; virtual void polish(); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual void updateLayout(); virtual bool event(QEvent*); signals: void legendClicked(QwtPlotItem*); void legendChecked(QwtPlotItem*, bool); public slots: virtual void clear(); virtual void replot(); void autoRefresh(); protected slots: virtual void legendItemClicked(); virtual void legendItemChecked(bool); protected: static bool axisValid(int); virtual void drawCanvas(QPainter*); virtual void drawItems(QPainter*, const QRect&, SIP_PYLIST, const QwtPlotPrintFilter&) const [ void (QPainter*, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&)]; %MethodCode // PyQwt takes a list with QwtScaleMap objects in the first // QwtPlot::axisCnt elements. QwtScaleMap maps[QwtPlot::axisCnt]; sipIsErr = QwtPlot::axisCnt > PyList_GET_SIZE(a2); if (!sipIsErr) { for (int i=0; i(cpp); } } if (!sipIsErr) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_drawItems(sipSelfWasArg, a0, *a1, maps, *a3); Py_END_ALLOW_THREADS } %End %VirtualCatcherCode PyObject *maps = PyList_New(QwtPlot::axisCnt); sipIsErr = !maps; if (!sipIsErr) { for (int i=0; i(&a2[i]), sipClass_QwtScaleMap, 0); if (!object) { sipIsErr = true; break; } PyList_SET_ITEM(maps, i, object); } } if (!sipIsErr) { PyObject *result = sipCallMethod( &sipIsErr, sipMethod, "CCSC", a0, sipClass_QPainter, 0, &a1, sipClass_QRect, 0, maps, &a3, sipClass_QwtPlotPrintFilter, 0); if (result) { sipParseResult(&sipIsErr, sipMethod, result, "Z"); Py_DECREF(result); } } Py_XDECREF(maps); %End virtual void updateTabOrder(); void updateAxes(); virtual void resizeEvent(QResizeEvent*); virtual void printLegendItem(QPainter*, const QWidget*, const QRect&) const; virtual void printTitle(QPainter*, const QRect&) const; virtual void printScale(QPainter*, int, int, int, int, const QRect&) const; virtual void printCanvas(QPainter*, const QRect&, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&) const; virtual void printLegend(QPainter*, const QRect&) const; }; // class QwtPlot %End // (Qwt_5_1_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtPlot: QFrame, QwtPlotDict { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Axis { yLeft, yRight, xBottom, xTop, axisCnt }; // enum Axis enum LegendPosition { LeftLegend, RightLegend, BottomLegend, TopLegend, ExternalLegend }; // enum LegendPosition QwtPlot(QWidget* /TransferThis/ = 0); QwtPlot(const QwtText&, QWidget* /TransferThis/ = 0); virtual ~QwtPlot(); void applyProperties(const QString&); QString grabProperties() const; void setAutoReplot(bool = true); bool autoReplot() const; void print(QPaintDevice&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; virtual void print(QPainter*, const QRect&, const QwtPlotPrintFilter& = QwtPlotPrintFilter()) const /PyName=print_/; QwtPlotLayout* plotLayout(); // signature: const QwtPlotLayout* plotLayout() const; void setMargin(int); int margin() const; void setTitle(const QString&); void setTitle(const QwtText&); QwtText title() const; QwtTextLabel* titleLabel(); // signature: const QwtTextLabel* titleLabel() const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; void setCanvasBackground(const QColor&); const QColor& canvasBackground() const; void setCanvasLineWidth(int); int canvasLineWidth() const; virtual QwtScaleMap canvasMap(int) const; double invTransform(int, int) const; int transform(int, double) const; QwtScaleEngine* axisScaleEngine(int); // signature: const QwtScaleEngine* axisScaleEngine(int) const; void setAxisScaleEngine(int, QwtScaleEngine* /Transfer/); void setAxisAutoScale(int); bool axisAutoScale(int) const; void enableAxis(int, bool = true); bool axisEnabled(int) const; void setAxisFont(int, const QFont&); QFont axisFont(int) const; void setAxisScale(int, double, double, double = 0); void setAxisScaleDiv(int, const QwtScaleDiv&); void setAxisScaleDraw(int, QwtScaleDraw* /Transfer/); double axisStepSize(int) const; // signature: const QwtScaleDiv* axisScaleDiv(int) const; QwtScaleDiv* axisScaleDiv(int); // signature: const QwtScaleDraw* axisScaleDraw(int) const; QwtScaleDraw* axisScaleDraw(int); // signature: const QwtScaleWidget* axisWidget(int) const; QwtScaleWidget* axisWidget(int); void setAxisLabelAlignment(int, Qt::Alignment); void setAxisLabelRotation(int, double); void setAxisTitle(int, const QString&); void setAxisTitle(int, const QwtText&); QwtText axisTitle(int) const; void setAxisMaxMinor(int, int); int axisMaxMajor(int) const; void setAxisMaxMajor(int, int); int axisMaxMinor(int) const; void insertLegend(QwtLegend* /Transfer/, QwtPlot::LegendPosition = QwtPlot::RightLegend, double = -1); QwtLegend* legend(); // signature: const QwtLegend* legend() const; virtual void polish(); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual void updateLayout(); virtual void drawCanvas(QPainter*); void updateAxes(); virtual bool event(QEvent*); signals: void legendClicked(QwtPlotItem*); void legendChecked(QwtPlotItem*, bool); public slots: virtual void clear(); virtual void replot(); void autoRefresh(); protected slots: virtual void legendItemClicked(); virtual void legendItemChecked(bool); protected: static bool axisValid(int); virtual void drawItems(QPainter*, const QRect&, SIP_PYLIST, const QwtPlotPrintFilter&) const [ void (QPainter*, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&)]; %MethodCode // PyQwt takes a list with QwtScaleMap objects in the first // QwtPlot::axisCnt elements. QwtScaleMap maps[QwtPlot::axisCnt]; sipIsErr = QwtPlot::axisCnt > PyList_GET_SIZE(a2); if (!sipIsErr) { for (int i=0; i(cpp); } } if (!sipIsErr) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_drawItems(sipSelfWasArg, a0, *a1, maps, *a3); Py_END_ALLOW_THREADS } %End %VirtualCatcherCode PyObject *maps = PyList_New(QwtPlot::axisCnt); sipIsErr = !maps; if (!sipIsErr) { for (int i=0; i(&a2[i]), sipClass_QwtScaleMap, 0); if (!object) { sipIsErr = true; break; } PyList_SET_ITEM(maps, i, object); } } if (!sipIsErr) { PyObject *result = sipCallMethod( &sipIsErr, sipMethod, "CCSC", a0, sipClass_QPainter, 0, &a1, sipClass_QRect, 0, maps, &a3, sipClass_QwtPlotPrintFilter, 0); if (result) { sipParseResult(&sipIsErr, sipMethod, result, "Z"); Py_DECREF(result); } } Py_XDECREF(maps); %End virtual void updateTabOrder(); virtual void resizeEvent(QResizeEvent*); virtual void printLegendItem(QPainter*, const QWidget*, const QRect&) const; virtual void printTitle(QPainter*, const QRect&) const; virtual void printScale(QPainter*, int, int, int, int, const QRect&) const; virtual void printCanvas(QPainter*, const QRect&, const QRect&, const QwtScaleMap*, const QwtPlotPrintFilter&) const; virtual void printLegend(QPainter*, const QRect&) const; }; // class QwtPlot %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_round_scale_draw.sip0000444000175000017500000000421611130210270022676 0ustar poxpox// The SIP interface specification for: // QwtRoundScaleDraw. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtRoundScaleDraw: QwtAbstractScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtRoundScaleDraw(); QwtRoundScaleDraw(const QwtRoundScaleDraw&); virtual ~QwtRoundScaleDraw(); // Not Pythonic: QwtRoundScaleDraw& operator=(const QwtRoundScaleDraw&); void setRadius(int); int radius() const; void moveCenter(int, int); void moveCenter(const QPoint&); QPoint center() const; void setAngleRange(double, double); virtual int extent(const QPen&, const QFont&) const; protected: virtual void drawTick(QPainter*, double, int) const; virtual void drawBackbone(QPainter*) const; virtual void drawLabel(QPainter*, double) const; }; // class QwtRoundScaleDraw // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_rect.sip0000444000175000017500000000414511130210270020321 0ustar poxpox// The SIP interface specification for: // QwtRect. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtRect: QRect { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtRect(); QwtRect(const QRect&); QwtPolygon clip(const QwtPolygon&) const; }; // class QwtRect %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - Qwt_5_1_1) class QwtRect: QRect { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtRect(); QwtRect(const QRect&); }; // class QwtRect %End // (Qwt_5_1_0 - Qwt_5_1_1) %If (Qwt_5_1_1 - ) class QwtRect: QRect { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtRect(); QwtRect(const QRect&); QwtPolygon clip(const QwtPolygon&) const; }; // class QwtRect %End // (Qwt_5_1_1 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_symbol.sip0000444000175000017500000000725011130210270020671 0ustar poxpox// The SIP interface specification for: // QwtSymbol. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtSymbol { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Style { NoSymbol, Ellipse, Rect, Diamond, Triangle, DTriangle, UTriangle, LTriangle, RTriangle, Cross, XCross, HLine, VLine, Star1, Star2, Hexagon, StyleCnt }; // enum Style QwtSymbol(); QwtSymbol(QwtSymbol::Style, const QBrush&, const QPen&, const QSize&); virtual ~QwtSymbol(); bool operator!=(const QwtSymbol&) const; bool operator==(const QwtSymbol&) const; void setSize(const QSize&); void setSize(int, int = -1); void setBrush(const QBrush&); void setPen(const QPen&); void setStyle(QwtSymbol::Style); const QBrush& brush() const; const QPen& pen() const; const QSize& size() const; QwtSymbol::Style style() const; void draw(QPainter*, const QPoint&) const; void draw(QPainter*, int, int) const; virtual void draw(QPainter*, const QRect&) const; }; // class QwtSymbol %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtSymbol { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Style { NoSymbol, Ellipse, Rect, Diamond, Triangle, DTriangle, UTriangle, LTriangle, RTriangle, Cross, XCross, HLine, VLine, Star1, Star2, Hexagon, StyleCnt }; // enum Style QwtSymbol(); QwtSymbol(QwtSymbol::Style, const QBrush&, const QPen&, const QSize&); virtual ~QwtSymbol(); bool operator!=(const QwtSymbol&) const; virtual bool operator==(const QwtSymbol&) const; virtual QwtSymbol* clone() const /Factory/; void setSize(const QSize&); void setSize(int, int = -1); void setBrush(const QBrush&); void setPen(const QPen&); void setStyle(QwtSymbol::Style); const QBrush& brush() const; const QPen& pen() const; const QSize& size() const; QwtSymbol::Style style() const; void draw(QPainter*, const QPoint&) const; void draw(QPainter*, int, int) const; virtual void draw(QPainter*, const QRect&) const; }; // class QwtSymbol %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_curve.sip0000444000175000017500000001135011130210270021542 0ustar poxpox// The SIP interface specification for: // QwtPlotCurve. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotCurve: QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum CurveType { Yfx, Xfy }; // enum CurveType enum CurveStyle { NoCurve, Lines, Sticks, Steps, Dots, UserCurve }; // enum CurveStyle enum CurveAttribute { Inverted, Fitted }; // enum CurveAttribute enum PaintAttribute { PaintFiltered, ClipPolygons }; // enum PaintAttribute QwtPlotCurve(); QwtPlotCurve(const QwtText&); QwtPlotCurve(const QString&); virtual ~QwtPlotCurve(); virtual int rtti() const; void setCurveType(QwtPlotCurve::CurveType); QwtPlotCurve::CurveType curveType() const; void setPaintAttribute(QwtPlotCurve::PaintAttribute, bool = true); bool testPaintAttribute(QwtPlotCurve::PaintAttribute) const; // Not Pythonic: void setRawData(const double*, const double*, int); void setData(SIP_PYOBJECT, SIP_PYOBJECT); %MethodCode QwtArray xArray; if (-1 == try_PyObject_to_QwtArray(a0, xArray)) return 0; QwtArray yArray; if (-1 == try_PyObject_to_QwtArray(a1, yArray)) return 0; sipCpp->QwtPlotCurve::setData(xArray, yArray); %End void setData(const QwtArrayDouble&, const QwtArrayDouble&); void setData(const QPolygonF&); void setData(const QwtData&); int closestPoint(const QPoint&, double* = 0) const; QwtData& data(); // signature: const QwtData& data() const; int dataSize() const; double x(int) const; double y(int) const; virtual QwtDoubleRect boundingRect() const; double minXValue() const; double maxXValue() const; double minYValue() const; double maxYValue() const; void setCurveAttribute(QwtPlotCurve::CurveAttribute, bool = true); bool testCurveAttribute(QwtPlotCurve::CurveAttribute) const; void setPen(const QPen&); const QPen& pen() const; void setBrush(const QBrush&); const QBrush& brush() const; void setBaseline(double); double baseline() const; void setStyle(QwtPlotCurve::CurveStyle); QwtPlotCurve::CurveStyle style() const; void setSymbol(const QwtSymbol&); const QwtSymbol& symbol() const; void setCurveFitter(QwtCurveFitter* /Transfer/); QwtCurveFitter* curveFitter() const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, int, int) const /PyName=drawFromTo/; void draw(int, int) const; virtual void updateLegend(QwtLegend*) const; protected: void init(); virtual void drawCurve(QPainter*, int, const QwtScaleMap&, const QwtScaleMap&, int, int) const; virtual void drawSymbols(QPainter*, const QwtSymbol&, const QwtScaleMap&, const QwtScaleMap&, int, int) const; void drawLines(QPainter*, const QwtScaleMap&, const QwtScaleMap&, int, int) const; void drawSticks(QPainter*, const QwtScaleMap&, const QwtScaleMap&, int, int) const; void drawDots(QPainter*, const QwtScaleMap&, const QwtScaleMap&, int, int) const; void drawSteps(QPainter*, const QwtScaleMap&, const QwtScaleMap&, int, int) const; void fillCurve(QPainter*, const QwtScaleMap&, const QwtScaleMap&, QwtPolygon&) const; void closePolyline(const QwtScaleMap&, const QwtScaleMap&, QwtPolygon&) const; }; // class QwtPlotCurve // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_magnifier.sip0000444000175000017500000000517711130210270021333 0ustar poxpox// The SIP interface specification for: // QwtMagnifier. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtMagnifier: QObject { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtMagnifier(QWidget* /TransferThis/); virtual ~QwtMagnifier(); QWidget* parentWidget(); // signature: const QWidget* parentWidget() const; void setEnabled(bool); bool isEnabled() const; void setMouseFactor(double); double mouseFactor() const; void setMouseButton(int, int = Qt::NoButton); void getMouseButton(int&, int&) const; void setWheelFactor(double); double wheelFactor() const; void setWheelButtonState(int); int wheelButtonState() const; void setKeyFactor(double); double keyFactor() const; void setZoomInKey(int, int); void getZoomInKey(int&, int&) const; void setZoomOutKey(int, int); void getZoomOutKey(int&, int&) const; virtual bool eventFilter(QObject*, QEvent*); protected: virtual void rescale(double) = 0; virtual void widgetMousePressEvent(QMouseEvent*); virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetMouseMoveEvent(QMouseEvent*); virtual void widgetWheelEvent(QWheelEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void widgetKeyReleaseEvent(QKeyEvent*); }; // class QwtMagnifier // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_picker.sip0000444000175000017500000001015611172321327021712 0ustar poxpox// The SIP interface specification for: // QwtPlotPicker. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtPlotPicker: QwtPicker { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotPicker(QwtPlotCanvas* /TransferThis/); QwtPlotPicker(int, int, QwtPlotCanvas* /TransferThis/); QwtPlotPicker(int, int, int, QwtPicker::RubberBand, QwtPicker::DisplayMode, QwtPlotCanvas* /TransferThis/); virtual void setAxis(int, int); int xAxis() const; int yAxis() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; signals: void selected(const QwtDoublePoint&); void selected(const QwtDoubleRect&); void selected(const QwtArrayQwtDoublePoint&); void appended(const QwtDoublePoint&); void moved(const QwtDoublePoint&); protected: QwtDoubleRect scaleRect() const; QwtDoubleRect invTransform(const QRect&) const; QRect transform(const QwtDoubleRect&) const; QwtDoublePoint invTransform(const QPoint&) const; QPoint transform(const QwtDoublePoint&) const; virtual QwtText trackerText(const QPoint&) const; virtual QwtText trackerText(const QwtDoublePoint&) const /PyName=trackerTextF/; virtual void move(const QPoint&); virtual void append(const QPoint&); virtual bool end(bool = true); }; // class QwtPlotPicker %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtPlotPicker: QwtPicker { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotPicker(QwtPlotCanvas* /TransferThis/); virtual ~QwtPlotPicker(); QwtPlotPicker(int, int, QwtPlotCanvas* /TransferThis/); QwtPlotPicker(int, int, int, QwtPicker::RubberBand, QwtPicker::DisplayMode, QwtPlotCanvas* /TransferThis/); virtual void setAxis(int, int); int xAxis() const; int yAxis() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; signals: void selected(const QwtDoublePoint&); void selected(const QwtDoubleRect&); void selected(const QwtArrayQwtDoublePoint&); void appended(const QwtDoublePoint&); void moved(const QwtDoublePoint&); protected: QwtDoubleRect scaleRect() const; QwtDoubleRect invTransform(const QRect&) const; QRect transform(const QwtDoubleRect&) const; QwtDoublePoint invTransform(const QPoint&) const; QPoint transform(const QwtDoublePoint&) const; virtual QwtText trackerText(const QPoint&) const; virtual QwtText trackerText(const QwtDoublePoint&) const /PyName=trackerTextF/; virtual void move(const QPoint&); virtual void append(const QPoint&); virtual bool end(bool = true); }; // class QwtPlotPicker %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_interval_data.sip0000444000175000017500000000534611172321327022221 0ustar poxpox// The SIP interface specification for: // QwtIntervalData. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtIntervalData { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtIntervalData(); QwtIntervalData(const QVector&, const QwtArrayDouble&); void setData(const QVector&, const QwtArrayDouble&); size_t size() const; const QwtDoubleInterval& interval(size_t) const; double value(size_t) const; QwtDoubleRect boundingRect() const; QwtIntervalData(const QwtArrayQwtDoubleInterval&, const QwtArrayDouble&); void setData(const QwtArrayQwtDoubleInterval&, const QwtArrayDouble&); }; // class QwtIntervalData %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtIntervalData { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtIntervalData(); QwtIntervalData(const QVector&, const QwtArrayDouble&); ~QwtIntervalData(); void setData(const QVector&, const QwtArrayDouble&); size_t size() const; const QwtDoubleInterval& interval(size_t) const; double value(size_t) const; QwtDoubleRect boundingRect() const; QwtIntervalData(const QwtArrayQwtDoubleInterval&, const QwtArrayDouble&); void setData(const QwtArrayQwtDoubleInterval&, const QwtArrayDouble&); }; // class QwtIntervalData %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_scale_div.sip0000444000175000017500000001251211172321327021326 0ustar poxpox// The SIP interface specification for: // QwtScaleDiv. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtScaleDiv { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum TickType { NoTick, MinorTick, MediumTick, MajorTick, NTickTypes }; // enum TickType QwtScaleDiv(); QwtScaleDiv(const QwtDoubleInterval&, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a1, *a2, *a3}; sipCpp = new QwtScaleDiv(*a0, ticks); Py_END_ALLOW_THREADS %End QwtScaleDiv(double, double, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a2, *a3, *a4}; sipCpp = new QwtScaleDiv(a0, a1, ticks); Py_END_ALLOW_THREADS %End int operator==(const QwtScaleDiv&) const; int operator!=(const QwtScaleDiv&) const; double lBound() const; double hBound() const; double range() const; bool contains(double) const; const QwtValueList& ticks(int) const; void invalidate(); bool isValid() const; void invert(); }; // class QwtScaleDiv %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - Qwt_5_2_0) class QwtScaleDiv { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum TickType { NoTick, MinorTick, MediumTick, MajorTick, NTickTypes }; // enum TickType QwtScaleDiv(); QwtScaleDiv(const QwtDoubleInterval&, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a1, *a2, *a3}; sipCpp = new QwtScaleDiv(*a0, ticks); Py_END_ALLOW_THREADS %End QwtScaleDiv(double, double, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a2, *a3, *a4}; sipCpp = new QwtScaleDiv(a0, a1, ticks); Py_END_ALLOW_THREADS %End int operator==(const QwtScaleDiv&) const; int operator!=(const QwtScaleDiv&) const; void setInterval(double, double); void setInterval(const QwtDoubleInterval&); QwtDoubleInterval interval() const; double lBound() const; double hBound() const; double range() const; bool contains(double) const; void setTicks(int, const QwtValueList&); const QwtValueList& ticks(int) const; void invalidate(); bool isValid() const; void invert(); }; // class QwtScaleDiv %End // (Qwt_5_1_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtScaleDiv { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum TickType { NoTick, MinorTick, MediumTick, MajorTick, NTickTypes }; // enum TickType QwtScaleDiv(); QwtScaleDiv(const QwtDoubleInterval&, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a1, *a2, *a3}; sipCpp = new QwtScaleDiv(*a0, ticks); Py_END_ALLOW_THREADS %End QwtScaleDiv(double, double, QwtValueList, QwtValueList, QwtValueList) [(const QwtDoubleInterval&, QwtValueList*)]; %MethodCode Py_BEGIN_ALLOW_THREADS QwtValueList ticks[QwtScaleDiv::NTickTypes] = {*a2, *a3, *a4}; sipCpp = new QwtScaleDiv(a0, a1, ticks); Py_END_ALLOW_THREADS %End int operator==(const QwtScaleDiv&) const; int operator!=(const QwtScaleDiv&) const; void setInterval(double, double); void setInterval(const QwtDoubleInterval&); QwtDoubleInterval interval() const; double lowerBound() const; double upperBound() const; double range() const; bool contains(double) const; void setTicks(int, const QwtValueList&); const QwtValueList& ticks(int) const; void invalidate(); bool isValid() const; void invert(); }; // class QwtScaleDiv %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_abstract_slider.sip0000444000175000017500000001176011163672235022555 0ustar poxpox// The SIP interface specification for: // QwtAbstractSlider. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtAbstractSlider: QWidget, QwtDoubleRange { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum ScrollMode { ScrNone, ScrMouse, ScrTimer, ScrDirect, ScrPage }; // enum ScrollMode QwtAbstractSlider(Qt::Orientation, QWidget* /TransferThis/ = 0); virtual ~QwtAbstractSlider(); void setUpdateTime(int); void stopMoving(); void setTracking(bool); virtual void setMass(double); virtual double mass() const; virtual void setOrientation(Qt::Orientation); Qt::Orientation orientation() const; bool isReadOnly() const; bool isValid() const; void setValid(bool); public slots: virtual void setValue(double); virtual void fitValue(double); virtual void incValue(int); virtual void setReadOnly(bool); signals: void valueChanged(double); void sliderPressed(); void sliderReleased(); void sliderMoved(double); protected: virtual void setPosition(const QPoint&); virtual void valueChange(); virtual void timerEvent(QTimerEvent*); virtual void mousePressEvent(QMouseEvent*); virtual void mouseReleaseEvent(QMouseEvent*); virtual void mouseMoveEvent(QMouseEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void wheelEvent(QWheelEvent*); virtual double getValue(const QPoint&) = 0; virtual void getScrollMode(const QPoint&, int&, int&) = 0; void setMouseOffset(double); double mouseOffset() const; int scrollMode() const; // python mksccode PyQt4.Qwt5 %ConvertToSubClassCode static struct class_graph { const char *name; sipWrapperType **type; int yes, no; } graph[] = { {sipName_QwtAbstractSlider, &sipClass_QwtAbstractSlider, 13, 1}, #if QWT_VERSION >= 0x050100 {sipName_QwtPanner, &sipClass_QwtPanner, 19, 2}, #else {0, 0, 19, 2}, #endif {sipName_QwtDynGridLayout, &sipClass_QwtDynGridLayout, -1, 3}, {sipName_QwtCounter, &sipClass_QwtCounter, -1, 4}, {sipName_QwtLegend, &sipClass_QwtLegend, -1, 5}, {sipName_QwtArrowButton, &sipClass_QwtArrowButton, -1, 6}, {sipName_QwtScaleWidget, &sipClass_QwtScaleWidget, -1, 7}, {sipName_QwtTextLabel, &sipClass_QwtTextLabel, 20, 8}, {sipName_QwtPlotCanvas, &sipClass_QwtPlotCanvas, -1, 9}, {sipName_QwtThermo, &sipClass_QwtThermo, -1, 10}, #if QWT_VERSION >= 0x050100 {sipName_QwtMagnifier, &sipClass_QwtMagnifier, 21, 11}, #else {0, 0, 21, 11}, #endif {sipName_QwtPlot, &sipClass_QwtPlot, -1, 12}, {sipName_QwtPicker, &sipClass_QwtPicker, 22, -1}, {sipName_QwtDial, &sipClass_QwtDial, 17, 14}, {sipName_QwtSlider, &sipClass_QwtSlider, -1, 15}, {sipName_QwtWheel, &sipClass_QwtWheel, -1, 16}, {sipName_QwtKnob, &sipClass_QwtKnob, -1, -1}, {sipName_QwtAnalogClock, &sipClass_QwtAnalogClock, -1, 18}, {sipName_QwtCompass, &sipClass_QwtCompass, -1, -1}, {sipName_QwtPlotPanner, &sipClass_QwtPlotPanner, -1, -1}, {sipName_QwtLegendItem, &sipClass_QwtLegendItem, -1, -1}, {sipName_QwtPlotMagnifier, &sipClass_QwtPlotMagnifier, -1, -1}, {sipName_QwtPlotPicker, &sipClass_QwtPlotPicker, 23, -1}, {sipName_QwtPlotZoomer, &sipClass_QwtPlotZoomer, -1, -1}, }; int i = 0; sipClass = NULL; do { struct class_graph *cg = &graph[i]; if (cg->name != NULL && sipCpp->inherits(cg->name)) { sipClass = *cg->type; i = cg->yes; } else { i = cg->no; } } while (i >= 0); %End }; // class QwtAbstractSlider // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_zoomer.sip0000444000175000017500000001011511130210270021727 0ustar poxpox// The SIP interface specification for: // QwtPlotZoomer. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlotZoomer: QwtPlotPicker { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotZoomer(QwtPlotCanvas* /TransferThis/, bool = true); QwtPlotZoomer(int, int, QwtPlotCanvas* /TransferThis/, bool = true); QwtPlotZoomer(int, int, int, QwtPicker::DisplayMode, QwtPlotCanvas* /TransferThis/, bool = true); virtual ~QwtPlotZoomer(); virtual void setZoomBase(); virtual void setZoomBase(const QwtDoubleRect&); QwtDoubleRect zoomBase() const; QwtDoubleRect zoomRect() const; virtual void setAxis(int, int); void setMaxStackDepth(int); int maxStackDepth() const; const QStack& zoomStack() const; uint zoomRectIndex() const; virtual void setSelectionFlags(int); public slots: void moveBy(double, double); virtual void move(double, double); virtual void zoom(const QwtDoubleRect&); virtual void zoom(int); signals: void zoomed(const QwtDoubleRect&); protected: virtual void rescale(); virtual QwtDoubleSize minZoomSize() const; virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void begin(); virtual bool end(bool = true); virtual bool accept(QwtPolygon&) const; }; // class QwtPlotZoomer %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPlotZoomer: QwtPlotPicker { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotZoomer(QwtPlotCanvas* /TransferThis/, bool = true); QwtPlotZoomer(int, int, QwtPlotCanvas* /TransferThis/, bool = true); QwtPlotZoomer(int, int, int, QwtPicker::DisplayMode, QwtPlotCanvas* /TransferThis/, bool = true); virtual ~QwtPlotZoomer(); virtual void setZoomBase(bool = true); virtual void setZoomBase(const QwtDoubleRect&); QwtDoubleRect zoomBase() const; QwtDoubleRect zoomRect() const; virtual void setAxis(int, int); void setMaxStackDepth(int); int maxStackDepth() const; const QStack& zoomStack() const; void setZoomStack(const QStack&, int = -1); uint zoomRectIndex() const; virtual void setSelectionFlags(int); public slots: void moveBy(double, double); virtual void move(double, double); virtual void zoom(const QwtDoubleRect&); virtual void zoom(int); signals: void zoomed(const QwtDoubleRect&); protected: virtual void rescale(); virtual QwtDoubleSize minZoomSize() const; virtual void widgetMouseReleaseEvent(QMouseEvent*); virtual void widgetKeyPressEvent(QKeyEvent*); virtual void begin(); virtual bool end(bool = true); virtual bool accept(QwtPolygon&) const; }; // class QwtPlotZoomer %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_legend_item.sip0000444000175000017500000001111711172321327021651 0ustar poxpox// The SIP interface specification for: // QwtLegendItem. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtLegendItem: QwtTextLabel { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum IdentifierMode { NoIdentifier, ShowLine, ShowSymbol, ShowText }; // enum IdentifierMode QwtLegendItem(QWidget* /TransferThis/ = 0); QwtLegendItem(const QwtSymbol&, const QPen&, const QwtText&, QWidget* /TransferThis/ = 0); virtual ~QwtLegendItem(); virtual void setText(const QwtText&); void setItemMode(QwtLegend::LegendItemMode); QwtLegend::LegendItemMode itemMode() const; void setIdentifierMode(int); int identifierMode() const; void setIdentfierWidth(int); int identifierWidth() const; void setSpacing(int); int spacing() const; void setSymbol(const QwtSymbol&); const QwtSymbol& symbol() const; void setCurvePen(const QPen&); const QPen& curvePen() const; virtual void drawIdentifier(QPainter*, const QRect&) const; virtual void drawItem(QPainter*, const QRect&) const; virtual QSize sizeHint() const; bool isChecked() const; public slots: void setChecked(bool); signals: void clicked(); void pressed(); void released(); void checked(bool); protected: void setDown(bool); bool isDown() const; virtual void paintEvent(QPaintEvent*); virtual void mousePressEvent(QMouseEvent*); virtual void mouseReleaseEvent(QMouseEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void keyReleaseEvent(QKeyEvent*); virtual void drawText(QPainter*, const QRect&); }; // class QwtLegendItem %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtLegendItem: QwtTextLabel { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum IdentifierMode { NoIdentifier, ShowLine, ShowSymbol, ShowText }; // enum IdentifierMode QwtLegendItem(QWidget* /TransferThis/ = 0); QwtLegendItem(const QwtSymbol&, const QPen&, const QwtText&, QWidget* /TransferThis/ = 0); virtual ~QwtLegendItem(); virtual void setText(const QwtText&); void setItemMode(QwtLegend::LegendItemMode); QwtLegend::LegendItemMode itemMode() const; void setIdentifierMode(int); int identifierMode() const; void setIdentifierWidth(int); int identifierWidth() const; void setSpacing(int); int spacing() const; void setSymbol(const QwtSymbol&); const QwtSymbol& symbol() const; void setCurvePen(const QPen&); const QPen& curvePen() const; virtual void drawIdentifier(QPainter*, const QRect&) const; virtual void drawItem(QPainter*, const QRect&) const; virtual QSize sizeHint() const; bool isChecked() const; public slots: void setChecked(bool); signals: void clicked(); void pressed(); void released(); void checked(bool); protected: void setDown(bool); bool isDown() const; virtual void paintEvent(QPaintEvent*); virtual void mousePressEvent(QMouseEvent*); virtual void mouseReleaseEvent(QMouseEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void keyReleaseEvent(QKeyEvent*); virtual void drawText(QPainter*, const QRect&); }; // class QwtLegendItem %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_rescaler.sip0000444000175000017500000000646311172321327022243 0ustar poxpox// The SIP interface specification for: // QwtPlotRescaler. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotRescaler: QObject { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum RescalePolicy { Fixed, Expanding, Fitting }; // enum RescalePolicy enum ExpandingDirection { ExpandUp, ExpandDown, ExpandBoth }; // enum ExpandingDirection QwtPlotRescaler(QwtPlotCanvas*, int = QwtPlot::xBottom, QwtPlotRescaler::RescalePolicy = Expanding); virtual ~QwtPlotRescaler(); void setEnabled(bool); bool isEnabled() const; void setRescalePolicy(QwtPlotRescaler::RescalePolicy); QwtPlotRescaler::RescalePolicy rescalePolicy() const; void setExpandingDirection(QwtPlotRescaler::ExpandingDirection); void setExpandingDirection(int, QwtPlotRescaler::ExpandingDirection); QwtPlotRescaler::ExpandingDirection expandingDirection(int) const; void setReferenceAxis(int); int referenceAxis() const; void setAspectRatio(double); void setAspectRatio(int, double); double aspectRatio(int) const; void setIntervalHint(int, const QwtDoubleInterval&); QwtDoubleInterval intervalHint(int) const; QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; virtual bool eventFilter(QObject*, QEvent*); void rescale() const; protected: virtual void canvasResizeEvent(QResizeEvent*); virtual void rescale(const QSize&, const QSize&) const; virtual QwtDoubleInterval expandScale(int, const QSize&, const QSize&) const; virtual QwtDoubleInterval syncScale(int, const QwtDoubleInterval&, const QSize&) const; virtual void updateScales(QwtDoubleInterval*) const; Qt::Orientation orientation(int) const; QwtDoubleInterval interval(int) const; QwtDoubleInterval expandInterval(const QwtDoubleInterval&, double, QwtPlotRescaler::ExpandingDirection) const; }; // class QwtPlotRescaler // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_dyngrid_layout.sip0000444000175000017500000000511211130210270022414 0ustar poxpox// The SIP interface specification for: // QwtDynGridLayout. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtDynGridLayout: QLayout { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDynGridLayout(QWidget* /TransferThis/, int = 0, int = -1); QwtDynGridLayout(int = -1); virtual ~QwtDynGridLayout(); virtual void invalidate(); void setMaxCols(uint); uint maxCols() const; uint numRows() const; uint numCols() const; virtual void addItem(QLayoutItem* /Transfer/); virtual QLayoutItem* itemAt(int) const; virtual QLayoutItem* takeAt(int); virtual int count() const; void setExpandingDirections(Qt::Orientations); virtual Qt::Orientations expandingDirections() const; QList layoutItems(const QRect&, uint) const; virtual int maxItemWidth() const; virtual void setGeometry(const QRect&); virtual bool hasHeightForWidth() const; virtual int heightForWidth(int) const; virtual QSize sizeHint() const; virtual bool isEmpty() const; uint itemCount() const; virtual uint columnsForWidth(int) const; protected: void layoutGrid(uint, QwtArrayInt&, QwtArrayInt&) const; void stretchGrid(const QRect&, uint, QwtArrayInt&, QwtArrayInt&) const; }; // class QwtDynGridLayout // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/QwtArrayQwtDoubleInterval.sip0000444000175000017500000001074211163711320023607 0ustar poxpox// The SIP interface specification for: // QwtArrayDoubleInterval. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrayQwtDoubleInterval { %TypeHeaderCode #include #include typedef QwtArray QwtArrayQwtDoubleInterval; %End // %TypeHeaderCode public: QwtArrayQwtDoubleInterval(); QwtArrayQwtDoubleInterval(int); QwtArrayQwtDoubleInterval(const QwtArrayQwtDoubleInterval &); QwtArrayQwtDoubleInterval(SIP_PYLIST); %MethodCode // FIXME QwtArray array(PyList_GET_SIZE(a0)); for (int i = 0; i < PyList_GET_SIZE(a0); ++i) { #if SIP_VERSION < 0x040800 void *cpp = sipForceConvertToInstance( PyList_GET_ITEM(a0, i), sipClass_QwtDoubleInterval, NULL, SIP_NO_CONVERTORS, NULL, &sipIsErr); #else void *cpp = sipForceConvertToType( PyList_GET_ITEM(a0, i), sipType_QwtDoubleInterval, NULL, SIP_NO_CONVERTORS, NULL, &sipIsErr); #endif array[i] = *reinterpret_cast(cpp); } sipCpp = new QwtArrayQwtDoubleInterval(array); %End // QwtArrayQwtDoubleInterval() ~QwtArrayQwtDoubleInterval(); // not possible: QwtArray &operator=(const QwtArray &); // pulls in unwanted operators: bool operator==(const QVector &) const; // pulls in unwanted operators: bool operator!=(const QVector &) const; int size() const; bool isEmpty() const; void resize(int); int capacity() const; void reserve(int); void squeeze(); void detach(); bool isDetached() const; void setSharable(bool sharable); // not Pythonic: T *data(); // not Pythonic: const T *data() const; // not Pythonic: const T *constData() const; void clear(); QwtDoubleInterval & __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = &(*sipCpp)[a0]; %End // __getitem__() int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End // __len__() void __setitem__(int, QwtDoubleInterval); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = *a1; %End // __setitem__() void __setitem__(SIP_PYSLICE, const QwtArrayQwtDoubleInterval &); %MethodCode int len = sipCpp -> size(); Py_ssize_t start, stop, step, slicelength; if (0 > sipConvertFromSliceObject(a0, len, &start, &stop, &step, &slicelength)) sipIsErr = 1; else { int vlen = a1 -> size(); if (vlen != slicelength) { sipBadLengthForSlice(vlen, slicelength); sipIsErr = 1; } else { QwtArrayQwtDoubleInterval::ConstIterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[int(start)] = *it; start += step; ++it; } } } %End // __setitem__() }; // class QwtArrayQwtDoubleInterval // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_double_range.sip0000444000175000017500000000434311130210270022012 0ustar poxpox// The SIP interface specification for: // QwtDoubleRange. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtDoubleRange { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtDoubleRange(); virtual ~QwtDoubleRange(); void setRange(double, double, double = 0.0, int = 1); void setValid(bool); bool isValid() const; virtual void setValue(double); double value() const; void setPeriodic(bool); bool periodic() const; void setStep(double); double step() const; double maxValue() const; double minValue() const; int pageSize() const; virtual void incValue(int); virtual void incPages(int); virtual void fitValue(double); protected: double exactValue() const; double exactPrevValue() const; double prevValue() const; virtual void valueChange(); virtual void stepChange(); virtual void rangeChange(); }; // class QwtDoubleRange // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_scale_widget.sip0000444000175000017500000000654511207550770022045 0ustar poxpox// The SIP interface specification for: // QwtScaleWidget. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtScaleWidget: QWidget { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtScaleWidget(QWidget* = 0); QwtScaleWidget(QwtScaleDraw::Alignment, QWidget* /TransferThis/ = 0); virtual ~QwtScaleWidget(); signals: void scaleDivChanged(); public: void setTitle(const QString&); void setTitle(const QwtText&); QwtText title() const; void setBorderDist(int, int); int startBorderDist() const; int endBorderDist() const; void getBorderDistHint(int&, int&) const; void getMinBorderDist(int& /Out/, int& /Out/) const; void setMinBorderDist(int, int); void setMargin(int); int margin() const; void setSpacing(int); int spacing() const; void setPenWidth(int); int penWidth() const; void setScaleDiv(QwtScaleTransformation*, const QwtScaleDiv&); void setScaleDraw(QwtScaleDraw*); // signature: const QwtScaleDraw* scaleDraw() const; QwtScaleDraw* scaleDraw(); void setLabelAlignment(Qt::Alignment); void setLabelRotation(double); void setColorBarEnabled(bool); bool isColorBarEnabled() const; void setColorBarWidth(int); int colorBarWidth() const; void setColorMap(const QwtDoubleInterval&, const QwtColorMap&); QwtDoubleInterval colorBarInterval() const; const QwtColorMap& colorMap() const; virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; int titleHeightForWidth(int) const; int dimForLength(int, const QFont&) const; void drawColorBar(QPainter*, const QRect&) const; void drawTitle(QPainter*, QwtScaleDraw::Alignment, const QRect&) const; void setAlignment(QwtScaleDraw::Alignment); QwtScaleDraw::Alignment alignment() const; QRect colorBarRect(const QRect&) const; protected: virtual void paintEvent(QPaintEvent*); virtual void resizeEvent(QResizeEvent*); void draw(QPainter*) const; void scaleChange(); void layoutScale(bool = true); }; // class QwtScaleWidget // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_item.sip0000444000175000017500000001752611130210270021367 0ustar poxpox// The SIP interface specification for: // QwtPlotItem. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtPlotItem { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum RttiValues { Rtti_PlotItem, Rtti_PlotGrid, Rtti_PlotMarker, Rtti_PlotCurve, Rtti_PlotHistogram, Rtti_PlotSpectrogram, Rtti_PlotSVG, Rtti_PlotUserItem }; // enum RttiValues enum ItemAttribute { Legend, AutoScale }; // enum ItemAttribute enum RenderHint { RenderAntialiased }; // enum RenderHint QwtPlotItem(const QwtText& = QwtText(QString::null, QwtText::AutoText)); virtual ~QwtPlotItem(); void attach(QwtPlot* /TransferThis/); void detach(); %MethodCode sipCpp->QwtPlotItem::detach(); sipTransferBack(sipSelf); %End QwtPlot* plot() const; void setTitle(const QString&); void setTitle(const QwtText&); const QwtText& title() const; virtual int rtti() const; void setItemAttribute(QwtPlotItem::ItemAttribute, bool = true); bool testItemAttribute(QwtPlotItem::ItemAttribute) const; void setRenderHint(QwtPlotItem::RenderHint, bool = true); bool testRenderHint(QwtPlotItem::RenderHint) const; double z() const; void setZ(double); void show(); void hide(); virtual void setVisible(bool); bool isVisible() const; void setAxis(int, int); void setXAxis(int); int xAxis() const; void setYAxis(int); int yAxis() const; virtual void itemChanged(); virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const = 0; virtual QwtDoubleRect boundingRect() const; virtual void updateLegend(QwtLegend*) const; virtual void updateScaleDiv(const QwtScaleDiv&, const QwtScaleDiv&); virtual QWidget* legendItem() const; QwtDoubleRect scaleRect(const QwtScaleMap&, const QwtScaleMap&) const; QRect paintRect(const QwtScaleMap&, const QwtScaleMap&) const; QRect transform(const QwtScaleMap&, const QwtScaleMap&, const QwtDoubleRect&) const; QwtDoubleRect invTransform(const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; private: QwtPlotItem(const QwtPlotItem&); %If (HAS_QWT5) %ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS switch (sipCpp->rtti()) { case QwtPlotItem::Rtti_PlotItem: sipClass = sipClass_QwtPlotItem; break; case QwtPlotItem::Rtti_PlotGrid: sipClass = sipClass_QwtPlotGrid; break; #ifdef sipClass_QwtPlotScaleItem case QwtPlotItem::Rtti_PlotScale: sipClass = sipClass_QwtPlotScaleItem; break; #endif // sipClass_QwtPlotScaleItem case QwtPlotItem::Rtti_PlotMarker: sipClass = sipClass_QwtPlotMarker; break; case QwtPlotItem::Rtti_PlotCurve: sipClass = sipClass_QwtPlotCurve; break; #ifdef sipClass_QwtPlotHistogram case QwtPlotItem::Rtti_PlotHistogram: sipClass = sipClass_QwtPlotHistogram; break; #endif // sipClass_QwtPlotHistogram case QwtPlotItem::Rtti_PlotSpectrogram: sipClass = sipClass_QwtPlotSpectrogram; break; #ifdef sipClass_QwtPlotSvgItem case QwtPlotItem::Rtti_PlotSVG: sipClass = sipClass_QwtPlotSvgItem; break; #endif // sipClass_QwtPlotSvgItem default: sipClass = 0; } Py_END_ALLOW_THREADS %End // %ConvertToSubClassCode %End // HAS_QWT5 }; // class QwtPlotItem %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtPlotItem: QwtLegendItemManager { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum RttiValues { Rtti_PlotItem, Rtti_PlotGrid, Rtti_PlotScale, Rtti_PlotMarker, Rtti_PlotCurve, Rtti_PlotHistogram, Rtti_PlotSpectrogram, Rtti_PlotSVG, Rtti_PlotUserItem }; // enum RttiValues enum ItemAttribute { Legend, AutoScale }; // enum ItemAttribute enum RenderHint { RenderAntialiased }; // enum RenderHint QwtPlotItem(const QwtText& = QwtText(QString::null, QwtText::AutoText)); virtual ~QwtPlotItem(); void attach(QwtPlot* /TransferThis/); void detach(); %MethodCode sipCpp->QwtPlotItem::detach(); sipTransferBack(sipSelf); %End QwtPlot* plot() const; void setTitle(const QString&); void setTitle(const QwtText&); const QwtText& title() const; virtual int rtti() const; void setItemAttribute(QwtPlotItem::ItemAttribute, bool = true); bool testItemAttribute(QwtPlotItem::ItemAttribute) const; void setRenderHint(QwtPlotItem::RenderHint, bool = true); bool testRenderHint(QwtPlotItem::RenderHint) const; double z() const; void setZ(double); void show(); void hide(); virtual void setVisible(bool); bool isVisible() const; void setAxis(int, int); void setXAxis(int); int xAxis() const; void setYAxis(int); int yAxis() const; virtual void itemChanged(); virtual void draw(QPainter*, const QwtScaleMap&, const QwtScaleMap&, const QRect&) const = 0; virtual QwtDoubleRect boundingRect() const; virtual void updateLegend(QwtLegend*) const; virtual void updateScaleDiv(const QwtScaleDiv&, const QwtScaleDiv&); virtual QWidget* legendItem() const; QwtDoubleRect scaleRect(const QwtScaleMap&, const QwtScaleMap&) const; QRect paintRect(const QwtScaleMap&, const QwtScaleMap&) const; QRect transform(const QwtScaleMap&, const QwtScaleMap&, const QwtDoubleRect&) const; QwtDoubleRect invTransform(const QwtScaleMap&, const QwtScaleMap&, const QRect&) const; private: QwtPlotItem(const QwtPlotItem&); %If (HAS_QWT5) %ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS switch (sipCpp->rtti()) { case QwtPlotItem::Rtti_PlotItem: sipClass = sipClass_QwtPlotItem; break; case QwtPlotItem::Rtti_PlotGrid: sipClass = sipClass_QwtPlotGrid; break; #ifdef sipClass_QwtPlotScaleItem case QwtPlotItem::Rtti_PlotScale: sipClass = sipClass_QwtPlotScaleItem; break; #endif // sipClass_QwtPlotScaleItem case QwtPlotItem::Rtti_PlotMarker: sipClass = sipClass_QwtPlotMarker; break; case QwtPlotItem::Rtti_PlotCurve: sipClass = sipClass_QwtPlotCurve; break; #ifdef sipClass_QwtPlotHistogram case QwtPlotItem::Rtti_PlotHistogram: sipClass = sipClass_QwtPlotHistogram; break; #endif // sipClass_QwtPlotHistogram case QwtPlotItem::Rtti_PlotSpectrogram: sipClass = sipClass_QwtPlotSpectrogram; break; #ifdef sipClass_QwtPlotSvgItem case QwtPlotItem::Rtti_PlotSVG: sipClass = sipClass_QwtPlotSvgItem; break; #endif // sipClass_QwtPlotSvgItem default: sipClass = 0; } Py_END_ALLOW_THREADS %End // %ConvertToSubClassCode %End // HAS_QWT5 }; // class QwtPlotItem %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_data.sip0000444000175000017500000000761211130210270020277 0ustar poxpox// The SIP interface specification for: // QwtArrayData, // QwtData, // QwtPolygonFData. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtArrayData: QwtData { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtArrayData(const QwtArrayDouble&, const QwtArrayDouble&); QwtArrayData(SIP_PYOBJECT, SIP_PYOBJECT) [(const double*, const double*, size_t)]; %MethodCode QwtArray xArray; if (-1 == try_PyObject_to_QwtArray(a0, xArray)) return 0; QwtArray yArray; if (-1 == try_PyObject_to_QwtArray(a1, yArray)) return 0; sipCpp = new sipQwtArrayData(xArray, yArray); %End // Not Pythonic: QwtArrayData& operator=(const QwtArrayData&); virtual QwtData* copy() const /Factory/; virtual size_t size() const; virtual double x(size_t) const; virtual double y(size_t) const; const QwtArrayDouble& xData() const; const QwtArrayDouble& yData() const; virtual QwtDoubleRect boundingRect() const; }; // class QwtArrayData class QwtData { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtData(); virtual ~QwtData(); virtual QwtData* copy() const = 0 /Factory/; virtual size_t size() const = 0; virtual double x(size_t) const = 0; virtual double y(size_t) const = 0; virtual QwtDoubleRect boundingRect() const; protected: // Not Pythonic: QwtData& operator=(const QwtData&); private: QwtData(const QwtData&); %If (CXX_DYNAMIC_CAST) %ConvertToSubClassCode // Walk the inheritance tree depth first in alphabetical order // This code is for Qwt4 and Qwt5 #ifdef sipClass_QwtArrayData if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtArrayData; else #endif #ifdef sipClass_QwtDoublePointData if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtDoublePointData; else #endif #ifdef sipClass_QwtPolygonFData if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtPolygonFData; else #endif #ifdef sipClass_QwtData if (dynamic_cast(sipCpp)) sipClass = sipClass_QwtData; else #endif sipClass = 0; %End %End }; // class QwtData class QwtPolygonFData: QwtData { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPolygonFData(const QPolygonF&); // Not Pythonic: QwtPolygonFData& operator=(const QwtPolygonFData&); virtual QwtData* copy() const; virtual size_t size() const; virtual double x(size_t) const; virtual double y(size_t) const; const QPolygonF& data() const; }; // class QwtPolygonFData // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_layout.sip0000444000175000017500000000656511130210270021747 0ustar poxpox// The SIP interface specification for: // QwtPlotLayout. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotLayout { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Options { AlignScales, IgnoreScrollbars, IgnoreFrames, IgnoreMargin, IgnoreLegend }; // enum Options QwtPlotLayout(); virtual ~QwtPlotLayout(); void setMargin(int); int margin() const; void setCanvasMargin(int, int = -1); int canvasMargin(int) const; void setAlignCanvasToScales(bool); bool alignCanvasToScales() const; void setSpacing(int); int spacing() const; void setLegendPosition(QwtPlot::LegendPosition, double); void setLegendPosition(QwtPlot::LegendPosition); QwtPlot::LegendPosition legendPosition() const; void setLegendRatio(double); double legendRatio() const; virtual QSize minimumSizeHint(const QwtPlot*) const; virtual void activate(const QwtPlot*, const QRect&, int = 0); virtual void invalidate(); const QRect& titleRect() const; const QRect& legendRect() const; const QRect& scaleRect(int) const; const QRect& canvasRect() const; protected: QRect layoutLegend(int, const QRect&) const; QRect alignLegend(const QRect&, const QRect&) const; SIP_PYTUPLE expandLineBreaks(int, const QRect&) const [ void (int, const QRect&, int&, int*)]; %MethodCode int title, axes[QwtPlot::axisCnt]; sipCpp->sipProtect_expandLineBreaks(a0, *a1, title, axes); sipRes = Py_BuildValue("i(iiii)", title, axes[0], axes[1], axes[2], axes[3]); %End SIP_PYTUPLE alignScales(int, QRect&) const [ void (int, QRect&, QRect*)]; %MethodCode QRect scales[QwtPlot::axisCnt]; sipCpp->sipProtect_alignScales(a0, *a1, scales); sipRes = sipBuildResult(0, "(BBBB)", new QRect(scales[0]), sipClass_QRect, 0, new QRect(scales[1]), sipClass_QRect, 0, new QRect(scales[2]), sipClass_QRect, 0, new QRect(scales[3]), sipClass_QRect, 0); %End }; // class QwtPlotLayout // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_scale_engine.sip0000444000175000017500000001464411172321327022021 0ustar poxpox// The SIP interface specification for: // QwtLinearScaleEngine, // QwtLog10ScaleEngine, // QwtScaleArithmetic, // QwtScaleEngine. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_2_0) class QwtLinearScaleEngine: QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual void autoScale(int, double&, double&, double&) const; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const; virtual QwtScaleTransformation* transformation() const; protected: QwtDoubleInterval align(const QwtDoubleInterval&, double) const; }; // class QwtLinearScaleEngine class QwtLog10ScaleEngine: QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual void autoScale(int, double&, double&, double&) const; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const; virtual QwtScaleTransformation* transformation() const; protected: QwtDoubleInterval log10(const QwtDoubleInterval&) const; QwtDoubleInterval pow10(const QwtDoubleInterval&) const; }; // class QwtLog10ScaleEngine class QwtScaleArithmetic { %TypeHeaderCode #include %End // %TypeHeaderCode public: static int compareEps(double, double, double); static double ceilEps(double, double); static double floorEps(double, double); static double divideEps(double, double); static double ceil125(double); static double floor125(double); }; // class QwtScaleArithmetic class QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Attribute { NoAttribute, IncludeReference, Symmetric, Floating, Inverted }; // enum Attribute QwtScaleEngine(); virtual ~QwtScaleEngine(); void setAttribute(QwtScaleEngine::Attribute, bool = true); bool testAttribute(QwtScaleEngine::Attribute) const; void setAttributes(int); int attributes() const; void setReference(double); double reference() const; void setMargins(double, double); double loMargin() const; double hiMargin() const; virtual void autoScale(int, double&, double&, double&) const = 0; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const = 0; virtual QwtScaleTransformation* transformation() const = 0; protected: bool contains(const QwtDoubleInterval&, double) const; QwtValueList strip(const QwtValueList&, const QwtDoubleInterval&) const; double divideInterval(double, int) const; QwtDoubleInterval buildInterval(double) const; }; // class QwtScaleEngine %End // (Qwt_5_0_0 - Qwt_5_2_0) %If (Qwt_5_2_0 - ) class QwtLinearScaleEngine: QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual void autoScale(int, double&, double&, double&) const; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const; virtual QwtScaleTransformation* transformation() const; protected: QwtDoubleInterval align(const QwtDoubleInterval&, double) const; }; // class QwtLinearScaleEngine class QwtLog10ScaleEngine: QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual void autoScale(int, double&, double&, double&) const; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const; virtual QwtScaleTransformation* transformation() const; protected: QwtDoubleInterval log10(const QwtDoubleInterval&) const; QwtDoubleInterval pow10(const QwtDoubleInterval&) const; }; // class QwtLog10ScaleEngine class QwtScaleArithmetic { %TypeHeaderCode #include %End // %TypeHeaderCode public: static int compareEps(double, double, double); static double ceilEps(double, double); static double floorEps(double, double); static double divideEps(double, double); static double ceil125(double); static double floor125(double); }; // class QwtScaleArithmetic class QwtScaleEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Attribute { NoAttribute, IncludeReference, Symmetric, Floating, Inverted }; // enum Attribute QwtScaleEngine(); virtual ~QwtScaleEngine(); void setAttribute(QwtScaleEngine::Attribute, bool = true); bool testAttribute(QwtScaleEngine::Attribute) const; void setAttributes(int); int attributes() const; void setReference(double); double reference() const; void setMargins(double, double); double lowerMargin() const; double upperMargin() const; virtual void autoScale(int, double&, double&, double&) const = 0; virtual QwtScaleDiv divideScale(double, double, int, int, double = 0.0) const = 0; virtual QwtScaleTransformation* transformation() const = 0; protected: bool contains(const QwtDoubleInterval&, double) const; QwtValueList strip(const QwtValueList&, const QwtDoubleInterval&) const; double divideInterval(double, int) const; QwtDoubleInterval buildInterval(double) const; }; // class QwtScaleEngine %End // (Qwt_5_2_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_scale_draw.sip0000444000175000017500000001102411130210270021462 0ustar poxpox// The SIP interface specification for: // QwtScaleDraw. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %If (Qwt_5_0_0 - Qwt_5_1_0) class QwtScaleDraw: QwtAbstractScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Alignment { BottomScale, TopScale, LeftScale, RightScale }; // enum Alignment QwtScaleDraw(); QwtScaleDraw(const QwtScaleDraw&); virtual ~QwtScaleDraw(); // Not Pythonic: QwtScaleDraw& operator=(const QwtScaleDraw&); void getBorderDistHint(const QFont&, int& /Out/, int& /Out/) const; int minLabelDist(const QFont&) const; int minLength(const QPen&, const QFont&) const; virtual int extent(const QPen&, const QFont&) const; void move(int, int); void move(const QPoint&); void setLength(int); QwtScaleDraw::Alignment alignment() const; void setAlignment(QwtScaleDraw::Alignment); Qt::Orientation orientation() const; QPoint pos() const; int length() const; void setLabelAlignment(Qt::Alignment); Qt::Alignment labelAlignment() const; void setLabelRotation(double); double labelRotation() const; int maxLabelHeight(const QFont&) const; int maxLabelWidth(const QFont&) const; QPoint labelPosition(double) const; QRect labelRect(const QFont&, double) const; QSize labelSize(const QFont&, double) const; protected: QMatrix labelMatrix(const QPoint&, const QSize&) const; virtual void drawTick(QPainter*, double, int) const; virtual void drawBackbone(QPainter*) const; virtual void drawLabel(QPainter*, double) const; }; // class QwtScaleDraw %End // (Qwt_5_0_0 - Qwt_5_1_0) %If (Qwt_5_1_0 - ) class QwtScaleDraw: QwtAbstractScaleDraw { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Alignment { BottomScale, TopScale, LeftScale, RightScale }; // enum Alignment QwtScaleDraw(); QwtScaleDraw(const QwtScaleDraw&); virtual ~QwtScaleDraw(); // Not Pythonic: QwtScaleDraw& operator=(const QwtScaleDraw&); void getBorderDistHint(const QFont&, int& /Out/, int& /Out/) const; int minLabelDist(const QFont&) const; int minLength(const QPen&, const QFont&) const; virtual int extent(const QPen&, const QFont&) const; void move(int, int); void move(const QPoint&); void setLength(int); QwtScaleDraw::Alignment alignment() const; void setAlignment(QwtScaleDraw::Alignment); Qt::Orientation orientation() const; QPoint pos() const; int length() const; void setLabelAlignment(Qt::Alignment); Qt::Alignment labelAlignment() const; void setLabelRotation(double); double labelRotation() const; int maxLabelHeight(const QFont&) const; int maxLabelWidth(const QFont&) const; QPoint labelPosition(double) const; QRect labelRect(const QFont&, double) const; QSize labelSize(const QFont&, double) const; QRect boundingLabelRect(const QFont&, double) const; protected: QMatrix labelMatrix(const QPoint&, const QSize&) const; virtual void drawTick(QPainter*, double, int) const; virtual void drawBackbone(QPainter*) const; virtual void drawLabel(QPainter*, double) const; }; // class QwtScaleDraw %End // (Qwt_5_1_0 - ) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_counter.sip0000444000175000017500000000534711130210270021050 0ustar poxpox// The SIP interface specification for: // QwtCounter. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtCounter: QWidget, QwtDoubleRange { %TypeHeaderCode #include %End // %TypeHeaderCode public: enum Button { Button1, Button2, Button3, ButtonCnt }; // enum Button QwtCounter(QWidget* /TransferThis/ = 0); virtual ~QwtCounter(); bool editable() const; void setEditable(bool); void setNumButtons(int); int numButtons() const; void setIncSteps(QwtCounter::Button, int); int incSteps(QwtCounter::Button) const; virtual void setValue(double); virtual QSize sizeHint() const; virtual void polish(); double step() const; void setStep(double); double minVal() const; void setMinValue(double); double maxVal() const; void setMaxValue(double); void setStepButton1(int); int stepButton1() const; void setStepButton2(int); int stepButton2() const; void setStepButton3(int); int stepButton3() const; virtual double value() const; signals: void buttonReleased(double); void valueChanged(double); protected: virtual bool event(QEvent*); virtual void wheelEvent(QWheelEvent*); virtual void keyPressEvent(QKeyEvent*); virtual void rangeChange(); private slots: void btnReleased(); void btnClicked(); void textChanged(); private: virtual void valueChange(); }; // class QwtCounter // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/QwtList.sip0000444000175000017500000000465511264104436020124 0ustar poxpox// The SIP interface definition for: // QwtValueList. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. %MappedType QwtValueList { %TypeHeaderCode #include %End %ConvertFromTypeCode // Create the list. PyObject *l = PyList_New(sipCpp->size()); if (0 == l) return 0; for (int i = 0; i < int(sipCpp->size()); ++i) { PyObject *o = PyFloat_FromDouble(sipCpp->value(i)); if (!o) { Py_DECREF(l); return 0; } PyList_SET_ITEM(l, i, o); } return l; %End // %ConvertFromTypeCode %ConvertToTypeCode if (0 == sipIsErr) return (PySequence_Check(sipPy) && PySequence_Size(sipPy) >=0); QwtValueList *l = new QwtValueList; SIP_SSIZE_T size = PySequence_Size(sipPy); for (int i = 0; i < size; ++i) { PyObject *item = PySequence_ITEM(sipPy, i); if (!item) { delete l; *sipIsErr = 1; return 0; } l->append(PyFloat_AsDouble(item)); Py_DECREF(item); } *sipCppPtr = l; return sipGetState(sipTransferObj); %End // %ConvertToTypeCode }; // QwtValueList // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_plot_panner.sip0000444000175000017500000000360711130210270021707 0ustar poxpox// The SIP interface specification for: // QwtPlotPanner. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlotPanner: QwtPanner { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlotPanner(QwtPlotCanvas* /TransferThis/); virtual ~QwtPlotPanner(); QwtPlotCanvas* canvas(); // signature: const QwtPlotCanvas* canvas() const; QwtPlot* plot(); // signature: const QwtPlot* plot() const; void setAxisEnabled(int, bool); bool isAxisEnabled(int) const; protected slots: virtual void moveCanvas(int, int); }; // class QwtPlotPanner // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_text_engine.sip0000444000175000017500000000615011130210270021673 0ustar poxpox// The SIP interface specification for: // QwtPlainTextEngine, // QwtRichTextEngine, // QwtTextEngine. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtPlainTextEngine: QwtTextEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtPlainTextEngine(); virtual ~QwtPlainTextEngine(); virtual int heightForWidth(const QFont&, int, const QString&, int) const; virtual QSize textSize(const QFont&, int, const QString&) const; virtual void draw(QPainter*, const QRect&, int, const QString&) const; virtual bool mightRender(const QString&) const; virtual void textMargins(const QFont&, const QString&, int&, int&, int&, int&) const; }; // class QwtPlainTextEngine class QwtRichTextEngine: QwtTextEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: QwtRichTextEngine(); virtual int heightForWidth(const QFont&, int, const QString&, int) const; virtual QSize textSize(const QFont&, int, const QString&) const; virtual void draw(QPainter*, const QRect&, int, const QString&) const; virtual bool mightRender(const QString&) const; virtual void textMargins(const QFont&, const QString&, int&, int&, int&, int&) const; }; // class QwtRichTextEngine class QwtTextEngine { %TypeHeaderCode #include %End // %TypeHeaderCode public: virtual ~QwtTextEngine(); virtual int heightForWidth(const QFont&, int, const QString&, int) const = 0; virtual QSize textSize(const QFont&, int, const QString&) const = 0; virtual bool mightRender(const QString&) const = 0; virtual void textMargins(const QFont&, const QString&, int&, int&, int&, int&) const = 0; virtual void draw(QPainter*, const QRect&, int, const QString&) const = 0; protected: QwtTextEngine(); }; // class QwtTextEngine // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/sip/qwt5qt4/qwt_clipper.sip0000444000175000017500000000340211130210270021015 0ustar poxpox// The SIP interface specification for: // QwtClipper. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. class QwtClipper { %TypeHeaderCode #include %End // %TypeHeaderCode public: static QwtPolygon clipPolygon(const QRect&, const QwtPolygon&); static QwtPolygonF clipPolygonF(const QwtDoubleRect&, const QwtPolygonF&); static QVector clipCircle(const QwtDoubleRect&, const QwtDoublePoint&, double); }; // class QwtClipper // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/ANNOUNCEMENT-5.1.00000444000175000017500000000276211020507165016121 0ustar poxpoxWhat is PyQwt ( http://pyqwt.sourceforge.net ) ? - it is a set of Python bindings for the Qwt C++ class library which extends the Qt framework with widgets for scientific and engineering applications. It provides a 2-dimensional plotting widget and various widgets to display and control bounded or unbounded floating point values. - it requires and extends PyQt, a set of Python bindings for Qt. - it supports the use of PyQt, Qt, Qwt, and optionally NumPy or SciPy in a GUI Python application or in an interactive Python session. - it runs on POSIX, Mac OS X and Windows platforms (practically any platform supported by Qt and Python). - it plots fast: fairly good hardware allows a rate of 100,000 points/second. (PyQwt with Qt-3 is faster than with Qt-4). - it is licensed under the GPL with an exception to allow dynamic linking with non-free releases of Qt and PyQt. The most important new features of PyQwt-5.1.0 are: - support for Qwt-5.1.0. - support for PyQt-4.4.2 and SIP-4.7.6. - support for Qt-4.4. - the CartesianDemo.py, MaskedDataDemo.py, PickerDemo.py examples. The most important bug fixes in PyQwt-5.1.0 are: - fixed QwtPicker::stateMachine() to allow for subclassing of QwtPicker in Python. PyQwt-5.1.0 supports: 1. Python-2.5, or -2.4. 2. PyQt-3.17. 3. PyQt-4.4, PyQt-4.3, or PyQt-4.2. 3 SIP-4.7, or SIP-4.6. 4. Qt-3.3, or Qt-3.2. 5. Qt-4.4, Qt-4.3, or Qt-4.2. 6. Qwt-5.1, or Qwt-5.0. 7. Recent versions of NumPy, numarray, and/or Numeric. Enjoy -- Gerard Vermeulen pyqwt5-5.2.1~cvs20091107+dfsg/support/0000755000175000017500000000000011275562661015372 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/support/qwt_numeric.cpp0000444000175000017500000001543111130210271020406 0ustar poxpox// The code for the interface PyQwt <-> Numeric. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. #ifdef HAS_NUMERIC #include #include #include // steal those handy macro's from numpy #define PyArray_NDIM(obj) (((PyArrayObject *)(obj))->nd) #define PyArray_DATA(obj) ((void *)(((PyArrayObject *)(obj))->data)) #define PyArray_BYTES(obj) (((PyArrayObject *)(obj))->data) #define PyArray_DIMS(obj) (((PyArrayObject *)(obj))->dimensions) #define PyArray_STRIDES(obj) (((PyArrayObject *)(obj))->strides) #define PyArray_DIM(obj,n) (PyArray_DIMS(obj)[n]) #define PyArray_STRIDE(obj,n) (PyArray_STRIDES(obj)[n]) #define PyArray_TYPE(obj) (((PyArrayObject *)(obj))->descr->type_num) void qwt_import_numeric() { import_array(); } int try_NumericArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumericArray_to_QwtArray()\n"); #endif if (!PyArray_Check(in)) return 0; PyObject *array = PyArray_ContiguousFromObject(in, PyArray_DOUBLE, 1, 0); if (!array) { PyErr_SetString(PyExc_RuntimeError, "Failed to make contiguous array of PyArray_DOUBLE"); return -1; } double *data = (double *) PyArray_DATA(array); out.resize(PyArray_DIM(array, 0)); for (double *it = out.begin(); it != out.end();) { *it++ = *data++; } Py_DECREF(array); return 1; } int try_NumericArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumericArray_to_QwtArray()\n"); #endif if (!PyArray_Check(in)) return 0; PyObject *array = PyArray_ContiguousFromObject(in, PyArray_INT, 1, 0); if (!array) { PyErr_SetString(PyExc_RuntimeError, "Failed to make contiguous array of PyArray_INT"); return -1; } int *data = (int *) PyArray_DATA(array); out.resize(PyArray_DIM(array, 0)); for (int *it = out.begin(); it != out.end();) { *it++ = *data++; } Py_DECREF(array); return 1; } int try_NumericArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumericArray_to_QwtArray()\n"); #endif if (!PyArray_Check(in)) return 0; PyObject *array = PyArray_ContiguousFromObject(in, PyArray_LONG, 1, 0); if (!array) { PyErr_SetString(PyExc_RuntimeError, "Failed to make contiguous array of PyArray_LONG"); return -1; } long *data = (long *) PyArray_DATA(array); out.resize(PyArray_DIM(array, 0)); for (long *it = out.begin(); it != out.end();) { *it++ = *data++; } Py_DECREF(array); return 1; } int try_NumericArray_to_QImage(PyObject *in, QImage **out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumericArray_to_QImage()\n"); #endif if (!PyArray_Check(in)) return 0; if (2 != PyArray_NDIM(in)) { PyErr_SetString(PyExc_RuntimeError, "Array must be 2-dimensional"); return -1; } const int ny = PyArray_DIM(in, 0); const int nx = PyArray_DIM(in, 1); const int stride = PyArray_STRIDE(in, 0); // 8 bit data if (PyArray_TYPE(in) == PyArray_UBYTE) { #if QT_VERSION < 0x040000 if (!(*out = new QImage(nx, ny, 8, 256))) { #else if (!(*out = new QImage(nx, ny, QImage::Format_Indexed8))) { #endif PyErr_SetString(PyExc_RuntimeError, "failed to create a QImage"); return -1; } char *data = PyArray_BYTES(in); for (int i=0; iscanLine(i), data, stride); data += stride; } // initialize the palette as all gray (*out)->setNumColors(256); for (int i = 0; i<(*out)->numColors(); i++) (*out)->setColor(i, qRgb(i, i, i)); return 1; } // 32 bit data. if (PyArray_TYPE(in) == PyArray_UINT) { #if QT_VERSION < 0x040000 if (!(*out = new QImage(nx, ny, 32))) { #else if (!(*out = new QImage(nx, ny, QImage::Format_ARGB32))) { #endif PyErr_SetString(PyExc_RuntimeError, "failed to create a QImage"); return -1; } char *data = PyArray_BYTES(in); for (int i=0; iscanLine(i), data, stride); data += stride; } return 1; } PyErr_SetString(PyExc_RuntimeError, "Data type must be uint8, or uint32"); return -1; } PyObject *toNumeric(const QImage &image) { PyObject *result = 0; const int ny = image.height(); const int nx = image.width(); int dimensions[2] = {ny, nx}; if (image.depth() == 8) { // 8 bit data if (0 == (result = PyArray_FromDims(2, dimensions, PyArray_UBYTE))) { PyErr_SetString(PyExc_MemoryError, "failed to allocate array"); return 0; } } else if (image.depth() == 32) { // 32 bit data if (0 == (result = PyArray_FromDims(2, dimensions, PyArray_UINT))) { PyErr_SetString(PyExc_MemoryError, "failed to allocate array"); return 0; } } else { PyErr_SetString(PyExc_RuntimeError, "Image depth must be 8 or 32"); return 0; } char *data = PyArray_BYTES(result); const int stride = PyArray_STRIDE(result, 0); for (int i=0; i NumPy. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. #ifdef HAS_NUMPY #include #include #include #include void qwt_import_numpy() { // this is a function which does error handling import_array(); } int try_NumPyArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumPyArray_to_QwtArray()\n"); #endif if (!PyArray_Check(in)) return 0; PyObject *array = PyArray_ContiguousFromObject(in, PyArray_DOUBLE, 1, 0); if (!array) { PyErr_SetString(PyExc_RuntimeError, "Failed to make contiguous array of PyArray_DOUBLE"); return -1; } double *data = (double *) PyArray_DATA(array); out.resize(PyArray_DIM(array, 0)); for (double *it = out.begin(); it != out.end();) { *it++ = *data++; } Py_DECREF(array); return 1; } int try_NumPyArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumPyArray_to_QwtArray()\n"); #endif if (!PyArray_Check(in)) return 0; PyObject *array = PyArray_ContiguousFromObject(in, PyArray_INT, 1, 0); if (!array) { PyErr_SetString(PyExc_RuntimeError, "Failed to make contiguous array of PyArray_INT"); return -1; } int *data = (int *) PyArray_DATA(data); out.resize(PyArray_DIM(array, 0)); for (int *it = out.begin(); it != out.end();) { *it++ = *data++; } Py_DECREF(array); return 1; } int try_NumPyArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumPyArray_to_QwtArray()\n"); #endif if (!PyArray_Check(in)) return 0; PyObject *array = PyArray_ContiguousFromObject(in, PyArray_LONG, 1, 0); if (!array) { PyErr_SetString(PyExc_RuntimeError, "Failed to make contiguous array of PyArray_LONG"); return -1; } long *data = (long *) PyArray_DATA(data); out.resize(PyArray_DIM(array, 0)); for (long *it = out.begin(); it != out.end();) { *it++ = *data++; } Py_DECREF(array); return 1; } int try_NumPyArray_to_QImage(PyObject *in, QImage **out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumPyArray_to_QImage()\n"); #endif if (!PyArray_Check(in)) return 0; if (2 != PyArray_NDIM(in)) { PyErr_SetString(PyExc_RuntimeError, "Array must be 2-dimensional"); return -1; } const npy_intp ny = PyArray_DIM(in, 0); const npy_intp nx = PyArray_DIM(in, 1); const npy_intp stride = PyArray_STRIDE(in, 0); // 8 bit data if (PyArray_TYPE(in) == NPY_UINT8) { #if QT_VERSION < 0x040000 if (!(*out = new QImage(nx, ny, 8, 256))) { #else if (!(*out = new QImage(nx, ny, QImage::Format_Indexed8))) { #endif PyErr_SetString(PyExc_RuntimeError, "Failed to create a QImage"); return -1; } char *data = PyArray_BYTES(in); for (int i=0; iscanLine(i), data, stride); data += stride; } // initialize the palette as all gray (*out)->setNumColors(256); for (int i = 0; i<(*out)->numColors(); i++) (*out)->setColor(i, qRgb(i, i, i)); return 1; } // 32 bit data if (PyArray_TYPE(in) == NPY_UINT32) { #if QT_VERSION < 0x040000 if (!(*out = new QImage(nx, ny, 32))) { #else if (!(*out = new QImage(nx, ny, QImage::Format_ARGB32))) { #endif PyErr_SetString(PyExc_RuntimeError, "Failed to create a QImage"); return -1; } char *data = PyArray_BYTES(in); for (int i=0; iscanLine(i), data, stride); data += stride; } return 1; } PyErr_SetString(PyExc_RuntimeError, "Data type must be uint8, or uint32"); return -1; } PyObject *toNumpy(const QImage &image) { PyObject *result = 0; const int ny = image.height(); const int nx = image.width(); npy_intp dimensions[2] = {ny, nx}; // 8 bit data if (image.depth() == 8) { // 8 bit data if (0 == (result = PyArray_SimpleNew(2, dimensions, NPY_UINT8))) { PyErr_SetString(PyExc_MemoryError, "Failed to allocate array"); return 0; } } else if (image.depth() == 32) { // 32 bit data if (0 == (result = PyArray_SimpleNew(2, dimensions, NPY_UINT32))) { PyErr_SetString(PyExc_MemoryError, "Failed to allocate array"); return 0; } } else { PyErr_SetString(PyExc_RuntimeError, "Image depth must be 8 or 32"); return 0; } char *data = PyArray_BYTES(result); const npy_intp stride = PyArray_STRIDE(result, 0); for (int i=0; i Numerical Python extensions. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. #ifndef QWT_NUMERICAL_INTERFACE_H #define QWT_NUMERICAL_INTERFACE_H #include #include #include #ifdef HAS_NUMARRAY // to hide numarray's import_array() void qwt_import_numarray(); PyObject *toNumarray(const QImage &image); #endif #ifdef HAS_NUMERIC // to hide Numeric's import_array() void qwt_import_numeric(); PyObject *toNumeric(const QImage &image); #endif #ifdef HAS_NUMPY // to hide NumPy's import_array() void qwt_import_numpy(); PyObject *toNumpy(const QImage &image); #endif // returns 1, 0, -1 in case of success, wrong object type, failure int try_PyObject_to_QwtArray(PyObject *object, QwtArray &array); // returns 1, 0, -1 in case of success, wrong object type, failure int try_PyObject_to_QwtArray(PyObject *object, QwtArray &array); // returns 1, 0, -1 in case of success, wrong object type, failure int try_PyObject_to_QwtArray(PyObject *object, QwtArray &array); // returns 1, 0, -1 in case of success, wrong object type, failure int try_PyObject_to_QImage(PyObject *object, QImage **image); #endif // QWT_NUMERICAL_INTERFACE_H // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/support/qwt_numeric.h0000444000175000017500000000420111130210271020044 0ustar poxpox// The header for the interface PyQwt <-> Numeric. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. #ifndef QWT_NUMERIC_H #define QWT_NUMERIC_H #ifdef HAS_NUMERIC #include #include #include #include // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumericArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumericArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumericArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumericArray_to_QImage(PyObject *in, QImage **out); #endif // HAS_NUMERIC #endif // QWT_NUMERIC // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/support/qwt_numarray.h0000444000175000017500000000417111130210271020246 0ustar poxpox// The header for the interface PyQwt <-> numarray. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. #ifndef QWT_NUMARRAY_H #define QWT_NUMARRAY_H #ifdef HAS_NUMARRAY #include #include #include // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumarrayArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumarrayArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumarrayArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumarrayArray_to_QImage(PyObject *in, QImage **out); #endif // HAS_NUMARRAY #endif // QWT_NUMARRAY_H // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/support/qwt_ndarray.h0000444000175000017500000000416211130210271020050 0ustar poxpox// The header for the interface PyQwt <-> N-D array interface // See: http://numpy.scipy.org/array_interface.shtml. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. #ifndef QWT_NDARRAY_H #define QWT_NDARRAY_H #include #include #include // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NDArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NDArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NDArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NDArray_to_QImage(PyObject *in, QImage **out); #endif // QWT_NDARRAY_H // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/support/qwt_ndarray.cpp0000444000175000017500000003267011130210271020410 0ustar poxpox// The code for the interface PyQwt <-> N-D array interface // See: http://numpy.scipy.org/array_interface.shtml. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. #include #include // The NumPy Array Interface typedef struct { int two; int nd; char typekind; int itemsize; int flags; Py_intptr_t *shape; Py_intptr_t *strides; void *data; PyObject *descr; } PyArrayInterface; enum { CONTIGUOUS = 0x1, FORTRAN = 0x2, ALIGNED = 0x100, NOTSWAPPED = 0x200, WRITABLE = 0x400, ARR_HAS_DESCR = 0x800, }; void trace(PyArrayInterface *source) { fprintf(stderr, "two: %i\n", source->two); fprintf(stderr, "nd: %i\n", source->nd); fprintf(stderr, "typekind: '%c'\n", source->typekind); fprintf(stderr, "itemsize: %i\n", source->itemsize); fprintf(stderr, "flags:"); if (source->flags & CONTIGUOUS) { fprintf(stderr, " CONTIGUOUS"); } if (source->flags & FORTRAN) { fprintf(stderr, " FORTRAN"); } if (source->flags & ALIGNED) { fprintf(stderr, " ALIGNED"); } if (source->flags & NOTSWAPPED) { fprintf(stderr, " NOTSWAPPED"); } if (source->flags & WRITABLE) { fprintf(stderr, " WRITABLE"); } if (source->flags & ARR_HAS_DESCR) { fprintf(stderr, " ARR_HAS_DESCR"); } fprintf(stderr, "\n"); fprintf(stderr, "shape: ("); if (source->nd==1) { fprintf(stderr, "%i,", int(source->shape[0])); } else if (source->nd>1) { fprintf(stderr, "%i", int(source->shape[0])); } for (int i=1; ind; ++i) { fprintf(stderr, ", %i", int(source->shape[0])); } fprintf(stderr, ")\n"); fprintf(stderr, "strides: ("); if (source->nd==1) { fprintf(stderr, "%i,", int(source->strides[0])); } else if (source->nd>1) { fprintf(stderr, "%i", int(source->strides[0])); } for (int i=1; ind; ++i) { fprintf(stderr, ", %i", int(source->strides[i])); } fprintf(stderr, ")\n"); } int try_NDArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NDArray_to_QwtArray() // QwtArray\n"); #endif if (!PyObject_HasAttrString(in, "__array_struct__")) { return 0; } PyObject *csource = PyObject_GetAttrString(in, "__array_struct__"); if (!csource) { // FIXME return 0; } PyArrayInterface *source = reinterpret_cast(PyCObject_AsVoidPtr(csource)); if (!source) { // FIXME return 0; } #ifdef TRACE_PYQWT trace(source); #endif int stride; if ((source->two != 2)|| (source->nd != 1)) { goto error; } stride = source->strides[0]/source->itemsize; out.resize(source->shape[0]); if (source->typekind == 'f') { if (source->itemsize == sizeof(double)) { double *data = reinterpret_cast(source->data); for (double *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(float)) { float *data = reinterpret_cast(source->data); for (double *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else { goto error; } } else if (source->typekind == 'i') { if (source->itemsize == sizeof(char)) { char *data = reinterpret_cast(source->data); for (double *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(short)) { short *data = reinterpret_cast(source->data); for (double *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(int)) { int *data = reinterpret_cast(source->data); for (double *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(long)) { long *data = reinterpret_cast(source->data); for (double *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(long long)) { long long *data = reinterpret_cast(source->data); for (double *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else { goto error; } } else { goto error; } Py_DECREF(csource); return 1; error: Py_DECREF(csource); PyErr_SetString( PyExc_RuntimeError, "The array is no 1D array containing real or signed integer types"); return -1; } int try_NDArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NDArray_to_QwtArray() // QwtArray\n"); #endif if (!PyObject_HasAttrString(in, "__array_struct__")) { return 0; } PyObject *csource = PyObject_GetAttrString(in, "__array_struct__"); if (!csource) { // FIXME return 0; } PyArrayInterface *source = reinterpret_cast(PyCObject_AsVoidPtr(csource)); if (!source) { // FIXME return 0; } #ifdef TRACE_PYQWT trace(source); #endif int stride; if ((source->two != 2) || (source->nd != 1)) { goto error; } out.resize(source->shape[0]); stride = source->strides[0]/source->itemsize; if (source->typekind == 'i') { if (source->itemsize == sizeof(char)) { char *data = reinterpret_cast(source->data); for (int *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(short)) { short *data = reinterpret_cast(source->data); for (int *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(int)) { int *data = reinterpret_cast(source->data); for (int *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(long)) { long *data = reinterpret_cast(source->data); for (int *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(long long)) { long long *data = reinterpret_cast(source->data); for (int *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else { goto error; } } else { goto error; } Py_DECREF(csource); return 1; error: Py_DECREF(csource); PyErr_SetString( PyExc_RuntimeError, "The array is no 1D array containing signed integer types"); return -1; } int try_NDArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumPyArray_to_QwtArray() // QwtArray\n"); #endif if (!PyObject_HasAttrString(in, "__array_struct__")) { return 0; } PyObject *csource = PyObject_GetAttrString(in, "__array_struct__"); if (!csource) { // FIXME return 0; } PyArrayInterface *source = reinterpret_cast(PyCObject_AsVoidPtr(csource)); if (!source) { // FIXME return 0; } #ifdef TRACE_PYQWT trace(source); #endif int stride; if ((source->two != 2) || (source->nd != 1)) { goto error; } out.resize(source->shape[0]); stride = source->strides[0]/source->itemsize; if (source->typekind == 'i') { if (source->itemsize == sizeof(char)) { char *data = reinterpret_cast(source->data); for (long *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(short)) { short *data = reinterpret_cast(source->data); for (long *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(int)) { int *data = reinterpret_cast(source->data); for (long *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(long)) { long *data = reinterpret_cast(source->data); for (long *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else if (source->itemsize == sizeof(long long)) { long long *data = reinterpret_cast(source->data); for (long *it = out.begin(); it != out.end();) { *it++ = *data; data += stride; } } else { goto error; } } else { goto error; } Py_DECREF(csource); return 1; error: Py_DECREF(csource); PyErr_SetString( PyExc_RuntimeError, "The array is no 1D array containing signed integer types"); return -1; } int try_NDArray_to_QImage(PyObject *in, QImage **out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NDArray_to_QImage()\n"); #endif if (!PyObject_HasAttrString(in, "__array_struct__")) { return 0; } PyObject *csource = PyObject_GetAttrString(in, "__array_struct__"); if (!csource) { // FIXME return 0; } PyArrayInterface *source = reinterpret_cast(PyCObject_AsVoidPtr(csource)); if (!source) { // FIXME return 0; } #ifdef TRACE_PYQWT trace(source); #endif if (!((source->two==2) && (source->nd==2) && (source->flags&CONTIGUOUS))) { Py_DECREF(csource); PyErr_SetString(PyExc_RuntimeError, "Array must be contiguous and 2-D"); return -1; } const Py_intptr_t ny = source->shape[0]; const Py_intptr_t nx = source->shape[1]; const Py_intptr_t stride = source->strides[0]; // 8 bit data if ((source->typekind =='u') && (source->itemsize==1)) { #if QT_VERSION < 0x040000 if (!(*out = new QImage(nx, ny, 8, 256))) { #else if (!(*out = new QImage(nx, ny, QImage::Format_Indexed8))) { #endif PyErr_SetString(PyExc_RuntimeError, "failed to create a 8 bit image"); return -1; } char *data = static_cast(source->data); for (int i=0; iscanLine(i), data, stride); data += stride; } // initialize the palette as all gray (*out)->setNumColors(256); for (int i = 0; i<(*out)->numColors(); i++) { (*out)->setColor(i, qRgb(i, i, i)); } Py_DECREF(csource); return 1; } // 32 bit data if ((source->typekind=='u') && (source->itemsize==4)) { #if QT_VERSION < 0x040000 if (!(*out = new QImage(nx, ny, 32))) { #else if (!(*out = new QImage(nx, ny, QImage::Format_ARGB32))) { #endif PyErr_SetString(PyExc_RuntimeError, "failed to create a 32 bit image"); return -1; } char *data = static_cast(source->data); for (int i=0; iscanLine(i), data, stride); data += stride; } Py_DECREF(csource); return 1; } PyErr_SetString(PyExc_RuntimeError, "Data type must be uint8 or uint32"); Py_DECREF(csource); return -1; } // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/support/qwt_numerical_interface.cpp0000444000175000017500000002172611264102626022763 0ustar poxpox// The code for the interface PyQwt <-> Numerical Python extensions. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. #include #include #include #include #include static int try_PySequence_to_QwtArray(PyObject *in, QwtArray &out) { if (!PyList_Check(in) && !PyTuple_Check(in)) return 0; // MSVC-6.0 chokes on passing an uint in QwtArray::operator[](int) int size = PySequence_Size(in); out.resize(size); for (int i=0; i &out) { int result; #ifdef HAS_NUMPY if ((result = try_NumPyArray_to_QwtArray(in, out))) return result; #endif #ifdef HAS_NUMERIC if ((result = try_NumericArray_to_QwtArray(in, out))) return result; #endif #ifdef HAS_NUMARRAY if ((result = try_NumarrayArray_to_QwtArray(in, out))) return result; #endif if ((result = try_NDArray_to_QwtArray(in, out))) return result; if ((result = try_PySequence_to_QwtArray(in, out))) return result; PyErr_SetString(PyExc_TypeError, "expected is\n" "(*) a list or tuple of Python numbers.\n" "(*) an array with the N-D array interface.\n" #ifdef HAS_NUMPY "(*) a NumPy array coercible to PyArray_DOUBLE.\n" #else "(!) rebuild PyQwt to support NumPy arrays.\n" #endif #ifdef HAS_NUMERIC "(*) a Numeric array coercible to PyArray_DOUBLE.\n" #else "(!) rebuild PyQwt to support Numeric arrays.\n" #endif #ifdef HAS_NUMARRAY "(*) a numarray array coercible to PyArray_DOUBLE.\n" #else "(!) rebuild PyQwt to support numarray arrays.\n" #endif ); return -1; } static int try_PySequence_to_QwtArray(PyObject *in, QwtArray &out) { if (!PyList_Check(in) && !PyTuple_Check(in)) return 0; // MSVC-6.0 chokes on passing an uint in QwtArray::operator[](int) int size = PySequence_Size(in); out.resize(size); for (int i=0; i &out) { int result; #ifdef HAS_NUMPY if ((result = try_NumPyArray_to_QwtArray(in, out))) return result; #endif #ifdef HAS_NUMERIC if ((result = try_NumericArray_to_QwtArray(in, out))) return result; #endif #ifdef HAS_NUMARRAY if ((result = try_NumarrayArray_to_QwtArray(in, out))) return result; #endif if ((result = try_NDArray_to_QwtArray(in, out))) return result; if ((result = try_PySequence_to_QwtArray(in, out))) return result; PyErr_SetString(PyExc_TypeError, "expected is\n" "(*) a list or tuple of Python numbers.\n" "(*) an array with the N-D array interface.\n" #ifdef HAS_NUMPY "(*) a NumPy array coercible to PyArray_INT.\n" #else "(!) rebuild PyQwt to support NumPy arrays.\n" #endif #ifdef HAS_NUMERIC "(*) a Numeric array coercible to PyArray_INT.\n" #else "(!) rebuild PyQwt to support Numeric arrays.\n" #endif #ifdef HAS_NUMARRAY "(*) a numarray array coercible to PyArray_INT.\n" #else "(!) rebuild PyQwt to support numarray arrays.\n" #endif ); return -1; } static int try_PySequence_to_QwtArray(PyObject *in, QwtArray &out) { if (!PyList_Check(in) && !PyTuple_Check(in)) return 0; // MSVC-6.0 chokes on passing an uint in QwtArray::operator[](int) int size = PySequence_Size(in); out.resize(size); for (int i=0; i &out) { int result; #ifdef HAS_NUMPY if ((result = try_NumPyArray_to_QwtArray(in, out))) return result; #endif #ifdef HAS_NUMERIC if ((result = try_NumericArray_to_QwtArray(in, out))) return result; #endif #ifdef HAS_NUMARRAY if ((result = try_NumarrayArray_to_QwtArray(in, out))) return result; #endif if ((result = try_NDArray_to_QwtArray(in, out))) return result; if ((result = try_PySequence_to_QwtArray(in, out))) return result; PyErr_SetString(PyExc_TypeError, "expected is\n" "(*) a list or tuple of Python numbers.\n" "(*) an array with the N-D array interface.\n" #ifdef HAS_NUMPY "(*) a NumPy array coercible to PyArray_INT.\n" #else "(!) rebuild PyQwt to support NumPy arrays.\n" #endif #ifdef HAS_NUMERIC "(*) a Numeric array coercible to PyArray_INT.\n" #else "(!) rebuild PyQwt to support Numeric arrays.\n" #endif #ifdef HAS_NUMARRAY "(*) a numarray array coercible to PyArray_INT.\n" #else "(!) rebuild PyQwt to support numarray arrays.\n" #endif ); return -1; } int try_PyObject_to_QImage(PyObject *in, QImage **out) { int result; #ifdef HAS_NUMPY if ((result = try_NumPyArray_to_QImage(in, out))) return result; #endif #ifdef HAS_NUMERIC if ((result = try_NumericArray_to_QImage(in, out))) return result; #endif #ifdef HAS_NUMARRAY if ((result = try_NumarrayArray_to_QImage(in, out))) return result; #endif if ((result = try_NDArray_to_QImage(in, out))) return result; PyErr_SetString(PyExc_TypeError, "expected is\n" "(*) an array with the N-D array interface.\n" #ifdef HAS_NUMPY "(*) a NumPy array.\n" #else "(!) rebuild PyQwt to support NumPy arrays.\n" #endif #ifdef HAS_NUMERIC "(*) a Numeric array.\n" #else "(!) rebuild PyQwt to support Numeric arrays.\n" #endif #ifdef HAS_NUMARRAY "(*) a numarray array.\n" #else "(!) rebuild PyQwt to support numarray arrays.\n" #endif ); return -1; } // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/support/qwt_numpy.h0000444000175000017500000000413311130210271017556 0ustar poxpox// The header for the interface PyQwt <-> NumPy. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. #ifndef QWT_NUMPY_H #define QWT_NUMPY_H #ifdef HAS_NUMPY #include #include #include // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumPyArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumPyArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumPyArray_to_QwtArray(PyObject *in, QwtArray &out); // returns 1, 0, -1 in case of success, wrong PyObject type, failure int try_NumPyArray_to_QImage(PyObject *in, QImage **out); #endif // HAS_NUMPY #endif // QWT_NUMPY_H // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: pyqwt5-5.2.1~cvs20091107+dfsg/support/qwt_numarray.cpp0000444000175000017500000001536211130210271020605 0ustar poxpox// The code for the interface PyQwt <-> numarray. // // Copyright (C) 2001-2009 Gerard Vermeulen // Copyright (C) 2000 Mark Colclough // // This file is part of PyQwt. // // PyQwt is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // PyQwt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with PyQwt; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // In addition, as a special exception, Gerard Vermeulen gives permission // to link PyQwt dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt in this form, provided that equally powerful // versions of Qt and PyQt have been released under the terms of the GNU // General Public License. // // If PyQwt is dynamically linked with non-free versions of Qt and PyQt, // PyQwt becomes a free plug-in for a non-free program. #ifdef HAS_NUMARRAY #include #include #include // steal those handy macro's from numpy #define PyArray_NDIM(obj) (((PyArrayObject *)(obj))->nd) #define PyArray_DATA(obj) ((void *)(((PyArrayObject *)(obj))->data)) #define PyArray_BYTES(obj) (((PyArrayObject *)(obj))->data) #define PyArray_DIMS(obj) (((PyArrayObject *)(obj))->dimensions) #define PyArray_STRIDES(obj) (((PyArrayObject *)(obj))->strides) #define PyArray_DIM(obj,n) (PyArray_DIMS(obj)[n]) #define PyArray_STRIDE(obj,n) (PyArray_STRIDES(obj)[n]) #define PyArray_TYPE(obj) (((PyArrayObject *)(obj))->descr->type_num) void qwt_import_numarray() { import_array(); } int try_NumarrayArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumarrayArray_to_QwtArray()\n"); #endif if (!PyArray_Check(in)) return 0; PyObject *array = PyArray_ContiguousFromObject(in, PyArray_DOUBLE, 1, 0); if (!array) { PyErr_SetString(PyExc_RuntimeError, "Failed to make a contiguous array of PyArray_DOUBLE"); return -1; } double *data = (double *) PyArray_DATA(array); out.resize(PyArray_DIM(array, 0)); for (double *it = out.begin(); it != out.end();) { *it++ = *data++; } Py_DECREF(array); return 1; } int try_NumarrayArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumarrayArray_to_QwtArray()\n"); #endif if (!PyArray_Check(in)) return 0; PyObject *array = PyArray_ContiguousFromObject(in, PyArray_INT, 1, 0); if (!array) { PyErr_SetString(PyExc_RuntimeError, "Failed to make a contiguous array of PyArray_INT"); return -1; } int *data = (int *) PyArray_DATA(array); out.resize(PyArray_DIM(array, 0)); for (int *it = out.begin(); it != out.end();) { *it++ = *data++; } Py_DECREF(array); return 1; } int try_NumarrayArray_to_QwtArray(PyObject *in, QwtArray &out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumarrayArray_to_QwtArray()\n"); #endif if (!PyArray_Check(in)) return 0; PyObject *array = PyArray_ContiguousFromObject(in, PyArray_LONG, 1, 0); if (!array) { PyErr_SetString(PyExc_RuntimeError, "Failed to make a contiguous array of PyArray_LONG"); return -1; } long *data = (long *) PyArray_DATA(array); out.resize(PyArray_DIM(array, 0)); for (long *it = out.begin(); it != out.end();) { *it++ = *data++; } Py_DECREF(array); return 1; } int try_NumarrayArray_to_QImage(PyObject *in, QImage **out) { #ifdef TRACE_PYQWT fprintf(stderr, "Qwt: try_NumarrayArray_to_QImage()\n"); #endif if (!PyArray_Check(in)) return 0; if (2 != PyArray_NDIM(in)) { PyErr_SetString(PyExc_RuntimeError, "Array must be 2-dimensional"); return -1; } const int ny = PyArray_DIM(in, 0); const int nx = PyArray_DIM(in, 1); const int stride = PyArray_STRIDE(in, 0); // 8 bit data if (PyArray_TYPE(in) == tUInt8) { #if QT_VERSION < 0x040000 if (!(*out = new QImage(nx, ny, 8, 256))) { #else if (!(*out = new QImage(nx, ny, QImage::Format_Indexed8))) { #endif PyErr_SetString(PyExc_RuntimeError, "Failed to create a QImage"); return -1; } char *data = PyArray_BYTES(in); for (int i=0; iscanLine(i), data, stride); data += stride; } // initialize the palette as all gray (*out)->setNumColors(256); for (int i = 0; i<(*out)->numColors(); i++) (*out)->setColor(i, qRgb(i, i, i)); return 1; } // 32 bit data if (PyArray_TYPE(in) == tUInt32) { #if QT_VERSION < 0x040000 if (!(*out = new QImage(nx, ny, 32))) { #else if (!(*out = new QImage(nx, ny, QImage::Format_ARGB32))) { #endif PyErr_SetString(PyExc_RuntimeError, "Failed to create a QImage"); return -1; } char *data = PyArray_BYTES(in); for (int i=0; iscanLine(i), data, stride); data += stride; } return 1; } PyErr_SetString(PyExc_RuntimeError, "Data type must be uint8, or uint32"); return -1; } PyObject *toNumarray(const QImage &image) { PyObject *result = 0; const int nx = image.width(); const int ny = image.height(); int dimensions[2] = {ny, nx}; if (image.depth() == 8) { // 8 bit data if (0 == (result = PyArray_FromDims(2, dimensions, tUInt8))) { PyErr_SetString(PyExc_MemoryError, "Failed to allocate array"); return 0; } } else if (image.depth() == 32) { // 32 bit data if (0 == (result = PyArray_FromDims(2, dimensions, tUInt32))) { PyErr_SetString(PyExc_MemoryError, "Failed to allocate array"); return 0; } } else { PyErr_SetString(PyExc_RuntimeError, "Image depth must be 8 or 32"); return 0; } char *data = PyArray_BYTES(result); const int stride = PyArray_STRIDE(result, 0); for (int i=0; i configuration.pyqt_version: raise Die(required) elif options.qt == 4: required = 'Requires at least PyQt-4.2 and its development tools.' options.qwt = 'qwt5qt4' options.iqt = 'iqt5qt4' try: import PyQt4.pyqtconfig as pyqtconfig except ImportError: raise Die(required) try: configuration = pyqtconfig.Configuration() except AttributeError: raise Die( 'Check whether SIP and PyQt4 have been installed properly.') if 0x040200 > configuration.pyqt_version: raise Die(required) return configuration # get_pyqt_configuration() def compile_qt_program(name, configuration, extra_defines=[], extra_include_dirs=[], extra_lib_dirs=[], extra_libs=[], ): """Compile a simple Qt application. name is the name of the single source file configuration is the pyqtconfig.Configuration() extra_defines is a list of extra preprocessor definitions extra_include_dirs is a list of extra directories to search for headers extra_lib_dirs is a list of extra directories to search for libraries extra_libs is a list of extra libraries """ makefile = pyqtconfig.sipconfig.ProgramMakefile( configuration, console=True, qt=True, warnings=True) makefile.extra_defines.extend(extra_defines) makefile.extra_include_dirs.extend(extra_include_dirs) makefile.extra_lib_dirs.extend(extra_lib_dirs) makefile.extra_libs.extend(extra_libs) exe, build = makefile.build_command(name) # zap a spurious executable try: os.remove(exe) except OSError: pass os.system(build) if not os.access(exe, os.X_OK): return None if sys.platform != 'win32': exe = './' + exe return exe # compile_qt_program() def make_and_run_qt_program(name, code, configuration, extra_defines = [], extra_include_dirs = [], ): """Make and run a simple Qt application name is the name of the application code is the code of the single source file configuration is the pyqtconfig.Configuration() extra_defines is a list of extra preprocessor definitions extra_include_dirs is a list of extra directories to search for headers """ pro_file = name + '.pro' make_file = name + '.mak' cpp_file = name + '.cpp' make_target = '' if sys.platform == "win32": exe = os.path.join("release", name + ".exe") make_target = " release" elif sys.platform == "darwin": exe = os.path.join(name + ".app", "Contents", "MacOS", name) else: exe = os.path.join(".", name) # Generate the source code. open(cpp_file, "w").write(code) # Generate the qmake project file. f = open(pro_file, "w") f.write( '''QT = core # This is for certain broken Linux distros and is needed to make sure that # QT_SHARED is properly defined. CONFIG += link_prl TARGET = %s SOURCES = %s ''' % (name, cpp_file)) if extra_defines: f.write( '''DEFINES += %s ''' % ' '.join(extra_defines)) if extra_include_dirs: f.write( '''INCLUDEPATH += %s ''' % ' '.join(extra_include_dirs)) f.close() qmake = os.path.join(configuration.qt_dir, 'bin', 'qmake') os.system('%s -spec %s -o %s %s' % ( qmake, configuration.platform, make_file, pro_file)) # Try and work out the name of make. if configuration.platform.startswith("win32-msvc"): make = "nmake" elif configuration.platform == "win32-borland": make = "bmake" elif configuration.platform == "win32-g++": make = "mingw32-make" else: make = "make" os.system('%s -f %s %s' % (make, make_file, make_target)) os.system(exe) # make_and_run_qt_program def copy_files(sources, directory): """Copy a list of files to a directory """ for source in sources: shutil.copy2(source, os.path.join(directory, os.path.basename(source))) # copy_files() def fix_build_file(name, extra_sources, extra_headers, extra_moc_headers): """Extend the targets of a SIP build file with extra files """ keys = ('target', 'sources', 'headers', 'moc_headers') sbf = {} for key in keys: sbf[key] = [] # Parse, nr = 0 for line in open(name, 'r'): nr += 1 if line[0] != '#': eq = line.find('=') if eq == -1: raise Die('"%s\" line %d: Line must be in the form ' '"key = value value...."' % (name, nr)) key = line[:eq].strip() value = line[eq+1:].strip() if key in keys: sbf[key].append(value) # extend, sbf['sources'].extend(extra_sources) sbf['headers'].extend(extra_headers) sbf['moc_headers'].extend(extra_moc_headers) # and write. output = open(name, 'w') for key in keys: if sbf[key]: output.write('%s = %s%s' % (key, ' '.join(sbf[key]), os.linesep)) # fix_build_file() def lazy_copy_file(source, target): """Lazy copy a file to another file: - check for a SIP time stamp to skip, - check if source and target do really differ, - copy the source file to the target if they do, - return True on copy and False on no copy. """ if not os.path.exists(target): shutil.copy2(source, target) return True sourcelines = open(source).readlines() targetlines = open(target).readlines() # global length check if len(sourcelines) != len(targetlines): shutil.copy2(source, target) return True # skip a SIP time stamp if (len(sourcelines) > 3 and sourcelines[3].startswith(' * Generated by SIP') ): line = 4 else: line = 0 # line by line check while line < len(sourcelines): if sourcelines[line] != targetlines[line]: shutil.copy2(source, target) return True line = line + 1 return False # lazy_copy_file() def check_numarray(configuration, options, package): """Check whether the numarray extension has been installed. """ if options.disable_numarray: options.excluded_features.append("-x HAS_NUMARRAY") return options try: import numarray # Try to find numarray/arrayobject.h. numarray_inc = os.path.join( configuration.py_inc_dir, "numarray", "arrayobject.h") if os.access(numarray_inc, os.F_OK): inform("Found numarray-%s.\n" % numarray.__version__) options.extra_defines.append("HAS_NUMARRAY") else: inform(("numarray has been installed, " "but its headers are not in the standard location.\n" "%s will be build without support for numarray.\n" "(Linux users may have to install a development package)\n" ) % (package,)) raise ImportError except ImportError: options.excluded_features.append("-x HAS_NUMARRAY") inform(("Failed to import numarray: " "%s will be build without support for numarray.\n" ) % (package,)) return options # check_numarray() def check_numeric(configuration, options, package): """See if the Numeric extension has been installed. """ if options.disable_numeric: options.excluded_features.append("-x HAS_NUMERIC") return options try: import Numeric # Try to find Numeric/arrayobject.h. numeric_inc = os.path.join( configuration.py_inc_dir, "Numeric", "arrayobject.h") if os.access(numeric_inc, os.F_OK): inform("Found Numeric-%s.\n" % (Numeric.__version__,)) options.extra_defines.append("HAS_NUMERIC") else: inform(("Numeric has been installed, " "but its headers are not in the standard location.\n" "%s will be build without support for Numeric.\n" "(Linux users may have to install a development package)\n" ) % (package,)) raise ImportError except ImportError: options.excluded_features.append("-x HAS_NUMERIC") inform(("Failed to import Numeric: " "%s will be build without support for Numeric.\n" ) % (package,)) return options # check_numeric() def check_numpy(_, options, package): """See if the NumPy extension has been installed. """ if options.disable_numpy: options.excluded_features.append("-x HAS_NUMPY") return options try: import numpy except ImportError: options.excluded_features.append("-x HAS_NUMPY") inform(('Failed to import numpy: ' '%s will be build without support for NumPy.\n' ) % (package,)) return options # Try to find numpy/arrayobject.h. try: from numpy.distutils.misc_util import get_numpy_include_dirs except ImportError: options.excluded_features.append("-x HAS_NUMPY") inform(('NumPy has been installed, ' 'but numpy.distutils.misc_util is missing.\n' '%s will be build without support for NumPy.\n' '(Linux users may have to install a development package)\n' ) % (package,)) return options include_dirs = get_numpy_include_dirs() for inc_dir in include_dirs: header = os.path.join(inc_dir, 'numpy', 'arrayobject.h') if os.access(header, os.F_OK): break else: options.excluded_features.append("-x HAS_NUMPY") inform(('NumPy has been installed, ' 'but its headers are not in the standard location.\n' '%s will be build without support for NumPy.\n' '(Linux users may have to install a development package)\n' ) % (package,)) return options inform('Found NumPy-%s.\n' % (numpy.__version__,)) options.extra_defines.append('HAS_NUMPY') options.extra_include_dirs.extend(include_dirs) return options # check_numpy() def check_compiler(configuration, options): """Check compiler specifics. """ inform( 'Do not get upset by error messages in the next 3 compiler checks:\n') makefile = pyqtconfig.sipconfig.Makefile(configuration) generator = makefile.optional_string('MAKEFILE_GENERATOR', 'UNIX') if generator in ['MSVC', 'MSVC.NET']: options.extra_cxxflags.extend(['-GR']) program = '\n'.join([ r'#include ', r'class a { public: void f(size_t); };', r'void a::f(%s) {};', r'int main() { return 0; }', r'', ]) name = "size_t_check.cpp" new = [ '// Automagically generated by configure.py', '', '// Uncomment one of the following three lines', ] for ctype in ('unsigned int', 'unsigned long', 'unsigned long long'): open(name, "w").write(program % ctype) inform("Check whether 'size_t' and '%s' are the same type:\n" % ctype) if compile_qt_program(name, configuration): comment = '' inform("YES\n") else: inform("NO\n") comment = '// ' new.append('%stypedef %s size_t;' % (comment, ctype)) new.extend(['', '// Local Variables:', '// mode: C++', '// c-file-style: "stroustrup"', '// End:', '', ]) new = '\n'.join(new) types_sip = os.path.join(os.pardir, 'sip', options.qwt, 'QwtTypes.sip') if os.access(types_sip, os.R_OK): old = open(types_sip, 'r').read() else: old = '' if old != new: open(types_sip, 'w').write(new) return options # check_compiler() def check_os(_, options): """Check operating system and Python specifics. """ inform("Found %s operating system.\n" % os.name) inform("Found Python-%s.\n" % sys.version) if os.name == 'nt': options.extra_defines.append('WIN32') return options # check_os() def check_sip(configuration, options): """Check whether PyQwt can be built with SIP. """ version = configuration.sip_version version_str = configuration.sip_version_str inform("Found SIP-%s.\n" % version_str) if 0x040600 > version: raise Die('PyQwt requires at least SIP-4.6.') if (0x031105 > configuration.pyqt_version or 0x03ffff < configuration.pyqt_version): options.excluded_features.append('-x HAS_PYQT_031105') options.extra_include_dirs.append(configuration.sip_inc_dir) return options # check_sip def check_iqt(_, options): """Check iqt module specifics. """ # iqt is useless on non-Windows platforms without GNU readline && select. options.subdirs.append(options.iqt) options.modules.append('iqt') options.iqt_sipfile = os.path.join( os.pardir, 'sip', options.iqt, 'IQtModule.sip') return options # check_iqt() def check_qwt(configuration, options): """Check qwt module specifics. """ # zap all qwt_version_info* for name in glob.glob('qwt_version_info*'): try: os.remove(name) except OSError: pass code = ( '''#include #include #include int main(int, char **) { QFile file("qwt_version_info.py"); #if QT_VERSION < 0x040000 if (!file.open(IO_WriteOnly|IO_Truncate)) { #else if (!file.open(QIODevice::WriteOnly|QIODevice::Truncate|QIODevice::Text)) { #endif return 1; } QTextStream text(&file); text << "QWT_VERSION = 0x0" << hex << QWT_VERSION << "\\n"; text << "QWT_VERSION_STR = \\"" << QWT_VERSION_STR << "\\"\\n"; return 0; } // Local Variables: // mode: C++ // c-file-style: "stroustrup" // End: ''') extra_include_dirs = [] if options.qwt_sources: extra_include_dirs.append(os.path.join(options.qwt_sources, 'src')) if options.extra_include_dirs: extra_include_dirs.extend(options.extra_include_dirs) make_and_run_qt_program('qwt_version_info', code, configuration, extra_include_dirs = extra_include_dirs) try: from qwt_version_info import QWT_VERSION, QWT_VERSION_STR except ImportError: raise Die('Failed to import qwt_version_info.') if QWT_VERSION < 0x050000: raise Die('Qwt-%s is not supported.' % QWT_VERSION_STR) elif QWT_VERSION == 0x050000: options.timelines.append('-t Qwt_5_0_0') elif QWT_VERSION < 0x050003: options.timelines.append('-t Qwt_5_0_1') elif QWT_VERSION < 0x050100: options.timelines.append('-t Qwt_5_0_3') elif QWT_VERSION < 0x050101: options.timelines.append('-t Qwt_5_1_0') elif QWT_VERSION < 0x050200: options.timelines.append('-t Qwt_5_1_1') else: options.timelines.append('-t Qwt_5_2_0') inform('Found Qwt-%s.\n' % QWT_VERSION_STR) options.excluded_features.append('-x HAS_QWT4') options.subdirs.append(options.qwt) options.modules.append('Qwt5') options.qwt_sipfile = os.path.join( os.pardir, 'sip', options.qwt, 'QwtModule.sip') open('qwt_svg_check.cpp', 'w').write('\n'.join([ r'#include ', r'', r'int main(int, char **)', r'{', r' return 0;', r'}', r'', r'// Local Variables:', r'// mode: C++', r'// c-file-style: "stroustrup"', r'// End:', r'', ])) exe = compile_qt_program('qwt_svg_check.cpp', configuration, extra_include_dirs = extra_include_dirs) if not exe: options.excluded_features.append('-x HAS_QWT_SVG') return options # check_qwt() def setup_iqt_build(configuration, options, package): """Setup the iqt module build. """ if 'iqt' not in options.modules: return inform('Setup the %s package build.\n' % package) build_dir = options.iqt tmp_dir = 'tmp-' + build_dir build_file = os.path.join(tmp_dir, '%s.sbf' % options.iqt) # zap the temporary directory try: shutil.rmtree(tmp_dir) except: pass # make a clean temporary directory try: os.mkdir(tmp_dir) except: raise Die('Failed to create the temporary build directory.') # invoke SIP cmd = ' '.join( [configuration.sip_bin, '-b', build_file, '-c', tmp_dir, options.jobs, options.trace, ] # SIP assumes POSIX style path separators + [options.iqt_sipfile.replace('\\', '/')] ) inform('sip invokation:') pprint.pprint(cmd) if os.path.exists(build_file): os.remove(build_file) os.system(cmd) if not os.path.exists(build_file): raise Die('SIP failed to generate the C++ code.') # copy lazily to the build directory to speed up recompilation if not os.path.exists(build_dir): try: os.mkdir(build_dir) except: raise Die('Failed to create the build directory.') lazy_copies = 0 for pattern in ('*.c', '*.cpp', '*.h', '*.py', '*.sbf'): for source in glob.glob(os.path.join(tmp_dir, pattern)): target = os.path.join(build_dir, os.path.basename(source)) if lazy_copy_file(source, target): inform('Copy %s -> %s.\n' % (source, target)) lazy_copies += 1 inform('%s file(s) lazily copied.\n' % lazy_copies) makefile = pyqtconfig.sipconfig.ModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, qt = 1, warnings = 1, debug = options.debug ) makefile._target = '_iqt' makefile.extra_cflags.extend(options.extra_cflags) makefile.extra_cxxflags.extend(options.extra_cxxflags) makefile.extra_defines.extend(options.extra_defines) makefile.extra_include_dirs.extend(options.extra_include_dirs) makefile.extra_lflags.extend(options.extra_lflags) makefile.extra_libs.extend(options.extra_libs) makefile.extra_lib_dirs.extend(options.extra_lib_dirs) makefile.generate() # setup_iqt_build() def nsis(): """Generate the script for the Nullsoft Scriptable Install System. """ try: from numpy.version import version as numpy_version from PyQt4.Qt import PYQT_VERSION_STR, QT_VERSION_STR except: return open('PyQwt.nsi', 'w').write(open('PyQwt.nsi.in').read() % { 'PYQT_VERSION': PYQT_VERSION_STR, 'PYTHON_VERSION': '%s.%s' % sys.version_info[:2], 'QT_VERSION': QT_VERSION_STR, 'NUMPY_VERSION': numpy_version, }) # nsis() def setup_qwt5_build(configuration, options, package): """Setup the qwt module build """ if 'Qwt5' not in options.modules: return inform('Setup the %s package build.\n' % package) build_dir = options.qwt tmp_dir = 'tmp-%s' % options.qwt build_file = os.path.join(tmp_dir, '%s.sbf' % options.qwt) extra_sources = [] extra_headers = [] extra_moc_headers = [] if configuration.qt_version < 0x040000: extra_py_files = glob.glob( os.path.join(os.pardir, 'qt3lib', 'Qwt5', '*.py')) else: extra_py_files = glob.glob( os.path.join(os.pardir, 'qt4lib', 'PyQt4', 'Qwt5', '*.py')) # do we compile and link the sources of Qwt statically into PyQwt? if options.qwt_sources: extra_sources += glob.glob(os.path.join( options.qwt_sources, 'src', '*.cpp')) extra_headers += glob.glob(os.path.join( options.qwt_sources, 'src', '*.h')) extra_moc_headers = [] for header in extra_headers: text = open(header).read() if re.compile(r'^\s*Q_OBJECT', re.M).search(text): extra_moc_headers.append(header) # add the interface to the numerical Python extensions extra_sources += glob.glob(os.path.join(os.pardir, 'support', '*.cpp')) extra_headers += glob.glob(os.path.join(os.pardir, 'support', '*.h')) # do we compile and link the sources of Qwt into PyQwt? if sys.platform == 'win32': qwt = 'qwt5' else: qwt = 'qwt' if options.qwt_sources: # yes, zap all occurrences of a qwt library while options.extra_libs.count(qwt): options.extra_libs.remove(qwt) elif qwt not in options.extra_libs: # no, add the qwt library if needed options.extra_libs.append(qwt) # zap the temporary directory try: shutil.rmtree(tmp_dir) except: pass # make a clean temporary directory try: os.mkdir(tmp_dir) except: raise Die('Failed to create the temporary build directory.') # copy the extra files copy_files(extra_sources, tmp_dir) copy_files(extra_headers, tmp_dir) copy_files(extra_moc_headers, tmp_dir) copy_files(extra_py_files, tmp_dir) # work around a bug one of the Qwt-5.2.0 headers if not options.qwt_sources: fixed_headers = [] try: from qwt_version_info import QWT_VERSION except ImportError: raise Die('Failed to import qwt_version_info.') if QWT_VERSION == 0x050200: fixed_headers += glob.glob(os.path.join( os.pardir, 'include-5.2.0', '*.h')) copy_files(fixed_headers, tmp_dir) try: # Qt4 pyqt_sip_flags = configuration.pyqt_sip_flags except AttributeError: # Qt3 pyqt_sip_flags = configuration.pyqt_qt_sip_flags # invoke SIP cmd = ' '.join( [configuration.sip_bin, # SIP assumes POSIX style path separators '-I', configuration.pyqt_sip_dir.replace('\\', '/'), '-b', build_file, '-c', tmp_dir, options.jobs, options.trace, pyqt_sip_flags, ] + options.sip_include_dirs + options.excluded_features + options.timelines # SIP assumes POSIX style path separators + [options.qwt_sipfile.replace('\\', '/')] ) inform('sip invokation:\n') pprint.pprint(cmd) if os.path.exists(build_file): os.remove(build_file) os.system(cmd) if not os.path.exists(build_file): raise Die('SIP failed to generate the C++ code.') # fix the SIP build file fix_build_file(build_file, [os.path.basename(f) for f in extra_sources], [os.path.basename(f) for f in extra_headers], [os.path.basename(f) for f in extra_moc_headers]) # copy lazily to the build directory to speed up recompilation if not os.path.exists(build_dir): try: os.mkdir(build_dir) except: raise Die('Failed to create the build directory.') lazy_copies = 0 for pattern in ('*.c', '*.cpp', '*.h', '*.py', '*.sbf'): for source in glob.glob(os.path.join(tmp_dir, pattern)): target = os.path.join(build_dir, os.path.basename(source)) if lazy_copy_file(source, target): inform('Copy %s -> %s.\n' % (source, target)) lazy_copies += 1 inform('%s file(s) lazily copied.\n' % lazy_copies) # byte-compile the Python files compileall.compile_dir(build_dir, ddir=options.module_install_path) # files to be installed installs = [] installs.append([[os.path.basename(f) for f in glob.glob( os.path.join(build_dir, '*.py*'))], options.module_install_path]) pattern = os.path.join(os.pardir, 'sip', options.qwt, '*.sip') sip_files = [os.path.join(os.pardir, f) for f in glob.glob(pattern)] pattern = os.path.join(os.pardir, 'sip', options.qwt, 'common', '*.sip') sip_files += [os.path.join(os.pardir, f) for f in glob.glob(pattern)] installs.append( [sip_files, os.path.join(configuration.pyqt_sip_dir, 'Qwt5')]) # designer if configuration.qt_version > 0x03ffff: plugin_source_path = os.path.join( os.pardir, 'qt4lib', 'PyQt4', 'uic', 'widget-plugins') plugin_install_path = os.path.join( configuration.pyqt_mod_dir, 'uic', 'widget-plugins') compileall.compile_dir(plugin_source_path, ddir=plugin_install_path) pattern = os.path.join(plugin_source_path, '*.py*') plugin_files = [os.path.join(os.pardir, f) for f in glob.glob(pattern)] installs.append([plugin_files, plugin_install_path]) # module makefile if options.qt == 3: makefile = pyqtconfig.sipconfig.SIPModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, installs = installs, qt = 1, warnings = 1, debug = options.debug, ) elif options.qt == 4: qt = ['QtCore', 'QtGui'] if '-x HAS_QWT_SVG' not in options.excluded_features: qt.append('QtSvg') makefile = pyqtconfig.sipconfig.SIPModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, installs = installs, qt = qt, warnings = 1, debug = options.debug, ) makefile.extra_cflags.extend(options.extra_cflags) makefile.extra_cxxflags.extend(options.extra_cxxflags) makefile.extra_defines.extend(options.extra_defines) makefile.extra_include_dirs.extend(options.extra_include_dirs) makefile.extra_lflags.extend(options.extra_lflags) makefile.extra_libs.extend(options.extra_libs) makefile.extra_lib_dirs.extend(options.extra_lib_dirs) makefile.generate() if options.qt == 4: nsis() # setup_qwt5_build() def setup_parent_build(configuration, options): """Generate the parent Makefile """ inform("Setup the PyQwt build.\n") pyqtconfig.sipconfig.ParentMakefile(configuration = configuration, subdirs = options.subdirs).generate() # setup_parent_build() def parse_args(): """Return the parsed options and args from the command line """ usage = ( 'python configure.py [options]' '\n\nEach option takes at most one argument, but some options' '\naccumulate arguments when repeated. For example, invoke:' '\n\n\tpython configure.py -I %s -I %s' '\n\nto search the current *and* parent directories for headers.' ) % (os.curdir, os.pardir) parser = optparse.OptionParser(usage=usage) common_options = optparse.OptionGroup(parser, 'Common options') common_options.add_option( '-3', '--qt3', action='store_const', const=3, dest='qt', help=('build for Qt3 and PyQt [default Qt4]')) common_options.add_option( '-4', '--qt4', action='store_const', const=4, dest='qt', default=4, help=('build for Qt4 and PyQt4 [default Qt4]')) common_options.add_option( '-Q', '--qwt-sources', default='', action='store', type='string', metavar='/sources/of/qwt', help=('compile and link the Qwt source files in' ' /sources/of/qwt statically into PyQwt')) common_options.add_option( '-I', '--extra-include-dirs', default=[], action='append', type='string', metavar='/usr/lib/qt3/include/qwt', help=('add an extra directory to search for headers' ' (the compiler must be able to find the Qwt headers' ' without the -Q option)')) common_options.add_option( '-L', '--extra-lib-dirs', default=[], action='append', type='string', metavar='/usr/lib/qt3/lib', help=('add an extra directory to search for libraries' ' (the linker must be able to find the Qwt library' ' without the -Q option)')) common_options.add_option( '-j', '--jobs', default=0, action='store', type='int', metavar='N', help=('concatenate the SIP generated code into N files' ' [default 1 per class] (to speed up make by running ' ' simultaneous jobs on multiprocessor systems)')) parser.add_option_group(common_options) make_options = optparse.OptionGroup(parser, 'Make options') make_options.add_option( '--debug', default=False, action='store_true', help='enable debugging symbols [default disabled]') make_options.add_option( '--extra-cflags', default=[], action='append', type='string', metavar='EXTRA_CFLAG', help='add an extra C compiler flag') make_options.add_option( '--extra-cxxflags', default=[], action='append', type='string', metavar='EXTRA_CXXFLAG', help='add an extra C++ compiler flag') make_options.add_option( '-D', '--extra-defines', default=[], action='append', type='string', metavar='HAS_EXTRA_SENSORY_PERCEPTION', help='add an extra preprocessor definition') make_options.add_option( '-l', '--extra-libs', default=[], action='append', type='string', metavar='extra_sensory_perception', help='add an extra library') make_options.add_option( '--extra-lflags', default=[], action='append', type='string', metavar='EXTRA_LFLAG', help='add an extra linker flag') parser.add_option_group(make_options) sip_options = optparse.OptionGroup(parser, 'SIP options') sip_options.add_option( '-x', '--excluded-features', default=[], action='append', type='string', metavar='EXTRA_SENSORY_PERCEPTION', help=('add a feature for SIP to exclude' ' (normally one of the features in sip/features.sip)')) sip_options.add_option( '-t', '--timelines', default=[], action='append', type='string', metavar='EXTRA_SENSORY_PERCEPTION', help=('add a timeline option for SIP' ' (normally one of the timeline options in sip/timelines.sip)')) sip_options.add_option( '--sip-include-dirs', default=[], action='append', type='string', metavar='SIP_INCLUDE_DIR', help='add an extra directory for SIP to search') sip_options.add_option( '--trace', default=False, action='store_true', help=('enable trace of the execution of the bindings' ' [default disabled]')) parser.add_option_group(sip_options) detection_options = optparse.OptionGroup(parser, 'Detection options') detection_options.add_option( '--disable-numarray', default=False, action='store_true', help='disable detection and use of numarray [default enabled]' ) detection_options.add_option( '--disable-numeric', default=False, action='store_true', help='disable detection and use of Numeric [default enabled]' ) detection_options.add_option( '--disable-numpy', default=False, action='store_true', help='disable detection and use of NumPy [default enabled]' ) parser.add_option_group(detection_options) install_options = optparse.OptionGroup(parser, 'Install options') install_options.add_option( '--module-install-path', default='', action='store', help= 'specify the install directory for the Python modules' ) parser.add_option_group(install_options) options, args = parser.parse_args() # tweak some of the options to facilitate later processing if options.jobs < 1: options.jobs = '' else: options.jobs = '-j %s' % options.jobs options.excluded_features = [ ('-x %s' % f) for f in options.excluded_features ] # SIP assumes POSIX style path separators options.sip_include_dirs = [ ('-I %s' % f).replace('\\', '/') for f in options.sip_include_dirs ] options.timelines = [ ('-t %s' % t) for t in options.timelines ] if options.trace: options.trace = '-r' options.extra_defines.append('TRACE_PYQWT') else: options.trace = '' options.modules = [] options.subdirs = [] return options, args # parse_args() def main(): """Generate the build tree and the Makefiles """ options, args = parse_args() inform('Command line options:\n%s\n' % pprint.pformat(options.__dict__)) configuration = get_pyqt_configuration(options) options = check_sip(configuration, options) options = check_os(configuration, options) options = check_compiler(configuration, options) options = check_numarray(configuration, options, 'PyQwt') options = check_numeric(configuration, options, 'PyQwt') options = check_numpy(configuration, options, 'PyQwt') options = check_iqt(configuration, options) options = check_qwt(configuration, options) if not options.module_install_path: options.module_install_path = os.path.join( configuration.pyqt_mod_dir, 'Qwt5') inform('Extended command line options:\n%s\n' % pprint.pformat(options.__dict__)) inform('\nThe following modules will be built: %s.\n\n' % options.modules) setup_iqt_build(configuration, options, 'PyQwt') setup_qwt5_build(configuration, options, 'PyQwt') setup_parent_build(configuration, options) inform('\nGreat, run make or nmake to build and install PyQwt.\n') # main() if __name__ == '__main__': try: main() except Die as e: inform('%s\n' % e.args) sys.exit(1) except: for entry in traceback.extract_tb(sys.exc_info()[-1]): if 'optparse.py' in entry[0]: sys.exit(0) else: inform( 'An internal error occured. Please report all the output\n' 'from the program, including the following traceback, to\n' 'pyqwt-users@lists.sourceforge.net.\n' ) traceback.print_exc() sys.exit(1) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/configure/PyQwt.nsi.in0000444000175000017500000002072111235000431020015 0ustar poxpox# PyQwt5 NSIS installer script. # # Copyright (C) 2001-2009 Gerard Vermeulen # Copyright (C) 2000 Mark Colclough # # This file is part of PyQwt. # # PyQwt is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # PyQwt is supplied in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with PyQwt; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA. # # In addition, as a special exception, Gerard Vermeulen give permission # to link PyQwt dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt in this form, provided that equally powerful # versions of Qt and PyQt have been released under the terms of the GNU # General Public License. # # If PyQwt is dynamically linked with non-free versions of Qt and PyQt, # PyQwt becomes a free plug-in for a non-free program. # These will change with different releases. !define PYQWT_VERSION "5.2.0" !define PYQWT_PYQT_VERSION "%(PYQT_VERSION)s" !define PYQWT_PYTHON_VERSION "%(PYTHON_VERSION)s" !define PYQWT_QT_VERSION "%(QT_VERSION)s" !define PYQWT_NUMPY_VERSION "%(NUMPY_VERSION)s" # These are all derived from the above. !define PYQWT_NAME "PyQwt-${PYQWT_VERSION}" !define PYQWT_INSTALLDIR "C:\Python${PYQWT_PYTHON_VERSION}\" !define PYQWT_PYTHON_HKLM "Software\Python\PythonCore\${PYQWT_PYTHON_VERSION}\InstallPath" # Tweak some of the standard pages. !define MUI_WELCOMEPAGE_TEXT \ "This wizard will guide you through the installation of ${PYQWT_NAME} \ built with the MinGW compiler against:\r\n\ - Python-${PYQWT_PYTHON_VERSION}.x\r\n\ - Qt-${PYQWT_QT_VERSION}\r\n\ - PyQt-${PYQWT_PYQT_VERSION}\r\n\ - NumPy-${PYQWT_NUMPY_VERSION}.\r\n\ \r\n\ The license of the distribution of any of your software using PyQwt has to be \ compatible with the GPL licence. To comply with the GPL, you have to assure \ your licensees 4 freedoms:\r\n\ 0 - to run your software, for any purpose\r\n\ 1 - to study your software, and adapt it to his needs\r\n\ 2 - to redistribute copies so he can help his neighbor\r\n\ 3 - to improve your software, and release his improvements.\r\n\ Access to the source code is a precondition for this.\r\n\ \r\n\ Click Next to continue." !define MUI_FINISHPAGE_LINK "Get the latest news of PyQwt here" !define MUI_FINISHPAGE_LINK_LOCATION "http://pyqwt.sourceforge.net" # Include the tools we use. !include MUI.nsh !include LogicLib.nsh # Define the product name and installer executable. Name "PyQwt" Caption "${PYQWT_NAME} Setup" OutFile "PyQwt${PYQWT_VERSION}-Python${PYQWT_PYTHON_VERSION}-PyQt${PYQWT_PYQT_VERSION}-NumPy${PYQWT_NUMPY_VERSION}-1.exe" # Set the install directory, from the registry if possible. InstallDir "${PYQWT_INSTALLDIR}" InstallDirRegKey HKLM "${PYQWT_PYTHON_HKLM}" "" # The different installation types. "Full" is everything. "Minimal" is the # runtime environment. InstType "Full" InstType "Minimal" # Maximum compression. SetCompressor /SOLID lzma # We want the user to confirm they want to cancel. !define MUI_ABORTWARNING Function .onInit # Check the right version of Python has been installed. ReadRegStr $0 HKLM "${PYQWT_PYTHON_HKLM}" "" ${If} $0 == "" MessageBox MB_YESNO|MB_ICONQUESTION \ "This copy of PyQwt has been built against Python-${PYQWT_PYTHON_VERSION}.x \ which doesn't seem to be installed.$\r$\n\ $\r$\n\ Do you with to continue with the installation?" IDYES GotPython Abort GotPython: ${Endif} FunctionEnd # Define the different pages. !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "..\COPYING" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES # Other settings. !insertmacro MUI_LANGUAGE "English" # Installer sections. Section "Extension modules" SecModules SectionIn 1 2 RO # Make sure this is clean and tidy. RMDir /r $PROGRAMFILES\PyQwt5 CreateDirectory $PROGRAMFILES\PyQwt5 SetOverwrite on SetOutPath $INSTDIR\Lib\site-packages\PyQt4\Qwt5 File ..\qt4lib\PyQt4\Qwt5\__init__.py File ..\qt4lib\PyQt4\Qwt5\anynumpy.py File ..\qt4lib\PyQt4\Qwt5\grace.py File ..\qt4lib\PyQt4\Qwt5\iqt.py File ..\qt4lib\PyQt4\Qwt5\qplt.py File .\iqt5qt4\_iqt.pyd File .\qwt5qt4\Qwt.pyd SetOutPath $INSTDIR\Lib\site-packages\PyQt4\uic\widget-plugins File ..\qt4lib\PyQt4\uic\widget-plugins\qwt.py SectionEnd Section "Documentation" SecDocumentation SectionIn 1 SetOverwrite on SetOutPath $PROGRAMFILES\PyQwt5 File /r ..\sphinx\build\html File /r ..\qwt-5.2\doc\html SectionEnd Section "Designer plugin" SecDesigner SectionIn 1 SetOverwrite on SetOutPath $INSTDIR\Lib\site-packages\PyQt4\plugins\designer File ..\qwt-5.2\designer\plugins\designer\qwt_designer_plugin5.dll SectionEnd Section "Examples" SecExamples SectionIn 1 SetOverwrite on SetOutPath $PROGRAMFILES\PyQwt5 File /r ..\qt4examples SectionEnd Section "Start Menu shortcuts" SecShortcuts SectionIn 1 # Make sure this is clean and tidy. RMDir /r "$SMPROGRAMS\${PYQWT_NAME}" CreateDirectory "$SMPROGRAMS\${PYQWT_NAME}" IfFileExists "$PROGRAMFILES\PyQwt5\pyqwt\index.html" 0 +2 CreateShortCut "$SMPROGRAMS\${PYQWT_NAME}\PyQwt Documentation.lnk" "$PROGRAMFILES\PyQwt5\pyqwt\index.html" IfFileExists "$PROGRAMFILES\PyQwt5\html\index.html" 0 +2 CreateShortCut "$SMPROGRAMS\${PYQWT_NAME}\Qwt Documentation.lnk" "$PROGRAMFILES\PyQwt5\html\index.html" IfFileExists "$PROGRAMFILES\PyQwt5\qt4examples" 0 +3 SetOutPath $INSTDIR CreateShortCut "$SMPROGRAMS\${PYQWT_NAME}\Examples Source.lnk" "$PROGRAMFILES\PyQwt5\qt4examples" CreateShortCut "$SMPROGRAMS\${PYQWT_NAME}\Uninstall PyQwt.lnk" "$PROGRAMFILES\PyQwt5\Uninstall.exe" SectionEnd Section -post # Tell Windows about the package. WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt5" "UninstallString" '"$PROGRAMFILES\PyQwt5\Uninstall.exe"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt5" "DisplayName" "${PYQWT_NAME}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt5" "DisplayVersion" "${PYQWT_VERSION}" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt5" "NoModify" "1" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt5" "NoRepair" "1" # Save the installation directory for the uninstaller. WriteRegStr HKLM "Software\PyQwt5" "" $INSTDIR # Create the uninstaller. WriteUninstaller "$PROGRAMFILES\PyQwt5\Uninstall.exe" SectionEnd # Section description text. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecModules} \ "The PyQwt modules: Qwt, anynumpy, grace, iqt, pythonrc, qplt." !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} \ "The PyQwt and Qwt documentation." !insertmacro MUI_DESCRIPTION_TEXT ${SecDesigner} \ "The Qwt plugin for Qt Designer" !insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} \ "Python examples and Python ports of the Qwt C++ examples." !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} \ "Shortcuts to your Start Menu." !insertmacro MUI_FUNCTION_DESCRIPTION_END Section "Uninstall" # Get the install directory. ReadRegStr $INSTDIR HKLM "Software\PyQwt5" "" # The modules section. RMDir /r $INSTDIR\Lib\site-packages\PyQt4\Qwt5 # The widget plugin for the pyuic4 Delete $INSTDIR\Lib\site-packages\PyQt4\uic\widget-plugins\qwt.py # The shortcuts section. RMDir /r "$SMPROGRAMS\${PYQWT_NAME}" # The examples section and the installer itself. RMDir /r "$PROGRAMFILES\PyQwt5" # Clean the registry. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt5" DeleteRegKey HKLM "Software\PyQwt5" SectionEnd pyqwt5-5.2.1~cvs20091107+dfsg/configure/configqt.bat0000444000175000017500000000121511227111504020115 0ustar poxpoxREM Phil Thompson has built Qt-4.5.1 with win32-msvc2008 using: REM configure -release -fast -no-accessibility -no-stl -plugin-sql-odbc -plugin-sql-sqlite -no-rtti -no-qt3support -qt-zlib -qt-gif -qt-libpng -qt-libjpeg -qt-libmng -qt-libtiff -openssl -I C:\OpenSSL\include -L C:\OpenSSL\lib -plugin-sql-mysql -I C:\MySQL\include -L C:\MySQL\lib\opt -plugin-sql-psql -I C:\PostgreSQL\include -L C:\PostgreSQL\lib REM Gerard Vermeulen has built Qt-4.5.1 with win32-msvc2008 using: configure -release -fast -no-accessibility -no-stl -plugin-sql-odbc -plugin-sql-sqlite -no-rtti -no-qt3support -qt-zlib -qt-gif -qt-libpng -qt-libjpeg -qt-libmng -qt-libtiff pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/0000755000175000017500000000000011275562661016124 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/BarPlotDemo.py0000555000175000017500000002251311274627175020653 0ustar poxpox#!/usr/bin/env python # Contributed by Tomaz Curk in a bug report showing that the stack order of the # curves was dependent on the number of curves. This has been fixed in Qwt. # # BarCurve is an idea of Tomaz Curk. # # Beautified and expanded by Gerard Vermeulen. import random import sys import qt import Qwt5 as Qwt class Spy(qt.QObject): def __init__(self, parent): qt.QObject.__init__(self, parent) parent.setMouseTracking(True) parent.installEventFilter(self) # __init__() def eventFilter(self, _, event): if event.type() == qt.QEvent.MouseMove: self.emit(qt.PYSIGNAL("MouseMove"), (event.pos(),)) return False # eventFilter() # class Spy class BarCurve(Qwt.QwtPlotCurve): def __init__(self, penColor=qt.Qt.black, brushColor=qt.Qt.white): Qwt.QwtPlotCurve.__init__(self) self.penColor = penColor self.brushColor = brushColor # __init__() def drawFromTo(self, painter, xMap, yMap, start, stop): """Draws rectangles with the corners taken from the x- and y-arrays. """ painter.setPen(qt.QPen(self.penColor, 2)) painter.setBrush(self.brushColor) if stop == -1: stop = self.dataSize() # force 'start' and 'stop' to be even and positive if start & 1: start -= 1 if stop & 1: stop -= 1 start = max(start, 0) stop = max(stop, 0) for i in range(start, stop, 2): px1 = xMap.transform(self.x(i)) py1 = yMap.transform(self.y(i)) px2 = xMap.transform(self.x(i+1)) py2 = yMap.transform(self.y(i+1)) painter.drawRect(px1, py1, (px2 - px1), (py2 - py1)) # drawFromTo() # class BarCurve class BarPlotMainWindow(qt.QMainWindow): colors = (qt.Qt.red, qt.Qt.green, qt.Qt.blue, qt.Qt.cyan, qt.Qt.magenta, qt.Qt.yellow, ) def __init__(self, parent=None): qt.QMainWindow.__init__(self, parent) # Initialize a QwPlot central widget self.plot = Qwt.QwtPlot(self) self.plot.setTitle('left-click & drag to zoom') self.plot.setCanvasBackground(qt.Qt.white) self.plot.plotLayout().setCanvasMargin(0) self.plot.plotLayout().setAlignCanvasToScales(True) self.setCentralWidget(self.plot) grid = Qwt.QwtPlotGrid() pen = qt.QPen(qt.Qt.DotLine) pen.setColor(qt.Qt.black) pen.setWidth(0) grid.setPen(pen) grid.attach(self.plot) self.__initTracking() self.__initZooming() self.__initToolBar() # Finalize self.counter.setValue(10) self.go(self.counter.value()) # __init__() def __initTracking(self): """Initialize tracking """ self.connect(Spy(self.plot.canvas()), qt.PYSIGNAL("MouseMove"), self.showCoordinates) self.statusBar().message( 'Mouse movements in the plot canvas are shown in the status bar') # __initTracking() def showCoordinates(self, position): self.statusBar().message( 'x = %+.6g, y = %.6g' % (self.plot.invTransform(Qwt.QwtPlot.xBottom, position.x()), self.plot.invTransform(Qwt.QwtPlot.yLeft, position.y()))) # showCoordinates() def __initZooming(self): """Initialize zooming """ self.zoomer = Qwt.QwtPlotZoomer(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.DragSelection, Qwt.QwtPicker.AlwaysOff, self.plot.canvas()) self.zoomer.setRubberBandPen(qt.QPen(qt.Qt.black)) # __initZooming() def setZoomerMousePattern(self, index): """Set the mouse zoomer pattern. """ if index == 0: pattern = [ Qwt.QwtEventPattern.MousePattern(qt.Qt.LeftButton, qt.Qt.NoButton), Qwt.QwtEventPattern.MousePattern(qt.Qt.MidButton, qt.Qt.NoButton), Qwt.QwtEventPattern.MousePattern(qt.Qt.RightButton, qt.Qt.NoButton), Qwt.QwtEventPattern.MousePattern(qt.Qt.LeftButton, qt.Qt.ShiftButton), Qwt.QwtEventPattern.MousePattern(qt.Qt.MidButton, qt.Qt.ShiftButton), Qwt.QwtEventPattern.MousePattern(qt.Qt.RightButton, qt.Qt.ShiftButton), ] self.zoomer.setMousePattern(pattern) elif index in (1, 2, 3): self.zoomer.initMousePattern(index) else: raise ValueError, 'index must be in (0, 1, 2, 3)' # setZoomerMousePattern() def __initToolBar(self): """Initialize the toolbar """ toolBar = qt.QToolBar(self) qt.QLabel('Bars', toolBar) self.counter = Qwt.QwtCounter(toolBar) self.counter.setRange(0, 10000, 1) self.counter.setNumButtons(3) toolBar.addSeparator() qt.QLabel('Mouse', toolBar) mouseComboBox = qt.QComboBox(toolBar) for name in ('3 buttons (PyQwt)', '1 button', '2 buttons', '3 buttons (Qwt)'): mouseComboBox.insertItem(name) mouseComboBox.setCurrentItem(0) toolBar.addSeparator() self.setZoomerMousePattern(0) qt.QWhatsThis.whatsThisButton(toolBar) qt.QWhatsThis.add( self.plot.canvas(), 'A QwtPlotZoomer lets you zoom infinitely deep ' 'by saving the zoom states on a stack.\n\n' 'You can:\n' '- select a zoom region\n' '- unzoom all\n' '- walk down the stack\n' '- walk up the stack.\n\n' 'The combo box in the toolbar lets you attach ' 'different sets of mouse events to those actions.' ) qt.QWhatsThis.add( self.counter, 'Select the number of bars' ) qt.QWhatsThis.add( mouseComboBox, 'Configure the zoomer mouse buttons.\n\n' '3 buttons (PyQwt style):\n' '- left-click & drag to zoom\n' '- middle-click to unzoom all\n' '- right-click to walk down the stack\n' '- shift-right-click to walk up the stack.\n' '1 button:\n' '- click & drag to zoom\n' '- control-click to unzoom all\n' '- alt-click to walk down the stack\n' '- shift-alt-click to walk up the stack.\n' '2 buttons:\n' '- left-click & drag to zoom\n' '- right-click to unzoom all\n' '- alt-left-click to walk down the stack\n' '- alt-shift-left-click to walk up the stack.\n' '3 buttons (Qwt style):\n' '- left-click & drag to zoom\n' '- right-click to unzoom all\n' '- middle-click to walk down the stack\n' '- shift-middle-click to walk up the stack.\n\n' 'If some of those key combinations interfere with ' 'your Window manager, press the:\n' '- escape-key to unzoom all\n' '- minus-key to walk down the stack\n' '- plus-key to walk up the stack.' ) self.connect(self.counter, qt.SIGNAL('valueChanged(double)'), self.go) self.connect(mouseComboBox, qt.SIGNAL('activated(int)'), self.setZoomerMousePattern) # __initToolBar() def go(self, value): """Create and plot a sequence of bars taking into account the controls """ n = int(value) for bar in self.plot.itemList(): if isinstance(bar, BarCurve): bar.detach() for i in range(n): bar = BarCurve( self.colors[random.randint(0, len(self.colors)-1)], self.colors[random.randint(0, len(self.colors)-1)], ) bar.attach(self.plot) bar.setData([i, i+1.4], [0.3*i, 5.0+0.3*i]) self.clearZoomStack() # go() def clearZoomStack(self): """Auto scale and clear the zoom stack """ self.plot.setAxisAutoScale(Qwt.QwtPlot.xBottom) self.plot.setAxisAutoScale(Qwt.QwtPlot.yLeft) self.plot.replot() self.zoomer.setZoomBase() # clearZoomStack() # class BarPlotMainWindow def make(): demo = BarPlotMainWindow() demo.resize(500, 500) demo.show() return demo # make() def main(args): app = qt.QApplication(args) demo = make() app.setMainWidget(demo) sys.exit(app.exec_loop()) # main() # Admire! if __name__ == '__main__': if 'settracemask' in sys.argv: # for debugging, requires: python configure.py --trace ... import sip sip.settracemask(0x3f) main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/SliderDemo.py0000555000175000017500000001407710512102725020517 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/sliders # for debugging, requires: python configure.py --trace ... if False: import sip sip.settracemask(0x3f) import sys import qt import Qwt5 as Qwt class Layout(qt.QBoxLayout): def __init__(self, orientation, parent=None): qt.QBoxLayout.__init__(self, parent, qt.QBoxLayout.LeftToRight) if orientation == qt.Qt.Vertical: self.setDirection(qt.QBoxLayout.TopToBottom) self.setSpacing(20) self.setMargin(0) # __init__() # class Layout class Slider(qt.QWidget): def __init__(self, parent, sliderType): qt.QWidget.__init__(self, parent) self.slider = self.createSlider(self, sliderType) assert(not self.slider is None) if self.slider.scalePosition() == Qwt.QwtSlider.NoScale: if self.slider.orientation() == qt.Qt.Horizontal: alignment = qt.Qt.AlignHCenter | qt.Qt.AlignTop else: alignment = qt.Qt.AlignVCenter | qt.Qt.AlignLeft elif self.slider.scalePosition() == Qwt.QwtSlider.LeftScale: alignment = qt.Qt.AlignVCenter | qt.Qt.AlignRight elif self.slider.scalePosition() == Qwt.QwtSlider.RightScale: alignment = qt.Qt.AlignVCenter | qt.Qt.AlignLeft elif self.slider.scalePosition() == Qwt.QwtSlider.TopScale: alignment = qt.Qt.AlignHCenter | qt.Qt.AlignBottom elif self.slider.scalePosition() == Qwt.QwtSlider.BottomScale: alignment = qt.Qt.AlignHCenter | qt.Qt.AlignTop self.label = qt.QLabel("0", self) self.label.setAlignment(alignment) self.label.setFixedWidth(self.label.fontMetrics().width('10000.9')) self.connect(self.slider, qt.SIGNAL('valueChanged(double)'), self.setNum) if self.slider.orientation() == qt.Qt.Horizontal: layout = qt.QHBoxLayout(self) else: layout = qt.QVBoxLayout(self) layout.addWidget(self.slider) layout.addWidget(self.label) # __init__ () def createSlider(self, parent, sliderType): if sliderType == 0: slider = Qwt.QwtSlider(parent, qt.Qt.Horizontal, Qwt.QwtSlider.TopScale, Qwt.QwtSlider.BgTrough) slider.setThumbWidth(10) slider.setRange(-10.0, 10.0, 1.0, 0) # paging disabled return slider if sliderType == 1: slider = Qwt.QwtSlider(parent, qt.Qt.Horizontal, Qwt.QwtSlider.NoScale, Qwt.QwtSlider.BgBoth) slider.setRange(0.0, 1.0, 0.01, 5) return slider if sliderType == 2: slider = Qwt.QwtSlider(parent, qt.Qt.Horizontal, Qwt.QwtSlider.BottomScale, Qwt.QwtSlider.BgSlot) slider.setThumbWidth(25) slider.setThumbLength(12) slider.setRange(1000.0, 3000.0, 10.0, 10) return slider if sliderType == 3: slider = Qwt.QwtSlider(parent, qt.Qt.Vertical, Qwt.QwtSlider.LeftScale, Qwt.QwtSlider.BgSlot) slider.setRange(0.0, 100.0, 1.0, 5) slider.setScaleMaxMinor(5) return slider if sliderType == 4: slider = Qwt.QwtSlider(parent, qt.Qt.Vertical, Qwt.QwtSlider.NoScale, Qwt.QwtSlider.BgTrough) slider.setRange(0.0,100.0,1.0, 10) return slider if sliderType == 5: slider = Qwt.QwtSlider(parent, qt.Qt.Vertical, Qwt.QwtSlider.RightScale, Qwt.QwtSlider.BgBoth) slider.setScaleEngine(Qwt.QwtLog10ScaleEngine()) slider.setThumbWidth(20) slider.setBorderWidth(1) slider.setRange(0.0, 4.0, 0.01) slider.setScale(1.0, 1.0e4) slider.setScaleMaxMinor(10) return slider return None # createSlider() def setNum(self, value): if isinstance(self.slider.scaleEngine(), Qwt.QwtLog10ScaleEngine): value = 10.0**value self.label.setText('%s' % value) # setNum() # class(SliderWidget) class SliderDemo(qt.QWidget): def __init__(self, *args): qt.QWidget.__init__(self, *args) hSliderLayout = Layout(qt.Qt.Vertical) for i in (0, 1, 2): hSliderLayout.addWidget(Slider(self, i)) hSliderLayout.addStretch() vSliderLayout = Layout(qt.Qt.Horizontal) for i in (3, 4, 5): vSliderLayout.addWidget(Slider(self, i)) vTitle = qt.QLabel("Vertical Sliders", self) vTitle.setFont(qt.QFont("Helvetica", 14, qt.QFont.Bold)) vTitle.setAlignment(qt.Qt.AlignHCenter) layout1 = Layout(qt.Qt.Vertical) layout1.addWidget(vTitle, 0) layout1.addLayout(vSliderLayout, 10) hTitle = qt.QLabel("Horizontal Sliders", self) hTitle.setFont(vTitle.font()) hTitle.setAlignment(qt.Qt.AlignHCenter) layout2 = Layout(qt.Qt.Vertical) layout2.addWidget(hTitle, 0) layout2.addLayout(hSliderLayout, 10) mainLayout = Layout(qt.Qt.Horizontal, self) mainLayout.addLayout(layout1) mainLayout.addLayout(layout2, 10) # __init__() # class SliderDemo def make(): demo = SliderDemo() demo.show() return demo # make() def main(args): app = qt.QApplication(args) demo = make() app.setMainWidget(demo) sys.exit(app.exec_loop()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/BodeDemo.py0000555000175000017500000003466410462051136020155 0ustar poxpox#!/usr/bin/env python # The Python version of Qwt-5.0.0/examples/bode # To get an impression of the expressive power of Numeric, # compare the Python and C++ versions of setDamp() import sys import qt as Qt import Qwt5 as Qwt from Qwt5.anynumpy import * print_xpm = ['32 32 12 1', 'a c #ffffff', 'h c #ffff00', 'c c #ffffff', 'f c #dcdcdc', 'b c #c0c0c0', 'j c #a0a0a4', 'e c #808080', 'g c #808000', 'd c #585858', 'i c #00ff00', '# c #000000', '. c None', '................................', '................................', '...........###..................', '..........#abb###...............', '.........#aabbbbb###............', '.........#ddaaabbbbb###.........', '........#ddddddaaabbbbb###......', '.......#deffddddddaaabbbbb###...', '......#deaaabbbddddddaaabbbbb###', '.....#deaaaaaaabbbddddddaaabbbb#', '....#deaaabbbaaaa#ddedddfggaaad#', '...#deaaaaaaaaaa#ddeeeeafgggfdd#', '..#deaaabbbaaaa#ddeeeeabbbbgfdd#', '.#deeefaaaaaaa#ddeeeeabbhhbbadd#', '#aabbbeeefaaa#ddeeeeabbbbbbaddd#', '#bbaaabbbeee#ddeeeeabbiibbadddd#', '#bbbbbaaabbbeeeeeeabbbbbbaddddd#', '#bjbbbbbbaaabbbbeabbbbbbadddddd#', '#bjjjjbbbbbbaaaeabbbbbbaddddddd#', '#bjaaajjjbbbbbbaaabbbbadddddddd#', '#bbbbbaaajjjbbbbbbaaaaddddddddd#', '#bjbbbbbbaaajjjbbbbbbddddddddd#.', '#bjjjjbbbbbbaaajjjbbbdddddddd#..', '#bjaaajjjbbbbbbjaajjbddddddd#...', '#bbbbbaaajjjbbbjbbaabdddddd#....', '###bbbbbbaaajjjjbbbbbddddd#.....', '...###bbbbbbaaajbbbbbdddd#......', '......###bbbbbbjbbbbbddd#.......', '.........###bbbbbbbbbdd#........', '............###bbbbbbd#.........', '...............###bbb#..........', '..................###...........'] zoom_xpm = ['32 32 8 1', '# c #000000', 'b c #c0c0c0', 'a c #ffffff', 'e c #585858', 'd c #a0a0a4', 'c c #0000ff', 'f c #00ffff', '. c None', '..######################........', '.#a#baaaaaaaaaaaaaaaaaa#........', '#aa#baaaaaaaaaaaaaccaca#........', '####baaaaaaaaaaaaaaaaca####.....', '#bbbbaaaaaaaaaaaacccaaa#da#.....', '#aaaaaaaaaaaaaaaacccaca#da#.....', '#aaaaaaaaaaaaaaaaaccaca#da#.....', '#aaaaaaaaaabe###ebaaaaa#da#.....', '#aaaaaaaaa#########aaaa#da#.....', '#aaaaaaaa###dbbbb###aaa#da#.....', '#aaaaaaa###aaaaffb###aa#da#.....', '#aaaaaab##aaccaaafb##ba#da#.....', '#aaaaaae#daaccaccaad#ea#da#.....', '#aaaaaa##aaaaaaccaab##a#da#.....', '#aaaaaa##aacccaaaaab##a#da#.....', '#aaaaaa##aaccccaccab##a#da#.....', '#aaaaaae#daccccaccad#ea#da#.....', '#aaaaaab##aacccaaaa##da#da#.....', '#aaccacd###aaaaaaa###da#da#.....', '#aaaaacad###daaad#####a#da#.....', '#acccaaaad##########da##da#.....', '#acccacaaadde###edd#eda#da#.....', '#aaccacaaaabdddddbdd#eda#a#.....', '#aaaaaaaaaaaaaaaaaadd#eda##.....', '#aaaaaaaaaaaaaaaaaaadd#eda#.....', '#aaaaaaaccacaaaaaaaaadd#eda#....', '#aaaaaaaaaacaaaaaaaaaad##eda#...', '#aaaaaacccaaaaaaaaaaaaa#d#eda#..', '########################dd#eda#.', '...#dddddddddddddddddddddd##eda#', '...#aaaaaaaaaaaaaaaaaaaaaa#.####', '...########################..##.'] class PrintFilter(Qwt.QwtPlotPrintFilter): def __init__(self): Qwt.QwtPlotPrintFilter.__init__(self) # __init___() def color(self, c, item, i): if not (self.options() & Qwt.QwtPlotPrintFilter.PrintCanvasBackground): if item == Qwt.QwtPlotPrintFilter.MajorGrid: return Qt.Qt.darkGray elif item == Qwt.QwtPlotPrintFilter.MinorGrid: return Qt.Qt.gray if item == Qwt.QwtPlotPrintFilter.Title: return Qt.Qt.red elif item == Qwt.QwtPlotPrintFilter.AxisScale: return Qt.Qt.green elif item == Qwt.QwtPlotPrintFilter.AxisTitle: return Qt.Qt.blue return c # color() def font(self, f, item, i): result = Qt.QFont(f) result.setPointSize(int(f.pointSize()*1.25)) return result # font() # class PrintFilter class BodePlot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) self.setTitle('Frequency Response of a 2nd-order System') self.setCanvasBackground(Qt.Qt.darkBlue) # legend legend = Qwt.QwtLegend() legend.setFrameStyle(Qt.QFrame.Box | Qt.QFrame.Sunken) legend.setItemMode(Qwt.QwtLegend.ClickableItem) self.insertLegend(legend, Qwt.QwtPlot.BottomLegend) # grid self.grid = Qwt.QwtPlotGrid() self.grid.enableXMin(True) self.grid.setMajPen(Qt.QPen(Qt.Qt.white, 0, Qt.Qt.DotLine)) self.grid.setMinPen(Qt.QPen(Qt.Qt.gray, 0 , Qt.Qt.DotLine)) self.grid.attach(self) # axes self.enableAxis(Qwt.QwtPlot.yRight) self.setAxisTitle(Qwt.QwtPlot.xBottom, u'\u03c9/\u03c90') self.setAxisTitle(Qwt.QwtPlot.yLeft, 'Amplitude [dB]') self.setAxisTitle(Qwt.QwtPlot.yRight, u'Phase [\u00b0]') self.setAxisMaxMajor(Qwt.QwtPlot.xBottom, 6) self.setAxisMaxMinor(Qwt.QwtPlot.xBottom, 10) self.setAxisScaleEngine(Qwt.QwtPlot.xBottom, Qwt.QwtLog10ScaleEngine()) # curves self.curve1 = Qwt.QwtPlotCurve('Amplitude') self.curve1.setPen(Qt.QPen(Qt.Qt.yellow)) self.curve1.setYAxis(Qwt.QwtPlot.yLeft) self.curve1.attach(self) self.curve2 = Qwt.QwtPlotCurve('Phase') self.curve2.setPen(Qt.QPen(Qt.Qt.cyan)) self.curve2.setYAxis(Qwt.QwtPlot.yRight) self.curve2.attach(self) # alias fn = self.fontInfo().family() # marker self.dB3Marker = m = Qwt.QwtPlotMarker() m.setValue(0.0, 0.0) m.setLineStyle(Qwt.QwtPlotMarker.VLine) m.setLabelAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignBottom) m.setLinePen(Qt.QPen(Qt.Qt.green, 2, Qt.Qt.DashDotLine)) text = Qwt.QwtText('') text.setColor(Qt.Qt.green) text.setBackgroundBrush(Qt.QBrush(Qt.Qt.red)) text.setFont(Qt.QFont(fn, 12, Qt.QFont.Bold)) m.setLabel(text) m.attach(self) self.peakMarker = m = Qwt.QwtPlotMarker() m.setLineStyle(Qwt.QwtPlotMarker.HLine) m.setLabelAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignBottom) m.setLinePen(Qt.QPen(Qt.Qt.red, 2, Qt.Qt.DashDotLine)) text = Qwt.QwtText('') text.setColor(Qt.Qt.red) text.setBackgroundBrush(Qt.QBrush(self.canvasBackground())) text.setFont(Qt.QFont(fn, 12, Qt.QFont.Bold)) m.setLabel(text) m.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Diamond, Qt.QBrush(Qt.Qt.yellow), Qt.QPen(Qt.Qt.green), Qt.QSize(7,7))) m.attach(self) # text marker m = Qwt.QwtPlotMarker() m.setValue(0.1, -20.0) m.setLabelAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignBottom) text = Qwt.QwtText( u'[1-(\u03c9/\u03c90)2+2j\u03c9/Q]' '-1' ) text.setFont(Qt.QFont(fn, 12, Qt.QFont.Bold)) text.setColor(Qt.Qt.blue) text.setBackgroundBrush(Qt.QBrush(Qt.Qt.yellow)) text.setBackgroundPen(Qt.QPen(Qt.Qt.red, 2)) m.setLabel(text) m.attach(self) self.setDamp(0.01) # __init__() def showData(self, frequency, amplitude, phase): self.curve1.setData(frequency, amplitude) self.curve2.setData(frequency, phase) # showData() def showPeak(self, frequency, amplitude): self.peakMarker.setValue(frequency, amplitude) label = self.peakMarker.label() label.setText('Peak: %4g dB' % amplitude) self.peakMarker.setLabel(label) # showPeak() def show3dB(self, frequency): self.dB3Marker.setValue(frequency, 0.0) label = self.dB3Marker.label() label.setText('-3dB at f = %4g' % frequency) self.dB3Marker.setLabel(label) # show3dB() def setDamp(self, d): self.damping = d # Numerical Python: f, g, a and p are numpy arrays! f = exp(log(10.0)*arange(-2, 2.02, 0.04)) g = 1.0/(1.0-f*f+2j*self.damping*f) a = 20.0*log10(abs(g)) p = 180*arctan2(g.imag, g.real)/pi # for show3dB i3 = argmax(where(less(a, -3.0), a, -100.0)) f3 = f[i3] - (a[i3]+3.0)*(f[i3]-f[i3-1])/(a[i3]-a[i3-1]) # for showPeak imax = argmax(a) self.showPeak(f[imax], a[imax]) self.show3dB(f3) self.showData(f, a, p) self.replot() # setDamp() # class BodePlot class BodeDemo(Qt.QMainWindow): def __init__(self, *args): Qt.QMainWindow.__init__(self, *args) self.plot = BodePlot(self) self.plot.setMargin(5) self.zoomers = [] zoomer = Qwt.QwtPlotZoomer( Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.DragSelection, Qwt.QwtPicker.AlwaysOff, self.plot.canvas()) zoomer.setRubberBandPen(Qt.QPen(Qt.Qt.green)) self.zoomers.append(zoomer) zoomer = Qwt.QwtPlotZoomer( Qwt.QwtPlot.xTop, Qwt.QwtPlot.yRight, Qwt.QwtPicker.PointSelection | Qwt.QwtPicker.DragSelection, Qwt.QwtPicker.AlwaysOff, self.plot.canvas()) zoomer.setRubberBand(Qwt.QwtPicker.NoRubberBand) self.zoomers.append(zoomer) self.picker = Qwt.QwtPlotPicker( Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.PointSelection | Qwt.QwtPicker.DragSelection, Qwt.QwtPlotPicker.CrossRubberBand, Qwt.QwtPicker.AlwaysOn, self.plot.canvas()) self.picker.setRubberBandPen(Qt.QPen(Qt.Qt.green)) self.picker.setTrackerPen(Qt.QPen(Qt.Qt.cyan)) self.setCentralWidget(self.plot) toolBar = Qt.QToolBar(self) btnZoom = Qt.QToolButton(toolBar) btnZoom.setTextLabel("Zoom") btnZoom.setPixmap(Qt.QPixmap(zoom_xpm)) btnZoom.setToggleButton(True) btnZoom.setUsesTextLabel(True) btnPrint = Qt.QToolButton(toolBar) btnPrint.setTextLabel("Print") btnPrint.setPixmap(Qt.QPixmap(print_xpm)) btnPrint.setUsesTextLabel(True) toolBar.addSeparator() dampBox = Qt.QWidget(toolBar) dampLayout = Qt.QHBoxLayout(dampBox) dampLayout.setSpacing(0) dampLayout.addWidget(Qt.QWidget(dampBox), 10) # spacer dampLayout.addWidget(Qt.QLabel("Damping Factor", dampBox), 0) dampLayout.addSpacing(10) self.cntDamp = Qwt.QwtCounter(dampBox) self.cntDamp.setRange(0.01, 5.0, 0.01) self.cntDamp.setValue(0.01) dampLayout.addWidget(self.cntDamp, 10) toolBar.setStretchableWidget(dampBox) self.statusBar() self.zoom(False) self.showInfo() self.connect( self.cntDamp, Qt.SIGNAL('valueChanged(double)'), self.plot.setDamp) self.connect( btnPrint, Qt.SIGNAL('clicked()'), self.print_) self.connect( btnZoom, Qt.SIGNAL('toggled(bool)'), self.zoom) self.connect( self.picker, Qt.SIGNAL('moved(const QPoint &)'), self.moved) self.connect( self.picker, Qt.SIGNAL('selected(const QwtPolygon &)'), self.selected) # __init__() def print_(self): printer = Qt.QPrinter(Qt.QPrinter.HighResolution) #docName = self.plot.title.text(). printer.setOrientation(Qt.QPrinter.Landscape) printer.setColorMode(Qt.QPrinter.Color) printer.setOutputToFile(True) printer.setOutputFileName('bode-example-%s.ps' % Qt.qVersion()) if printer.setup(): filter = PrintFilter() if (Qt.QPrinter.GrayScale == printer.colorMode()): filter.setOptions( Qwt.QwtPlotPrintFilter.PrintAll & ~Qwt.QwtPlotPrintFilter.PrintCanvasBackground) self.plot.print_(printer, filter) # print_() def zoom(self, on): self.zoomers[0].setEnabled(on) self.zoomers[0].zoom(0) self.zoomers[1].setEnabled(on) self.zoomers[1].zoom(0) if on: self.picker.setRubberBand(Qwt.QwtPicker.NoRubberBand) else: self.picker.setRubberBand(Qwt.QwtPicker.CrossRubberBand) self.showInfo() # zoom() def showInfo(self, text=None): if not text: if self.picker.rubberBand(): text = 'Cursor Pos: Press left mouse button in plot region' else: text = 'Zoom: Press mouse button and drag' self.statusBar().message(text) # showInfo() def moved(self, point): info = "Freq=%g, Ampl=%g, Phase=%g" % ( self.plot.invTransform(Qwt.QwtPlot.xBottom, point.x()), self.plot.invTransform(Qwt.QwtPlot.yLeft, point.y()), self.plot.invTransform(Qwt.QwtPlot.yRight, point.y())) self.showInfo(info) # moved() def selected(self, points): self.showInfo() # selected() # class BodeDemo def make(): demo = BodeDemo() demo.resize(540, 400) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) fonts = Qt.QFontDatabase() if Qt.QString('Verdana') in fonts.families(): app.setFont(Qt.QFont('Verdana')) demo = make() app.setMainWidget(demo) sys.exit(app.exec_loop()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/RadioDemo.py0000555000175000017500000002033210512102725020322 0ustar poxpox#!/usr/bin/env python # The Python version of Qwt-5.0.0/examples/radio # for debugging, requires; python configure.py --trace ... if False: import sip sip.settracemask(0x3f) import sys import qt import Qwt5 as Qwt from math import * #-- tunerfrm.cpp --# class TuningThermo(qt.QWidget): def __init__(self, *args): qt.QWidget.__init__(self, *args) self.thermo = Qwt.QwtThermo(self) self.thermo.setOrientation(qt.Qt.Horizontal, Qwt.QwtThermo.NoScale) self.thermo.setRange(0.0, 1.0) self.thermo.setFillColor(qt.Qt.green) label = qt.QLabel("Tuning", self) label.setAlignment(qt.Qt.AlignCenter) layout = qt.QVBoxLayout(self) layout.setMargin(0) layout.addWidget(self.thermo) layout.addWidget(label) self.setFixedWidth(3*label.sizeHint().width()) # __init__() def setValue(self, value): self.thermo.setValue(value) # setValue() # class TuningThermo class TunerFrame(qt.QFrame): def __init__(self, *args): qt.QFrame.__init__(self, *args) self.frequencySlider = Qwt.QwtSlider( self, qt.Qt.Horizontal, Qwt.QwtSlider.TopScale) self.frequencySlider.setScaleMaxMinor(5) self.frequencySlider.setScaleMaxMajor(12) self.frequencySlider.setThumbLength(80) self.frequencySlider.setBorderWidth(1) self.frequencySlider.setRange(87.5, 108, 0.01, 10) self.tuningThermo = TuningThermo(self) self.frequencyWheel = Qwt.QwtWheel(self) self.frequencyWheel.setMass(0.5) self.frequencyWheel.setRange(87.5, 108, 0.01) self.frequencyWheel.setTotalAngle(3600.0) self.connect(self.frequencyWheel, qt.SIGNAL("valueChanged(double)"), self.adjustFreq) self.connect(self.frequencySlider, qt.SIGNAL("valueChanged(double)"), self.adjustFreq) mainLayout = qt.QVBoxLayout(self) mainLayout.setMargin(10) mainLayout.setSpacing(5) mainLayout.addWidget(self.frequencySlider) hLayout = qt.QHBoxLayout() hLayout.setMargin(0) hLayout.addWidget(self.tuningThermo, 0) hLayout.addStretch(5) hLayout.addWidget(self.frequencyWheel, 2) mainLayout.addLayout(hLayout) # __init__() def adjustFreq(self, f): factor = 13.0 / (108 - 87.5) x = (f - 87.5) * factor field = (sin(x) * cos(4.0 * x))**2 self.tuningThermo.setValue(field) if self.frequencySlider.value() != f: self.frequencySlider.setValue(f) if self.frequencyWheel.value() != f: self.frequencyWheel.setValue(f) self.emit(qt.PYSIGNAL('fieldChanged(double)'), (field,)) # adjustFreq() def setFreq(self, f): self.frequencyWheel.setValue(f) # setFreq() # class TunerFrame #-- ampfrm.cpp --# class Knob(qt.QWidget): def __init__(self, title, min, max, parent): qt.QWidget.__init__(self, parent) self.knob = Qwt.QwtKnob(self) self.knob.setRange(min, max, 0, 1) self.knob.setScaleMaxMajor(10) self.knob.setKnobWidth(50) self.label = qt.QLabel(title, self) self.label.setAlignment(qt.Qt.AlignTop | qt.Qt.AlignHCenter) self.setSizePolicy(qt.QSizePolicy.MinimumExpanding, qt.QSizePolicy.MinimumExpanding) # __init__() def sizeHint(self): sz1 = self.knob.sizeHint() sz2 = self.label.sizeHint() w = max(sz1.width(), sz2.width()) h = sz1.height() + sz2.height() off = self.knob.scaleDraw().extent(qt.QPen(), self.knob.font()) off -= 10 # spacing return qt.QSize(w, h - off) # sizeHint() def value(self): return self.knob.value() # value() def resizeEvent(self, event): sz = event.size() h = self.label.sizeHint().height() self.label.setGeometry(0, sz.height() - h, sz.width(), h) h = self.knob.sizeHint().height() off = self.knob.scaleDraw().extent(qt.QPen(), self.knob.font()) off -= 10 # spacing self.knob.setGeometry(0, self.label.pos().y() - h + off, sz.width(), h) # resizeEvent() # class Knob class Thermo(qt.QWidget): def __init__(self, title, parent): qt.QWidget.__init__(self, parent) self.thermo = Qwt.QwtThermo(self) self.thermo.setPipeWidth(6) self.thermo.setRange(-40, 10) self.thermo.setFillColor(qt.Qt.green) self.thermo.setAlarmColor(qt.Qt.red) self.thermo.setAlarmLevel(0.0) self.thermo.setAlarmEnabled(True) label = qt.QLabel(title, self) label.setAlignment(qt.Qt.AlignTop | qt.Qt.AlignLeft) layout = qt.QVBoxLayout(self) layout.setMargin(0) layout.setSpacing(0) layout.addWidget(self.thermo, 10) layout.addWidget(label) # __init__() def setValue(self, value): self.thermo.setValue(value) # setValue() # class Thermo class AmplifierFrame(qt.QFrame): def __init__(self, *args): qt.QFrame.__init__(self, *args) self.phs = 0.0 self.master = 0.0 self.volumeKnob = Knob('Volume', 0.0, 10.0, self) self.balanceKnob = Knob('Balance', -10.0, 10.0, self) self.trebleKnob = Knob('Treble', -10.0, 10.0, self) self.bassKnob = Knob('Bass', -10.0, 10.0, self) self.leftThermo = Thermo('Left [dB]', self) self.rightThermo = Thermo('Right [dB]', self) layout = qt.QHBoxLayout(self) layout.setSpacing(0) layout.setMargin(10) layout.addWidget(self.volumeKnob) layout.addWidget(self.balanceKnob) layout.addWidget(self.trebleKnob) layout.addWidget(self.bassKnob) layout.addSpacing(20) layout.addStretch(10) layout.addWidget(self.leftThermo) layout.addSpacing(10) layout.addWidget(self.rightThermo) self.startTimer(50) # __init__() def timerEvent(self, event): sig_bass = (1.0 + 0.1*self.bassKnob.value()) * sin(13.0*self.phs) sig_mid_l = sin(17.0*self.phs) sig_mid_r = cos(17.5*self.phs) sig_trbl_l = 0.5*(1.0+0.1*self.trebleKnob.value()) * sin(35.0*self.phs) sig_trbl_r = 0.5*(1.0+0.1*self.trebleKnob.value()) * sin(34.0*self.phs) sig_l = 0.05*self.master*self.volumeKnob.value() * \ (sig_bass+sig_mid_l+sig_trbl_l)**2 sig_r = 0.05*self.master*self.volumeKnob.value() * \ (sig_bass+sig_mid_r+sig_trbl_r)**2 balance = 0.1 * self.balanceKnob.value() if balance > 0: sig_l *= (1.0 - balance) else: sig_r *= (1.0 + balance) if sig_l > 0.01: sig_l = 20.0 * log10(sig_l) else: sig_l = -40.0 if sig_r > 0.01: sig_r = 20.0 * log10(sig_r) else: sig_r = - 40.0 self.leftThermo.setValue(sig_l) self.rightThermo.setValue(sig_r) self.phs += pi / 100 if self.phs > pi: self.phs = 0 # timerEvent() def setMaster(self, value): self.master = value # setMaster() # class AmplifierFrame #-- radio.cpp --# class RadioDemo(qt.QWidget): def __init__(self, *args): qt.QWidget.__init__(self, *args) tunerFrame = TunerFrame(self) tunerFrame.setFrameStyle(qt.QFrame.Panel | qt.QFrame.Raised) amplifierFrame = AmplifierFrame(self) amplifierFrame.setFrameStyle(qt.QFrame.Panel | qt.QFrame.Raised) layout = qt.QVBoxLayout(self) layout.setMargin(0) layout.setSpacing(0) layout.addWidget(tunerFrame) layout.addWidget(amplifierFrame) self.connect(tunerFrame, qt.PYSIGNAL("fieldChanged(double)"), amplifierFrame.setMaster) tunerFrame.setFreq(90.0) # __init__() # class RadioDemo def make(): demo = RadioDemo() demo.show() return demo # make() def main(args): app = qt.QApplication(args) demo = make() app.setMainWidget(demo) sys.exit(app.exec_loop()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/Grab.py0000555000175000017500000000242610434023557017346 0ustar poxpox#!/usr/bin/env python try: import Qwt5.iqt except ImportError: raise SystemExit, 'Grab.py requires the Qwt5.iqt module' from qt import QPixmap # a list of .py files defining a function make() # make() must initialize, show and return: # a QWidget # or: # a tuple of QWidgets jobs = [ 'BarPlotDemo', 'BodeDemo', # 'CPUplot', 'CliDemo', 'CurveDemo1', # 'CurveDemo2', # 'CurveDemo3', # 'DataDemo', # 'DialDemo', 'ErrorBarDemo', # 'EventFilterDemo', 'ImagePlotDemo', 'MapDemo', 'MultiDemo', 'RadioDemo', 'ReallySimpleDemo', 'SimpleDemo', 'SliderDemo', ] def expose(jobs, cache = {}): for job in jobs: result = __import__(job).make() if type(result) == type(()): for i in range(len(result)): cache['%s%s' % (job, i)] = result[i] else: cache[job] = result return cache # expose() def save(cache): for name, widget in cache.items(): pixmap = QPixmap.grabWidget(widget) pixmap.save(name+'.png', 'PNG') # save() def main(): cache = expose(jobs) raw_input("Are all widgets looking HAPPY? ") save(cache) # main() if __name__ == '__main__': main() # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/SimpleDemo.py0000555000175000017500000000473310434023557020534 0ustar poxpox#!/usr/bin/env python # The Python version of Qwt-5.0.0/examples/simple # for debugging, requires: python configure.py --trace ... if False: import sip sip.settracemask(0x3f) import math import sys import qt import Qwt5 as Qwt class SimpleData(Qwt.QwtData): def __init__(self, function, size): Qwt.QwtData.__init__(self) self.__function = function self.__size = size def copy(self): return self def size(self): return self.__size def x(self, i): return 0.1*i def y(self, i): return self.__function(self.x(i)) # class SimpleData class SimplePlot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) # make a QwtPlot widget self.setTitle('SimpleDemo.py') self.insertLegend(Qwt.QwtLegend(), Qwt.QwtPlot.RightLegend) # a variation on the C++ example self.plotLayout().setAlignCanvasToScales(True) grid = Qwt.QwtPlotGrid() grid.attach(self) grid.setPen(qt.QPen(qt.Qt.black, 0, qt.Qt.DotLine)) # set axis titles self.setAxisTitle(Qwt.QwtPlot.xBottom, 'x -->') self.setAxisTitle(Qwt.QwtPlot.yLeft, 'y -->') # insert a few curves cSin = Qwt.QwtPlotCurve('y = sin(x)') cSin.setPen(qt.QPen(qt.Qt.red)) cSin.attach(self) cCos = Qwt.QwtPlotCurve('y = cos(x)') cCos.setPen(qt.QPen(qt.Qt.blue)) cCos.attach(self) # initialize the data cSin.setData(SimpleData(math.sin, 100)) cCos.setData(SimpleData(math.cos, 100)) # insert a horizontal marker at y = 0 mY = Qwt.QwtPlotMarker() mY.setLabel(Qwt.QwtText('y = 0')) mY.setLabelAlignment(qt.Qt.AlignRight | qt.Qt.AlignTop) mY.setLineStyle(Qwt.QwtPlotMarker.HLine) mY.setYValue(0.0) mY.attach(self) # insert a vertical marker at x = 2 pi mX = Qwt.QwtPlotMarker() mX.setLabel(Qwt.QwtText('x = 2 pi')) mX.setLabelAlignment(qt.Qt.AlignRight | qt.Qt.AlignTop) mX.setLineStyle(Qwt.QwtPlotMarker.VLine) mX.setXValue(2*math.pi) mX.attach(self) # replot self.replot() # __init__() # class Plot def make(): demo = SimplePlot() demo.resize(500, 300) demo.show() return demo # make() def main(args): app = qt.QApplication(args) demo = make() app.setMainWidget(demo) sys.exit(app.exec_loop()) # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/ReallySimpleDemo.py0000555000175000017500000000372510434023557021705 0ustar poxpox#!/usr/bin/env python # The really simple Python version of Qwt-5.0.0/examples/simple # for debugging, requires: python configure.py --trace ... if False: import sip sip.settracemask(0x3f) import sys import qt import Qwt5 as Qwt from Qwt5.anynumpy import * class SimplePlot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) # make a QwtPlot widget self.setTitle('ReallySimpleDemo.py') self.insertLegend(Qwt.QwtLegend(), Qwt.QwtPlot.RightLegend) # set axis titles self.setAxisTitle(Qwt.QwtPlot.xBottom, 'x -->') self.setAxisTitle(Qwt.QwtPlot.yLeft, 'y -->') # insert a few curves cSin = Qwt.QwtPlotCurve('y = sin(x)') cSin.setPen(qt.QPen(qt.Qt.red)) cSin.attach(self) cCos = Qwt.QwtPlotCurve('y = cos(x)') cCos.setPen(qt.QPen(qt.Qt.blue)) cCos.attach(self) # make a Numeric array for the horizontal data x = arange(0.0, 10.0, 0.1) # initialize the data cSin.setData(x, sin(x)) cCos.setData(x, cos(x)) # insert a horizontal marker at y = 0 mY = Qwt.QwtPlotMarker() mY.setLabel(Qwt.QwtText('y = 0')) mY.setLabelAlignment(qt.Qt.AlignRight | qt.Qt.AlignTop) mY.setLineStyle(Qwt.QwtPlotMarker.HLine) mY.setYValue(0.0) mY.attach(self) # insert a vertical marker at x = 2 pi mX = Qwt.QwtPlotMarker() mX.setLabel(Qwt.QwtText('x = 2 pi')) mX.setLabelAlignment(qt.Qt.AlignRight | qt.Qt.AlignTop) mX.setLineStyle(Qwt.QwtPlotMarker.VLine) mX.setXValue(2*pi) mX.attach(self) # replot self.replot() # __init__() # class Plot def make(): demo = SimplePlot() demo.resize(500, 300) demo.show() return demo # make() def main(args): app = qt.QApplication(args) demo = make() app.setMainWidget(demo) sys.exit(app.exec_loop()) # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/PyFontify.py0000444000175000017500000001071510434023557020417 0ustar poxpox"""Module to analyze Python source code; for syntax coloring tools. Interface: tags = fontify(pytext, searchfrom, searchto) The 'pytext' argument is a string containing Python source code. The (optional) arguments 'searchfrom' and 'searchto' may contain a slice in pytext. The returned value is a list of tuples, formatted like this: [('keyword', 0, 6, None), ('keyword', 11, 17, None), ('comment', 23, 53, None), etc. ] The tuple contents are always like this: (tag, startindex, endindex, sublist) tag is one of 'keyword', 'string', 'comment' or 'identifier' sublist is not used, hence always None. """ # Based on FontText.py by Mitchell S. Chapman, # which was modified by Zachary Roadhouse, # then un-Tk'd by Just van Rossum. # Many thanks for regular expression debugging & authoring are due to: # Tim (the-incredib-ly y'rs) Peters and Cristian Tismer # So, who owns the copyright? ;-) How about this: # Copyright 1996-2001: # Mitchell S. Chapman, # Zachary Roadhouse, # Tim Peters, # Just van Rossum # Changes by Gerard Vermeulen: # - version 0.5 # - use keyword.kwlist # - replace string module by str methods __version__ = "0.5" import keyword import string import re # First a little helper, since I don't like to repeat things. (Tismer speaking) def replace(where, what, with): return with.join(where.split(what)) # Build up a regular expression which will match anything # interesting, including multi-line triple-quoted strings. commentPat = r"#[^\n]*" pat = r"q[^\\q\n]*(\\[\000-\377][^\\q\n]*)*q" quotePat = replace(pat, "q", "'") + "|" + replace(pat, 'q', '"') # Way to go, Tim! pat = r""" qqq [^\\q]* ( ( \\[\000-\377] | q ( \\[\000-\377] | [^\q] | q ( \\[\000-\377] | [^\\q] ) ) ) [^\\q]* )* qqq """ pat = ''.join(pat.split()) # get rid of whitespace tripleQuotePat = replace(pat, "q", "'") + "|" + replace(pat, 'q', '"') # Build up a regular expression which matches all and only # Python keywords. This will let us skip the uninteresting # identifier references. # nonKeyPat identifies characters which may legally precede # a keyword pattern. nonKeyPat = r"(^|[^a-zA-Z0-9_.\"'])" keyPat = nonKeyPat + "(" + string.join(keyword.kwlist, "|") + ")" + nonKeyPat matchPat = commentPat + "|" + keyPat + "|" + tripleQuotePat + "|" + quotePat matchRE = re.compile(matchPat) idKeyPat = "[ \t]*[A-Za-z_][A-Za-z_0-9.]*" # Ident w. leading whitespace. idRE = re.compile(idKeyPat) def fontify(pytext, searchfrom = 0, searchto = None): if searchto is None: searchto = len(pytext) # Cache a few attributes for quicker reference. search = matchRE.search idSearch = idRE.search tags = [] tags_append = tags.append commentTag = 'comment' stringTag = 'string' keywordTag = 'keyword' identifierTag = 'identifier' start = 0 end = searchfrom while 1: m = search(pytext, end) if m is None: break # EXIT LOOP start = m.start() if start >= searchto: break # EXIT LOOP match = m.group(0) end = start + len(match) c = match[0] if c not in "#'\"": # Must have matched a keyword. if start <> searchfrom: # there's still a redundant char before and after it, strip! match = match[1:-1] start = start + 1 else: # this is the first keyword in the text. # Only a space at the end. match = match[:-1] end = end - 1 tags_append((keywordTag, start, end, None)) # If this was a defining keyword, look ahead to the # following identifier. if match in ["def", "class"]: m = idSearch(pytext, end) if m is not None: start = m.start() if start == end: match = m.group(0) end = start + len(match) tags_append((identifierTag, start, end, None)) elif c == "#": tags_append((commentTag, start, end, None)) else: tags_append((stringTag, start, end, None)) return tags def test(path): f = open(path) text = f.read() f.close() tags = fontify(text) for tag, start, end, sublist in tags: print tag, `text[start:end]` pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/MultiDemo.py0000555000175000017500000001241710652115106020365 0ustar poxpox#!/usr/bin/env python # Plot of scipy-, Numeric-, numarray-arrays and lists of Python floats. # for debugging, requires: python configure.py --trace ... if False: import sip sip.settracemask(0x3f) import sys import qt import Qwt5 as Qwt def drange(start, stop, step): start, stop, step = float(start), float(stop), float(step) size = int(round((stop-start)/step)) result = [start]*size for i in xrange(size): result[i] += i*step return result # drange() def lorentzian(x): return 1.0/(1.0+(x-5.0)**2) # lorentzian() class MultiDemo(qt.QWidget): def __init__(self, *args): qt.QWidget.__init__(self, *args) layout = qt.QGridLayout(self) # try to create a plot for SciPy arrays try: # import does_not_exist import numpy # make a curve and copy the data numpy_curve = Qwt.QwtPlotCurve('y = lorentzian(x)') x = numpy.arange(0.0, 10.0, 0.01) y = lorentzian(x) numpy_curve.setData(x, y) # here, we know we can plot NumPy arrays numpy_plot = Qwt.QwtPlot(self) numpy_plot.setTitle('numpy array') numpy_plot.setCanvasBackground(qt.Qt.white) numpy_plot.plotLayout().setCanvasMargin(0) numpy_plot.plotLayout().setAlignCanvasToScales(True) # insert a curve and make it red numpy_curve.attach(numpy_plot) numpy_curve.setPen(qt.QPen(qt.Qt.red)) layout.addWidget(numpy_plot, 0, 0) numpy_plot.replot() except ImportError, message: print "%s: %s" % (ImportError, message) print "Install NumPy to plot NumPy arrays" except TypeError, message: print "%s: %s" % (TypeError, message) print "Rebuild PyQwt to plot NumPy arrays" # try to create a plot for Numeric arrays try: # import does_not_exist import Numeric # make a curve and copy the data numeric_curve = Qwt.QwtPlotCurve('y = lorentzian(x)') x = Numeric.arange(0.0, 10.0, 0.01) y = lorentzian(x) numeric_curve.setData(x, y) # here, we know we can plot Numeric arrays numeric_plot = Qwt.QwtPlot(self) numeric_plot.setTitle('Numeric array') numeric_plot.setCanvasBackground(qt.Qt.white) numeric_plot.plotLayout().setCanvasMargin(0) numeric_plot.plotLayout().setAlignCanvasToScales(True) # insert a curve and it red numeric_curve.attach(numeric_plot) numeric_curve.setPen(qt.QPen(qt.Qt.red)) layout.addWidget(numeric_plot, 0, 1) numeric_plot.replot() except ImportError, message: print "%s: %s" % (ImportError, message) print "Install Numeric to plot Numeric arrays" except TypeError, message: print "%s: %s" % (TypeError, message) print "Rebuild PyQwt to plot Numeric arrays" # try to create a plot for numarray arrays try: # import does_not_exist import numarray # make a curve and copy the data numarray_curve = Qwt.QwtPlotCurve('y = lorentzian(x)') x = numarray.arange(0.0, 10.0, 0.01) y = lorentzian(x) numarray_curve.setData(x, y) # here, we know we can plot numarray arrays numarray_plot = Qwt.QwtPlot(self) numarray_plot.setTitle('numarray array') numarray_plot.setCanvasBackground(qt.Qt.white) numarray_plot.plotLayout().setCanvasMargin(0) numarray_plot.plotLayout().setAlignCanvasToScales(True) # insert a curve and make it red numarray_curve.attach(numarray_plot) numarray_curve.setPen(qt.QPen(qt.Qt.red)) layout.addWidget(numarray_plot, 1, 0) numarray_plot.replot() except ImportError, message: print "%s: %s" % (ImportError, message) print "Install numarray to plot numarray arrays" except TypeError, message: print "%s: %s" % (TypeError, message) print "Rebuild PyQwt to plot numarray arrays" # create a plot widget for lists of Python floats list_plot = Qwt.QwtPlot(self) list_plot.setTitle('Python list') list_plot.setCanvasBackground(qt.Qt.white) list_plot.plotLayout().setCanvasMargin(0) list_plot.plotLayout().setAlignCanvasToScales(True) x = drange(0.0, 10.0, 0.01) y = map(lorentzian, x) # insert a curve, make it red and copy the lists list_curve = Qwt.QwtPlotCurve('y = lorentzian(x)') list_curve.attach(list_plot) list_curve.setPen(qt.QPen(qt.Qt.red)) list_curve.setData(x, y) layout.addWidget(list_plot, 1, 1) list_plot.replot() # __init__() # class MultiDemo def main(args): app = qt.QApplication(args) demo = make() app.setMainWidget(demo) sys.exit(app.exec_loop()) # main() def make(): demo = MultiDemo() demo.resize(400, 600) demo.show() return demo # make() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/ImagePlotDemo.py0000555000175000017500000001530110720074617021156 0ustar poxpox#!/usr/bin/env python # for debugging, requires: python configure.py --trace ... if False: import sip sip.settracemask(0x3f) import sys import qt import Qwt5 as Qwt from Qwt5.anynumpy import * # from scipy.pilutil def bytescale(data, cmin=None, cmax=None, high=255, low=0): if ((hasattr(data, 'dtype') and data.dtype.char == UInt8) or (hasattr(data, 'typecode') and data.typecode == UInt8) ): return data high = high - low if cmin is None: cmin = min(ravel(data)) if cmax is None: cmax = max(ravel(data)) scale = high * 1.0 / (cmax-cmin or 1) bytedata = ((data*1.0-cmin)*scale + 0.4999).astype(UInt8) return bytedata + asarray(low).astype(UInt8) # bytescale() def linearX(nx, ny): return repeat(arange(nx, typecode = Float32)[:, NewAxis], ny, -1) # linearX() def linearY(nx, ny): return repeat(arange(ny, typecode = Float32)[NewAxis, :], nx, 0) # linearY() def square(n, min, max): t = arange(min, max, float(max-min)/(n-1)) #return outer(cos(t), sin(t)) return cos(t)*sin(t)[:,NewAxis] # square() class PlotImage(Qwt.QwtPlotItem): def __init__(self, title = Qwt.QwtText()): Qwt.QwtPlotItem.__init__(self) if not isinstance(title, Qwt.QwtText): self.title = Qwt.QwtText(str(title)) else: self.title = title self.setItemAttribute(Qwt.QwtPlotItem.Legend); self.xyzs = None # __init__() def setData(self, xyzs, xRange = None, yRange = None): self.xyzs = xyzs shape = xyzs.shape if not xRange: xRange = (0, shape[0]) if not yRange: yRange = (0, shape[1]) self.xMap = Qwt.QwtScaleMap(0, xyzs.shape[0], *xRange) self.plot().setAxisScale(Qwt.QwtPlot.xBottom, *xRange) self.yMap = Qwt.QwtScaleMap(0, xyzs.shape[1], *yRange) self.plot().setAxisScale(Qwt.QwtPlot.yLeft, *yRange) self.image = Qwt.toQImage(bytescale(self.xyzs)).mirror(False, True) for i in range(0, 256): self.image.setColor(i, qt.qRgb(i, 0, 255-i)) # setData() def updateLegend(self, legend): Qwt.QwtPlotItem.updateLegend(self, legend) legend.find(self).setText(self.title) # updateLegend() def draw(self, painter, xMap, yMap, rect): """Paint image zoomed to xMap, yMap Calculate (x1, y1, x2, y2) so that it contains at least 1 pixel, and copy the visible region to scale it to the canvas. """ assert(isinstance(self.plot(), Qwt.QwtPlot)) # calculate y1, y2 # the scanline order (index y) is inverted with respect to the y-axis y1 = y2 = self.image.height() y1 *= (self.yMap.s2() - yMap.s2()) y1 /= (self.yMap.s2() - self.yMap.s1()) y1 = max(0, int(y1-0.5)) y2 *= (self.yMap.s2() - yMap.s1()) y2 /= (self.yMap.s2() - self.yMap.s1()) y2 = min(self.image.height(), int(y2+0.5)) # calculate x1, x2 -- the pixel order (index x) is normal x1 = x2 = self.image.width() x1 *= (xMap.s1() - self.xMap.s1()) x1 /= (self.xMap.s2() - self.xMap.s1()) x1 = max(0, int(x1-0.5)) x2 *= (xMap.s2() - self.xMap.s1()) x2 /= (self.xMap.s2() - self.xMap.s1()) x2 = min(self.image.width(), int(x2+0.5)) # copy image = self.image.copy(x1, y1, x2-x1, y2-y1) # zoom image = image.scale(xMap.p2()-xMap.p1()+1, yMap.p1()-yMap.p2()+1) # draw painter.drawImage(xMap.p1(), yMap.p2(), image) # drawImage() # class PlotImage class ImagePlot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) # set plot title self.setTitle('ImagePlot: (un)zoom & (un)hide') # set plot layout self.plotLayout().setMargin(0) self.plotLayout().setCanvasMargin(0) self.plotLayout().setAlignCanvasToScales(True) # set legend legend = Qwt.QwtLegend() legend.setItemMode(Qwt.QwtLegend.ClickableItem) self.insertLegend(legend, Qwt.QwtPlot.RightLegend) # set axis titles self.setAxisTitle(Qwt.QwtPlot.xBottom, 'time (s)') self.setAxisTitle(Qwt.QwtPlot.yLeft, 'frequency (Hz)') # calculate 3 NumPy arrays x = arange(-2*pi, 2*pi, 0.01) y = pi*sin(x) z = 4*pi*cos(x)*cos(x)*sin(x) # attach a curve curve = Qwt.QwtPlotCurve('y = pi*sin(x)') curve.attach(self) curve.setPen(qt.QPen(qt.Qt.green, 2)) curve.setData(x, y) # attach another curve curve = Qwt.QwtPlotCurve('y = 4*pi*sin(x)*cos(x)**2') curve.attach(self) curve.setPen(qt.QPen(qt.Qt.black, 2)) curve.setData(x, z) # attach a grid grid = Qwt.QwtPlotGrid() grid.attach(self) grid.setPen(qt.QPen(qt.Qt.black, 0, qt.Qt.DotLine)) # attach a horizontal marker at y = 0 marker = Qwt.QwtPlotMarker() marker.attach(self) marker.setValue(0.0, 0.0) marker.setLineStyle(Qwt.QwtPlotMarker.HLine) marker.setLabelAlignment(qt.Qt.AlignRight | qt.Qt.AlignTop) marker.setLabel(Qwt.QwtText('y = 0')) # attach a vertical marker at x = pi marker = Qwt.QwtPlotMarker() marker.attach(self) marker.setValue(pi, 0.0) marker.setLineStyle(Qwt.QwtPlotMarker.VLine) marker.setLabelAlignment(qt.Qt.AlignRight | qt.Qt.AlignBottom) marker.setLabel(Qwt.QwtText('x = pi')) # attach a plot image plotImage = PlotImage('Image') plotImage.attach(self) plotImage.setData( square(512, -2*pi, 2*pi), (-2*pi, 2*pi), (-2*pi, 2*pi)) self.connect(self, qt.SIGNAL("legendClicked(QwtPlotItem*)"), self.toggleVisibility) # replot self.replot() self.zoomer = Qwt.QwtPlotZoomer(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.DragSelection, Qwt.QwtPicker.AlwaysOff, self.canvas()) self.zoomer.setRubberBandPen(qt.QPen(qt.Qt.green)) # __init__() def toggleVisibility(self, plotItem): """Toggle the visibility of a plot item """ plotItem.setVisible(not plotItem.isVisible()) self.replot() # toggleVisibility() # class Qwt.QwtImagePlot def make(): demo = ImagePlot() demo.resize(600, 400) demo.show() return demo # make() def main(args): app = qt.QApplication(args) demo = make() app.setMainWidget(demo) sys.exit(app.exec_loop()) # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/CurveDemo2.py0000555000175000017500000001110610462051136020434 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/curvdemo2 import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * Size=15 USize=13 class CurveDemo(Qt.QFrame): def __init__(self, *args): Qt.QFrame.__init__(self, *args) self.setFrameStyle(Qt.QFrame.Box | Qt.QFrame.Raised) self.setLineWidth(2) self.setMidLineWidth(3) p = Qt.QPalette() p.setColor(self.backgroundRole(), Qt.QColor(30, 30, 50)) self.setPalette(p) # make curves and maps self.tuples = [] # curve 1 curve = Qwt.QwtPlotCurve() curve.setPen( Qt.QPen(Qt.QColor(150, 150, 200), 2)) curve.setStyle(Qwt.QwtPlotCurve.Spline) curve.setCurveAttribute(Qwt.QwtPlotCurve.Xfy) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.XCross, Qt.QBrush(), Qt.QPen(Qt.Qt.yellow, 2), Qt.QSize(7, 7))) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -1.5, 1.5), Qwt.QwtScaleMap(0, 100, 0.0, 2*pi))) # curve 2 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.QColor(200, 150, 50), 1, Qt.Qt.DashDotDotLine)) curve.setStyle(Qwt.QwtPlotCurve.Sticks) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, Qt.QBrush(Qt.Qt.blue), Qt.QPen(Qt.Qt.yellow), Qt.QSize(5, 5))) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, 0.0, 2*pi), Qwt.QwtScaleMap(0, 100, -3.0, 1.1))) # curve 3 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.QColor(100, 200, 150))) curve.setStyle(Qwt.QwtPlotCurve.Spline) curve.setCurveAttribute(Qwt.QwtPlotCurve.Periodic) curve.setCurveAttribute(Qwt.QwtPlotCurve.Parametric) curve.setSplineSize(200) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -1.1, 3.0), Qwt.QwtScaleMap(0, 100, -1.1, 3.0))) # curve 4 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.red)) curve.setStyle(Qwt.QwtPlotCurve.Spline) curve.setSplineSize(200) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -5.0, 1.1), Qwt.QwtScaleMap(0, 100, -1.1, 5.0))) # data self.phase = 0.0 self.base = arange(0.0, 2.01*pi, 2*pi/(USize-1)) self.uval = cos(self.base) self.vval = sin(self.base) self.uval[1::2] *= 0.5 self.vval[1::2] *= 0.5 self.newValues() # start timer self.tid = self.startTimer(250) # __init__() def paintEvent(self, event): Qt.QFrame.paintEvent(self,event) painter = Qt.QPainter(self) #painter.setRenderHint(Qt.QPainter.Antialiasing) painter.setClipRect(self.contentsRect()) self.drawContents(painter) # paintEvent() def drawContents(self, painter): r = self.contentsRect() for curve, xMap, yMap in self.tuples: xMap.setPaintInterval(r.left(), r.right()) yMap.setPaintInterval(r.top(), r.bottom()) curve.draw(painter, xMap, yMap, r) # drawContents() def timerEvent(self, event): self.newValues() self.repaint() def newValues(self): phase = self.phase self.xval = arange(0, 2.01*pi, 2*pi/(Size-1)) self.yval = sin(self.xval - phase) self.zval = cos(3*(self.xval + phase)) s = 0.25 * sin(phase) c = sqrt(1.0 - s*s) u = self.uval self.uval = c*self.uval-s*self.vval self.vval = c*self.vval+s*u self.tuples[0][0].setData(self.yval, self.xval) self.tuples[1][0].setData(self.xval, self.zval) self.tuples[2][0].setData(self.yval, self.zval) self.tuples[3][0].setData(self.uval, self.vval) self.phase += 2*pi/100 if self.phase>2*pi: self.phase = 0.0 def make(): demo = CurveDemo() demo.resize(300, 300) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/MapDemo.py0000555000175000017500000001173610505531150020011 0ustar poxpox#!/usr/bin/env python # for debugging, requires: python configure.py --trace ... if False: import sip sip.settracemask(0x3f) import random import sys import time try: import resource has_resource = 1 except ImportError: has_resource = 0 import qt import Qwt5 as Qwt from Qwt5.anynumpy import * def standard_map(x, y, kappa): """provide one interate of the inital conditions (x, y) for the standard map with parameter kappa. """ y_new = y-kappa*sin(2.0*pi*x) x_new = x+y_new # bring back to [0,1.0]^2 if( (x_new>1.0) or (x_new<0.0) ): x_new = x_new - floor(x_new) if( (y_new>1.0) or (y_new<0.0) ): y_new = y_new - floor(y_new) return x_new, y_new # standard_map class MapDemo(qt.QMainWindow): def __init__(self, *args): qt.QMainWindow.__init__(self, *args) self.plot = Qwt.QwtPlot(self) self.plot.setTitle("A Simple Map Demonstration") self.plot.setCanvasBackground(qt.Qt.white) self.plot.setAxisTitle(Qwt.QwtPlot.xBottom, "x") self.plot.setAxisTitle(Qwt.QwtPlot.yLeft, "y") self.plot.setAxisScale(Qwt.QwtPlot.xBottom, 0.0, 1.0) self.plot.setAxisScale(Qwt.QwtPlot.yLeft, 0.0, 1.0) self.setCentralWidget(self.plot) # Initialize map data self.count = self.i = 1000 self.xs = zeros(self.count, Float) self.ys = zeros(self.count, Float) self.kappa = 0.2 self.curve = Qwt.QwtPlotCurve("Map") self.curve.attach(self.plot) self.curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, qt.QBrush(qt.Qt.red), qt.QPen(qt.Qt.blue), qt.QSize(5, 5))) self.curve.setPen(qt.QPen(qt.Qt.cyan)) toolBar = qt.QToolBar(self) qt.QLabel("Count:", toolBar) sizeCounter = Qwt.QwtCounter(toolBar) toolBar.addSeparator() sizeCounter.setRange(0, 1000000, 100) sizeCounter.setValue(self.count) sizeCounter.setNumButtons(3) self.connect( sizeCounter, qt.SIGNAL('valueChanged(double)'), self.setCount) qt.QLabel("Ticks (ms):", toolBar) tickCounter = Qwt.QwtCounter(toolBar) toolBar.addSeparator() # 1 tick = 1 ms, 10 ticks = 10 ms (Linux clock is 100 Hz) self.ticks = 10 tickCounter.setRange(0, 1000, 1) tickCounter.setValue(self.ticks) tickCounter.setNumButtons(3) self.connect( tickCounter, qt.SIGNAL('valueChanged(double)'), self.setTicks) self.tid = self.startTimer(self.ticks) self.timer_tic = None self.user_tic = None self.system_tic = None self.plot.replot() # __init__() def setCount(self, count): self.count = self.i = count self.xs = zeros(self.count, Float) self.ys = zeros(self.count, Float) self.i = self.count self.killTimer(self.tid) self.tid = self.startTimer(self.ticks) # setCount() def setTicks(self, ticks): self.i = self.count self.ticks = int(ticks) self.killTimer(self.tid) self.tid = self.startTimer(ticks) # setTicks() def resizeEvent(self, event): self.plot.resize(event.size()) self.plot.move(0, 0) # resizeEvent() def moreData(self): if self.i == self.count: self.i = 0 self.x = random.random() self.y = random.random() self.xs[self.i] = self.x self.ys[self.i] = self.y self.i += 1 if has_resource: self.user_toc, self.system_toc = resource.getrusage( resource.RUSAGE_SELF)[:2] if self.user_tic: print "user: %s s;" % (self.user_toc-self.user_tic), self.user_tic = self.user_toc if self.system_tic: print "system: %s s;" % (self.system_toc-self.system_tic), self.system_tic = self.system_toc self.timer_toc = time.time() if self.timer_tic: print "wall: %s s." % (self.timer_toc-self.timer_tic) self.timer_tic = self.timer_toc else: self.x, self.y = standard_map(self.x, self.y, self.kappa) self.xs[self.i] = self.x self.ys[self.i] = self.y self.i += 1 # moreData() def timerEvent(self, e): self.moreData() self.curve.setData(self.xs[:self.i], self.ys[:self.i]) self.plot.replot() # timerEvent() # class MapDemo def make(): demo = MapDemo() demo.resize(600, 600) demo.show() return demo # make() def main(args): app = qt.QApplication(args) demo = make() app.setMainWidget(demo) sys.exit(app.exec_loop()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/CurveDemo3.py0000555000175000017500000001472310462051136020445 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/curvdemo2 # with a ConfigDialog contributed by Hans-Peter Jansen. import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * Size=15 USize=13 class ConfigDiag(Qt.QDialog): def __init__(self, parent = None): Qt.QDialog.__init__(self, parent) formLayout = Qt.QGridLayout() self.setLayout(formLayout) speedLayout = Qt.QHBoxLayout() speedLabel = Qt.QLabel("Timer [s]") speedLayout.addWidget(speedLabel) speedCounter = Qwt.QwtCounter() speedCounter.setRange(0.002, 1.0, 0.001) speedLayout.addWidget(speedCounter) formLayout.addLayout(speedLayout, 0, 0) self.s = speedLayout dismissButton = Qt.QPushButton("Dismiss") formLayout.addWidget(dismissButton, 1, 0) self.speedCounter = speedCounter self.connect(dismissButton, Qt.SIGNAL("clicked()"), self.accept) self.connect(self.speedCounter, Qt.SIGNAL("valueChanged(double)"), self.changeTimerSpeed) # __init__() def setTimerSpeed(self, t): self.speedCounter.setValue(t) # setTimerSpeed() def changeTimerSpeed(self, t): self.emit(Qt.SIGNAL("updateSpeed(double)"), t) # changeTimerSpeed() class CurveDemo(Qt.QFrame): def __init__(self, *args): Qt.QFrame.__init__(self, *args) self.setWindowTitle("Click me to configure me") self.setFrameStyle(Qt.QFrame.Box | Qt.QFrame.Raised) self.setLineWidth(2) self.setMidLineWidth(3) p = Qt.QPalette() p.setColor(self.backgroundRole(), Qt.QColor(30, 30, 50)) self.setPalette(p) # make curves and maps self.tuples = [] # curve 1 curve = Qwt.QwtPlotCurve() curve.setPen( Qt.QPen(Qt.QColor(150, 150, 200), 2)) curve.setStyle(Qwt.QwtPlotCurve.Spline) curve.setCurveAttribute(Qwt.QwtPlotCurve.Xfy) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.XCross, Qt.QBrush(), Qt.QPen(Qt.Qt.yellow, 2), Qt.QSize(7, 7))) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -1.5, 1.5), Qwt.QwtScaleMap(0, 100, 0.0, 2*pi))) # curve 2 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.QColor(200, 150, 50), 1, Qt.Qt.DashDotDotLine)) curve.setStyle(Qwt.QwtPlotCurve.Sticks) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, Qt.QBrush(Qt.Qt.blue), Qt.QPen(Qt.Qt.yellow), Qt.QSize(5, 5))) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, 0.0, 2*pi), Qwt.QwtScaleMap(0, 100, -3.0, 1.1))) # curve 3 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.QColor(100, 200, 150))) curve.setStyle(Qwt.QwtPlotCurve.Spline) curve.setCurveAttribute(Qwt.QwtPlotCurve.Periodic) curve.setCurveAttribute(Qwt.QwtPlotCurve.Parametric) curve.setSplineSize(200) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -1.1, 3.0), Qwt.QwtScaleMap(0, 100, -1.1, 3.0))) # curve 4 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.red)) curve.setStyle(Qwt.QwtPlotCurve.Spline) curve.setSplineSize(200) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -5.0, 1.1), Qwt.QwtScaleMap(0, 100, -1.1, 5.0))) # data self.phase = 0.0 self.base = arange(0.0, 2.01*pi, 2*pi/(USize-1)) self.uval = cos(self.base) self.vval = sin(self.base) self.uval[1::2] *= 0.5 self.vval[1::2] *= 0.5 self.newValues() # timer config self.config = ConfigDiag() self.connect(self.config, Qt.SIGNAL('updateSpeed(double)'), self.setTimerSpeed) # start timer self.tid = None self.setTimerSpeed(0.02) self.config.setTimerSpeed(0.02) # __init__() def mousePressEvent(self, e): if not self.config.isVisible(): self.config.show() else: self.config.hide() # mousePressEvent() def setTimerSpeed(self, seconds): if self.tid: self.killTimer(self.tid) self.tid = self.startTimer(int(seconds * 1000.0)) # setTSpeed() def paintEvent(self, event): Qt.QFrame.paintEvent(self,event) painter = Qt.QPainter(self) #painter.setRenderHint(Qt.QPainter.Antialiasing) painter.setClipRect(self.contentsRect()) self.drawContents(painter) # paintEvent() def drawContents(self, painter): r = self.contentsRect() for curve, xMap, yMap in self.tuples: xMap.setPaintInterval(r.left(), r.right()) yMap.setPaintInterval(r.top(), r.bottom()) curve.draw(painter, xMap, yMap, r) # drawContents() def timerEvent(self, event): self.newValues() self.repaint() # timerEvent() def newValues(self): phase = self.phase self.xval = arange(0, 2.01*pi, 2*pi/(Size-1)) self.yval = sin(self.xval - phase) self.zval = cos(3*(self.xval + phase)) s = 0.25 * sin(phase) c = sqrt(1.0 - s*s) u = self.uval self.uval = c*self.uval-s*self.vval self.vval = c*self.vval+s*u self.tuples[0][0].setData(self.yval, self.xval) self.tuples[1][0].setData(self.xval, self.zval) self.tuples[2][0].setData(self.yval, self.zval) self.tuples[3][0].setData(self.uval, self.vval) self.phase += 2*pi/100 if self.phase>2*pi: self.phase = 0.0 # newValues() # class CurveDemo def make(): demo = CurveDemo() demo.resize(300, 300) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/CliDemo.py0000555000175000017500000000054410434023557020006 0ustar poxpox#!/usr/bin/env python from Qwt5.qplt import * def make(): return testPlot(), testIPlot() # make() def main(args): app = qt.QApplication(args) demo = make() app.setMainWidget(demo[-1]) sys.exit(app.exec_loop()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/CPUplot.py0000555000175000017500000003215610434023557020024 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/cpuplot import os import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * #-- cpustat.cpp --# class CpuStat: User = 0 Nice = 1 System = 2 Idle = 3 counter = 0 dummyValues = ( ( 103726, 0, 23484, 819556 ), ( 103783, 0, 23489, 819604 ), ( 103798, 0, 23490, 819688 ), ( 103820, 0, 23490, 819766 ), ( 103840, 0, 23493, 819843 ), ( 103875, 0, 23499, 819902 ), ( 103917, 0, 23504, 819955 ), ( 103950, 0, 23508, 820018 ), ( 103987, 0, 23510, 820079 ), ( 104020, 0, 23513, 820143 ), ( 104058, 0, 23514, 820204 ), ( 104099, 0, 23520, 820257 ), ( 104121, 0, 23525, 820330 ), ( 104159, 0, 23530, 820387 ), ( 104176, 0, 23534, 820466 ), ( 104215, 0, 23538, 820523 ), ( 104245, 0, 23541, 820590 ), ( 104267, 0, 23545, 820664 ), ( 104311, 0, 23555, 820710 ), ( 104355, 0, 23565, 820756 ), ( 104367, 0, 23567, 820842 ), ( 104383, 0, 23572, 820921 ), ( 104396, 0, 23577, 821003 ), ( 104413, 0, 23579, 821084 ), ( 104446, 0, 23588, 821142 ), ( 104521, 0, 23594, 821161 ), ( 104611, 0, 23604, 821161 ), ( 104708, 0, 23607, 821161 ), ( 104804, 0, 23611, 821161 ), ( 104895, 0, 23620, 821161 ), ( 104993, 0, 23622, 821161 ), ( 105089, 0, 23626, 821161 ), ( 105185, 0, 23630, 821161 ), ( 105281, 0, 23634, 821161 ), ( 105379, 0, 23636, 821161 ), ( 105472, 0, 23643, 821161 ), ( 105569, 0, 23646, 821161 ), ( 105666, 0, 23649, 821161 ), ( 105763, 0, 23652, 821161 ), ( 105828, 0, 23661, 821187 ), ( 105904, 0, 23666, 821206 ), ( 105999, 0, 23671, 821206 ), ( 106094, 0, 23676, 821206 ), ( 106184, 0, 23686, 821206 ), ( 106273, 0, 23692, 821211 ), ( 106306, 0, 23700, 821270 ), ( 106341, 0, 23703, 821332 ), ( 106392, 0, 23709, 821375 ), ( 106423, 0, 23715, 821438 ), ( 106472, 0, 23721, 821483 ), ( 106531, 0, 23727, 821517 ), ( 106562, 0, 23732, 821582 ), ( 106597, 0, 23736, 821643 ), ( 106633, 0, 23737, 821706 ), ( 106666, 0, 23742, 821768 ), ( 106697, 0, 23744, 821835 ), ( 106730, 0, 23748, 821898 ), ( 106765, 0, 23751, 821960 ), ( 106799, 0, 23754, 822023 ), ( 106831, 0, 23758, 822087 ), ( 106862, 0, 23761, 822153 ), ( 106899, 0, 23763, 822214 ), ( 106932, 0, 23766, 822278 ), ( 106965, 0, 23768, 822343 ), ( 107009, 0, 23771, 822396 ), ( 107040, 0, 23775, 822461 ), ( 107092, 0, 23780, 822504 ), ( 107143, 0, 23787, 822546 ), ( 107200, 0, 23795, 822581 ), ( 107250, 0, 23803, 822623 ), ( 107277, 0, 23810, 822689 ), ( 107286, 0, 23810, 822780 ), ( 107313, 0, 23817, 822846 ), ( 107325, 0, 23818, 822933 ), ( 107332, 0, 23818, 823026 ), ( 107344, 0, 23821, 823111 ), ( 107357, 0, 23821, 823198 ), ( 107368, 0, 23823, 823284 ), ( 107375, 0, 23824, 823377 ), ( 107386, 0, 23825, 823465 ), ( 107396, 0, 23826, 823554 ), ( 107422, 0, 23830, 823624 ), ( 107434, 0, 23831, 823711 ), ( 107456, 0, 23835, 823785 ), ( 107468, 0, 23838, 823870 ), ( 107487, 0, 23840, 823949 ), ( 107515, 0, 23843, 824018 ), ( 107528, 0, 23846, 824102 ), ( 107535, 0, 23851, 824190 ), ( 107548, 0, 23853, 824275 ), ( 107562, 0, 23857, 824357 ), ( 107656, 0, 23863, 824357 ), ( 107751, 0, 23868, 824357 ), ( 107849, 0, 23870, 824357 ), ( 107944, 0, 23875, 824357 ), ( 108043, 0, 23876, 824357 ), ( 108137, 0, 23882, 824357 ), ( 108230, 0, 23889, 824357 ), ( 108317, 0, 23902, 824357 ), ( 108412, 0, 23907, 824357 ), ( 108511, 0, 23908, 824357 ), ( 108608, 0, 23911, 824357 ), ( 108704, 0, 23915, 824357 ), ( 108801, 0, 23918, 824357 ), ( 108891, 0, 23928, 824357 ), ( 108987, 0, 23932, 824357 ), ( 109072, 0, 23943, 824361 ), ( 109079, 0, 23943, 824454 ), ( 109086, 0, 23944, 824546 ), ( 109098, 0, 23950, 824628 ), ( 109108, 0, 23955, 824713 ), ( 109115, 0, 23957, 824804 ), ( 109122, 0, 23958, 824896 ), ( 109132, 0, 23959, 824985 ), ( 109142, 0, 23961, 825073 ), ( 109146, 0, 23962, 825168 ), ( 109153, 0, 23964, 825259 ), ( 109162, 0, 23966, 825348 ), ( 109168, 0, 23969, 825439 ), ( 109176, 0, 23971, 825529 ), ( 109185, 0, 23974, 825617 ), ( 109193, 0, 23977, 825706 ), ( 109198, 0, 23978, 825800 ), ( 109206, 0, 23978, 825892 ), ( 109212, 0, 23981, 825983 ), ( 109219, 0, 23981, 826076 ), ( 109225, 0, 23981, 826170 ), ( 109232, 0, 23984, 826260 ), ( 109242, 0, 23984, 826350 ), ( 109255, 0, 23986, 826435 ), ( 109268, 0, 23987, 826521 ), ( 109283, 0, 23990, 826603 ), ( 109288, 0, 23991, 826697 ), ( 109295, 0, 23993, 826788 ), ( 109308, 0, 23994, 826874 ), ( 109322, 0, 24009, 826945 ), ( 109328, 0, 24011, 827037 ), ( 109338, 0, 24012, 827126 ), ( 109347, 0, 24012, 827217 ), ( 109354, 0, 24017, 827305 ), ( 109367, 0, 24017, 827392 ), ( 109371, 0, 24019, 827486 ), ) def __init__(self): self.procValues = self.__lookup() # __init__() def statistic(self): values = self.__lookup() userDelta = 0.0 for i in [CpuStat.User, CpuStat.Nice]: userDelta += (values[i] - self.procValues[i]) systemDelta = values[CpuStat.System] - self.procValues[CpuStat.System] totalDelta = 0.0 for i in range(len(self.procValues)): totalDelta += (values[i] - self.procValues[i]) self.procValues = values return 100.0*userDelta/totalDelta, 100.0*systemDelta/totalDelta # statistics() def upTime(self): result = Qt.QTime() for item in self.procValues: result = result.addSecs(item/100) return result # upTime() def __lookup(self): if os.path.exists("/proc/stat"): for line in open("/proc/stat"): words = line.split() if words[0] == "cpu" and len(words) >= 5: return map(float, words[1:]) else: result = CpuStat.dummyValues[CpuStat.counter] CpuStat.counter += 1 CpuStat.counter %= len(CpuStat.dummyValues) return result # __lookup # class CpuStat #-- cpupiemarker.cpp --# class CpuPieMarker(Qwt.QwtPlotMarker): def __init__(self, *args): Qwt.QwtPlotMarker.__init__(self, *args) self.setZ(1000.0) self.setRenderHint(Qwt.QwtPlotItem.RenderAntialiased, True) # __init__() def rtti(self): return Qwt.QwtPlotItem.Rtti_PlotUserItem # rtti() def draw(self, painter, xMap, yMap, rect): margin = 5 pieRect = Qt.QRect() pieRect.setX(rect.x() + margin) pieRect.setY(rect.y() + margin) pieRect.setHeight(yMap.transform(80.0)) pieRect.setWidth(pieRect.height()) angle = 3*5760/4 for key in ["User", "System", "Idle"]: curve = self.plot().cpuPlotCurve(key) if curve.dataSize(): value = int(5760*curve.y(0)/100.0) painter.save() painter.setBrush(Qt.QBrush(curve.pen().color(), Qt.Qt.SolidPattern)) painter.drawPie(pieRect, -angle, -value) painter.restore() angle += value # draw() # class CpuPieMarker #-- cpuplot.cpp --# class TimeScaleDraw(Qwt.QwtScaleDraw): def __init__(self, baseTime, *args): Qwt.QwtScaleDraw.__init__(self, *args) self.baseTime = baseTime # __init__() def label(self, value): upTime = self.baseTime.addSecs(int(value)) return Qwt.QwtText(upTime.toString()) # label() # class TimeScaleDraw class Background(Qwt.QwtPlotItem): def __init__(self): Qwt.QwtPlotItem.__init__(self) self.setZ(0.0) # __init__() def rtti(self): return Qwt.QwtPlotItem.Rtti_PlotUserItem # rtti() def draw(self, painter, xMap, yMap, rect): c = Qt.QColor(Qt.Qt.white) r = Qt.QRect(rect) for i in range(100, 0, -10): r.setBottom(yMap.transform(i - 10)) r.setTop(yMap.transform(i)) painter.fillRect(r, c) c = c.dark(110) # draw() # class Background class CpuCurve(Qwt.QwtPlotCurve): def __init__(self, *args): Qwt.QwtPlotCurve.__init__(self, *args) self.setRenderHint(Qwt.QwtPlotItem.RenderAntialiased) # __init__() def setColor(self, color): c = Qt.QColor(color) c.setAlpha(150) self.setPen(c) self.setBrush(c) # setColor() # class CpuCurve HISTORY = 60 class CpuPlot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) self.curves = {} self.data = {} self.timeData = 1.0 * arange(HISTORY-1, -1, -1) self.cpuStat = CpuStat() self.setAutoReplot(False) self.plotLayout().setAlignCanvasToScales(True) legend = Qwt.QwtLegend() legend.setItemMode(Qwt.QwtLegend.CheckableItem) self.insertLegend(legend, Qwt.QwtPlot.RightLegend) self.setAxisTitle(Qwt.QwtPlot.xBottom, "System Uptime [h:m:s]") self.setAxisScaleDraw( Qwt.QwtPlot.xBottom, TimeScaleDraw(self.cpuStat.upTime())) self.setAxisScale(Qwt.QwtPlot.xBottom, 0, HISTORY) self.setAxisLabelRotation(Qwt.QwtPlot.xBottom, -50.0) self.setAxisLabelAlignment( Qwt.QwtPlot.xBottom, Qt.Qt.AlignLeft | Qt.Qt.AlignBottom) self.setAxisTitle(Qwt.QwtPlot.yLeft, "Cpu Usage [%]") self.setAxisScale(Qwt.QwtPlot.yLeft, 0, 100) background = Background() background.attach(self) pie = CpuPieMarker() pie.attach(self) curve = CpuCurve('System') curve.setColor(Qt.Qt.red) curve.attach(self) self.curves['System'] = curve self.data['System'] = zeros(HISTORY, Float) curve = CpuCurve('User') curve.setColor(Qt.Qt.blue) curve.setZ(curve.z() - 1.0) curve.attach(self) self.curves['User'] = curve self.data['User'] = zeros(HISTORY, Float) curve = CpuCurve('Total') curve.setColor(Qt.Qt.black) curve.setZ(curve.z() - 2.0) curve.attach(self) self.curves['Total'] = curve self.data['Total'] = zeros(HISTORY, Float) curve = CpuCurve('Idle') curve.setColor(Qt.Qt.darkCyan) curve.setZ(curve.z() - 3.0) curve.attach(self) self.curves['Idle'] = curve self.data['Idle'] = zeros(HISTORY, Float) self.showCurve(self.curves['System'], True) self.showCurve(self.curves['User'], True) self.showCurve(self.curves['Total'], False) self.showCurve(self.curves['Idle'], False) self.startTimer(1000) self.connect(self, Qt.SIGNAL('legendChecked(QwtPlotItem*, bool)'), self.showCurve) self.replot() # __init__() def timerEvent(self, e): for data in self.data.itervalues(): data[1:] = data[0:-1] self.data["User"][0], self.data["System"][0] = self.cpuStat.statistic() self.data["Total"][0] = self.data["User"][0] + self.data["System"][0] self.data["Idle"][0] = 100.0 - self.data["Total"][0] self.timeData += 1.0 self.setAxisScale( Qwt.QwtPlot.xBottom, self.timeData[-1], self.timeData[0]) for key in self.curves.keys(): self.curves[key].setData(self.timeData, self.data[key]) self.replot() # timerEvent() def showCurve(self, item, on): item.setVisible(on) widget = self.legend().find(item) if isinstance(widget, Qwt.QwtLegendItem): widget.setChecked(on) self.replot() # showCurve() def cpuPlotCurve(self, key): return self.curves[key] # cpuPlotCurve() # class CpuPlot def make(): demo = Qt.QWidget() demo.setWindowTitle('Cpu Plot') plot = CpuPlot(demo) plot.setTitle("History") plot.setMargin(5) label = Qt.QLabel("Press the legend to en/disable a curve", demo) layout = Qt.QVBoxLayout(demo) layout.addWidget(plot) layout.addWidget(label) demo.resize(600, 400) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/py2html.py0000555000175000017500000000277510434023557020101 0ustar poxpox#!/usr/bin/env python # This is a trimmed down version of Marc-Andre Lemburg's py2html.py. # The original code can be found at http://starship.python.net/~lemburg/. # # Borrow (or steal?) PyFontify.py from reportlab.lib. import PyFontify import sys pattern=""" %(source)s
%(target)s
""" formats = { 'comment': "%s", 'identifier': "%s", 'keyword': "%s", 'string': "%s" } def escape_html(text): t = (('&','&'), ('<','<'), ('>','>')) for x,y in t: text = y.join(text.split(x)) return text def py2html(source): f = open(source) text = f.read() f.close() tags = PyFontify.fontify(text) done = 0 chunks = [] for tag, start, end, sublist in tags: chunks.append(escape_html(text[done:start])) chunks.append(formats[tag] % escape_html(text[start:end])) done = end chunks.append(escape_html(text[done:])) dict = { 'source' : source, 'target' : ''.join(chunks) } f = open(source + '.html', 'w') f.write(pattern % dict) f.close() if __name__ == '__main__': if len(sys.argv) == 1: print "Usage: ./py2html.py files" print "\tfiles is a list of Python source files." sys.exit(1) for file in sys.argv[1:]: py2html(file) pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/ErrorBarDemo.py0000555000175000017500000002460110505531150021005 0ustar poxpox#!/usr/bin/env python # for debugging, requires: python configure.py --trace ... if False: import sip sip.settracemask(0x3f) import sys import qt import Qwt5 as Qwt from Qwt5.anynumpy import * class ErrorBarPlotCurve(Qwt.QwtPlotCurve): def __init__(self, x = [], y = [], dx = None, dy = None, curvePen = qt.QPen(qt.Qt.NoPen), curveStyle = Qwt.QwtPlotCurve.Lines, curveSymbol = Qwt.QwtSymbol(), errorPen = qt.QPen(qt.Qt.NoPen), errorCap = 0, errorOnTop = False, ): """A curve of x versus y data with error bars in dx and dy. Horizontal error bars are plotted if dx is not None. Vertical error bars are plotted if dy is not None. x and y must be sequences with a shape (N,) and dx and dy must be sequences (if not None) with a shape (), (N,), or (2, N): - if dx or dy has a shape () or (N,), the error bars are given by (x-dx, x+dx) or (y-dy, y+dy), - if dx or dy has a shape (2, N), the error bars are given by (x-dx[0], x+dx[1]) or (y-dy[0], y+dy[1]). curvePen is the pen used to plot the curve curveStyle is the style used to plot the curve curveSymbol is the symbol used to plot the symbols errorPen is the pen used to plot the error bars errorCap is the size of the error bar caps errorOnTop is a boolean: - if True, plot the error bars on top of the curve, - if False, plot the curve on top of the error bars. """ Qwt.QwtPlotCurve.__init__(self) self.setData(x, y, dx, dy) self.setPen(curvePen) self.setStyle(curveStyle) self.setSymbol(curveSymbol) self.errorPen = errorPen self.errorCap = errorCap self.errorOnTop = errorOnTop # __init__() def setData(self, x, y, dx = None, dy = None): """Set x versus y data with error bars in dx and dy. Horizontal error bars are plotted if dx is not None. Vertical error bars are plotted if dy is not None. x and y must be sequences with a shape (N,) and dx and dy must be sequences (if not None) with a shape (), (N,), or (2, N): - if dx or dy has a shape () or (N,), the error bars are given by (x-dx, x+dx) or (y-dy, y+dy), - if dx or dy has a shape (2, N), the error bars are given by (x-dx[0], x+dx[1]) or (y-dy[0], y+dy[1]). """ self.__x = asarray(x, Float) if len(self.__x.shape) != 1: raise RuntimeError, 'len(asarray(x).shape) != 1' self.__y = asarray(y, Float) if len(self.__y.shape) != 1: raise RuntimeError, 'len(asarray(y).shape) != 1' if len(self.__x) != len(self.__y): raise RuntimeError, 'len(asarray(x)) != len(asarray(y))' if dx is None: self.__dx = None else: self.__dx = asarray(dx, Float) if len(self.__dx.shape) not in [0, 1, 2]: raise RuntimeError, 'len(asarray(dx).shape) not in [0, 1, 2]' if dy is None: self.__dy = dy else: self.__dy = asarray(dy, Float) if len(self.__dy.shape) not in [0, 1, 2]: raise RuntimeError, 'len(asarray(dy).shape) not in [0, 1, 2]' Qwt.QwtPlotCurve.setData(self, self.__x, self.__y) # setData() def boundingRect(self): """Return the bounding rectangle of the data, error bars included. """ if self.__dx is None: xmin = min(self.__x) xmax = max(self.__x) elif len(self.__dx.shape) in [0, 1]: xmin = min(self.__x - self.__dx) xmax = max(self.__x + self.__dx) else: xmin = min(self.__x - self.__dx[0]) xmax = max(self.__x + self.__dx[1]) if self.__dy is None: ymin = min(self.__y) ymax = max(self.__y) elif len(self.__dy.shape) in [0, 1]: ymin = min(self.__y - self.__dy) ymax = max(self.__y + self.__dy) else: ymin = min(self.__y - self.__dy[0]) ymax = max(self.__y + self.__dy[1]) return Qwt.QwtDoubleRect(xmin, ymin, xmax-xmin, ymax-ymin) # boundingRect() def drawFromTo(self, painter, xMap, yMap, first, last = -1): """Draw an interval of the curve, including the error bars painter is the QPainter used to draw the curve xMap is the Qwt.QwtDiMap used to map x-values to pixels yMap is the Qwt.QwtDiMap used to map y-values to pixels first is the index of the first data point to draw last is the index of the last data point to draw. If last < 0, last is transformed to index the last data point """ if last < 0: last = self.dataSize() - 1 if self.errorOnTop: Qwt.QwtPlotCurve.drawFromTo(self, painter, xMap, yMap, first, last) # draw the error bars painter.save() painter.setPen(self.errorPen) # draw the error bars with caps in the x direction if self.__dx is not None: # draw the bars if len(self.__dx.shape) in [0, 1]: xmin = (self.__x - self.__dx) xmax = (self.__x + self.__dx) else: xmin = (self.__x - self.__dx[0]) xmax = (self.__x + self.__dx[1]) y = self.__y n, i, j = len(y), 0, 0 lines = qt.QPointArray(2*n) while i < n: yi = yMap.transform(y[i]) lines.setPoint(j, xMap.transform(xmin[i]), yi) j += 1 lines.setPoint(j, xMap.transform(xmax[i]), yi) j += 1; i += 1 painter.drawLineSegments(lines) if self.errorCap > 0: # draw the caps cap = self.errorCap/2 n, i, j = len(y), 0, 0 lines = qt.QPointArray(4*n) while i < n: yi = yMap.transform(y[i]) lines.setPoint(j, xMap.transform(xmin[i]), yi - cap) j += 1 lines.setPoint(j, xMap.transform(xmin[i]), yi + cap) j += 1 lines.setPoint(j, xMap.transform(xmax[i]), yi - cap) j += 1 lines.setPoint(j, xMap.transform(xmax[i]), yi + cap) j += 1; i += 1 painter.drawLineSegments(lines) # draw the error bars with caps in the y direction if self.__dy is not None: # draw the bars if len(self.__dy.shape) in [0, 1]: ymin = (self.__y - self.__dy) ymax = (self.__y + self.__dy) else: ymin = (self.__y - self.__dy[0]) ymax = (self.__y + self.__dy[1]) x = self.__x n, i, j = len(x), 0, 0 lines = qt.QPointArray(2*n) while i < n: xi = xMap.transform(x[i]) lines.setPoint(j, xi, yMap.transform(ymin[i])) j += 1 lines.setPoint(j, xi, yMap.transform(ymax[i])) j += 1; i += 1 painter.drawLineSegments(lines) # draw the caps if self.errorCap > 0: cap = self.errorCap/2 n, i, j = len(x), 0, 0 lines = qt.QPointArray(4*n) while i < n: xi = xMap.transform(x[i]) lines.setPoint(j, xi - cap, yMap.transform(ymin[i])) j += 1 lines.setPoint(j, xi + cap, yMap.transform(ymin[i])) j += 1 lines.setPoint(j, xi - cap, yMap.transform(ymax[i])) j += 1 lines.setPoint(j, xi + cap, yMap.transform(ymax[i])) j += 1; i += 1 painter.drawLineSegments(lines) painter.restore() if not self.errorOnTop: Qwt.QwtPlotCurve.drawFromTo(self, painter, xMap, yMap, first, last) # drawFromTo() # class ErrorBarPlotCurve def make(): # create a plot with a white canvas demo = Qwt.QwtPlot(Qwt.QwtText("Errorbar Demonstation")) demo.setCanvasBackground(qt.Qt.white) demo.plotLayout().setAlignCanvasToScales(True) grid = Qwt.QwtPlotGrid() grid.attach(demo) grid.setPen(qt.QPen(qt.Qt.black, 0, qt.Qt.DotLine)) # calculate data and errors for a curve with error bars x = arange(0, 10.1, 0.5, Float) y = sin(x) dy = 0.2 * abs(y) # dy = (0.15 * abs(y), 0.25 * abs(y)) # uncomment for asymmetric error bars dx = 0.2 # all error bars the same size errorOnTop = False # uncomment to draw the curve on top of the error bars # errorOnTop = True # uncomment to draw the error bars on top of the curve curve = ErrorBarPlotCurve( x = x, y = y, dx = dx, dy = dy, curvePen = qt.QPen(qt.Qt.black, 2), curveSymbol = Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, qt.QBrush(qt.Qt.red), qt.QPen(qt.Qt.black, 2), qt.QSize(9, 9)), errorPen = qt.QPen(qt.Qt.blue, 2), errorCap = 10, errorOnTop = errorOnTop, ) curve.attach(demo) demo.resize(400, 300) demo.show() return demo # make() def main(args): app = qt.QApplication(args) demo = make() app.setMainWidget(demo) zoomer = Qwt.QwtPlotZoomer(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.DragSelection, Qwt.QwtPicker.AlwaysOff, demo.canvas()) zoomer.setRubberBandPen(qt.QPen(qt.Qt.green)) picker = Qwt.QwtPlotPicker(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.NoSelection, Qwt.QwtPlotPicker.CrossRubberBand, Qwt.QwtPicker.AlwaysOn, demo.canvas()) picker.setTrackerPen(qt.QPen(qt.Qt.red)) sys.exit(app.exec_loop()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3examples/CurveDemo1.py0000555000175000017500000001036510505531150020436 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/curvedemo1/curvdemo1 import sys import qt as Qt import Qwt5 as Qwt from Qwt5.anynumpy import * class CurveDemo(Qt.QFrame): def __init__(self, *args): Qt.QFrame.__init__(self, *args) self.xMap = Qwt.QwtScaleMap() self.xMap.setScaleInterval(-0.5, 10.5) self.yMap = Qwt.QwtScaleMap() self.yMap.setScaleInterval(-1.1, 1.1) # frame style self.setFrameStyle(Qt.QFrame.Box | Qt.QFrame.Raised) self.setLineWidth(2) self.setMidLineWidth(3) # calculate values self.x = arange(0, 10.0, 10.0/27) self.y = sin(self.x)*cos(2*self.x) # make curves with different styles self.curves = [] self.titles = [] # curve 0 self.titles.append('Style: Lines/Fitted, Symbol: Cross') curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.darkGreen)) curve.setStyle(Qwt.QwtPlotCurve.Lines) curve.setCurveAttribute(Qwt.QwtPlotCurve.Fitted) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Cross, Qt.QBrush(), Qt.QPen(Qt.Qt.black), Qt.QSize(5, 5))) self.curves.append(curve) # curve 1 self.titles.append('Style: Sticks, Symbol: Ellipse') curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.red)) curve.setStyle(Qwt.QwtPlotCurve.Sticks) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, Qt.QBrush(Qt.Qt.yellow), Qt.QPen(Qt.Qt.blue), Qt.QSize(5, 5))) self.curves.append(curve) # curve 2 self.titles.append('Style: Lines, Symbol: None') curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.darkBlue)) curve.setStyle(Qwt.QwtPlotCurve.Lines) self.curves.append(curve) # curve 3 self.titles.append('Style: Steps, Symbol: None') curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.darkCyan)) curve.setStyle(Qwt.QwtPlotCurve.Steps) self.curves.append(curve) # curve 4 self.titles.append('Style: NoCurve, Symbol: XCross') curve = Qwt.QwtPlotCurve() curve.setStyle(Qwt.QwtPlotCurve.NoCurve) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.XCross, Qt.QBrush(), Qt.QPen(Qt.Qt.darkMagenta), Qt.QSize(5, 5))) self.curves.append(curve) # attach data, using Numeric for curve in self.curves: curve.setData(self.x, self.y) # __init__() def shiftDown(self, rect, offset): rect.moveBy(0, offset) # shiftDown() def paintEvent(self, event): Qt.QFrame.paintEvent(self, event) painter = Qt.QPainter(self) painter.setClipRect(self.contentsRect()) self.drawContents(painter) # paintEvent() def drawContents(self, painter): # draw curves r = self.contentsRect() dy = r.height()/len(self.curves) r.setHeight(dy) for curve in self.curves: self.xMap.setPaintInterval(r.left(), r.right()) self.yMap.setPaintInterval(r.top(), r.bottom()) curve.draw(painter, self.xMap, self.yMap, r) self.shiftDown(r, dy) # draw titles r = self.contentsRect() r.setHeight(dy) painter.setFont(Qt.QFont('Helvetica', 8)) painter.setPen(Qt.Qt.black) for title in self.titles: painter.drawText( 0, r.top(), r.width(), painter.fontMetrics().height(), Qt.Qt.AlignTop | Qt.Qt.AlignHCenter, title) self.shiftDown(r, dy) # drawContents() # class CurveDemo def make(): demo = CurveDemo() demo.resize(300, 600) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() app.setMainWidget(demo) sys.exit(app.exec_loop()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/0000755000175000017500000000000011275562661015055 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/0000755000175000017500000000000011275562661016036 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/uic/0000755000175000017500000000000011275562661016616 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/uic/widget-plugins/0000755000175000017500000000000011275562661021560 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/uic/widget-plugins/qwt.py0000444000175000017500000000214211234764675022746 0ustar poxpox# A plugin may raise an ImportError. In this case, the plugin will be silently # discarded. Any other exception that happens during plugin loading will lead # to a program abort. # If pluginType is MODULE, the plugin loader will call moduleInformation. The # variable MODULE is inserted into the local namespace by the plugin loader. pluginType = MODULE # moduleInformation() must return a tuple (module, widget_list). If "module" # is "A" and any widget from this module is used, the code generator will write # "import A". If "module" is "A[.B].C", the code generator will write # "from A[.B] import C". Each entry in "widget_list" must be unique. def moduleInformation(): return "PyQt4.Qwt5", ("QwtAnalogClock", "QwtCompass", "QwtCounter", "QwtDial", "QwtKnob", "QwtPlot", "QwtScaleWidget", "QwtSlider", "QwtThermo", "QwtWheel", "QwtTextLabel",) pyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/Qwt5/0000755000175000017500000000000011275562661016676 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/Qwt5/pythonrc.py0000444000175000017500000000355611114331200021074 0ustar poxpox# Set your PYTHONSTARTUP environment variable to $HOME/.pythonrc.py # # inspired by: # http://opag.ca/wiki/OpagCode/OpagSnippets from __future__ import division # Import Numpy and SciPy try: import numpy as np import scipy as sp sp.pkgload(#'cluster', 'constants', 'fftpack', 'integrate', 'interpolate', #'io', 'linalg', 'misc', 'ndimage', 'odr', 'optimize', #'signal', #'sparse', #'spatial', 'special', #'stats', #'stsci', #'weave', ) except ImportError: pass # Import PyQt4.Qt and PyQt4.Qwt5; initialize an application. # Note: hides the builtins hex and oct. try: from PyQt4.Qt import * from PyQt4.Qwt5 import * from PyQt4.Qwt5.qplt import * application = QApplication([]) except ImportError: application = None # Setup readline and history saving from atexit import register from os import path import readline import rlcompleter # Set up a tab for completion; use a single space to indent Python code. readline.parse_and_bind('tab: complete') history = path.expanduser('~/.python_history') readline.set_history_length(1000) # Read the history of the previous session, if it exists. if path.exists(history): readline.read_history_file(history) # Set up history saving on exit. def save(history=history, readline=readline, application=application): readline.write_history_file(history) register(save) # Clean up the global name space; save, history, readline, and application # will continue to exist, since del decrements the reference count by one. del register, path, readline, rlcompleter, history, save, application # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/Qwt5/iqt.py0000444000175000017500000000101510651711166020031 0ustar poxpox"""iqt Provides control over PyQt and PyQwt widgets from the command line interpreter. """ # Import GNU readline, so that readline can do its work in Python scripts. # _iqt falls back on a different method when there is no GNU readline. try: import readline except ImportError: pass from PyQt4.Qt import QApplication, QCoreApplication, PYQT_VERSION if QCoreApplication.instance() is None: _a = QApplication([]) if PYQT_VERSION < 0x40300: import _iqt # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/Qwt5/__init__.py0000444000175000017500000000265611130210270020766 0ustar poxpox"""A Python interface to the Qwt library. """ # # Copyright (C) 2003-2009 Gerard Vermeulen # # This file is part of PyQwt. # # PyQwt is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PyQwt is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # In addition, as a special exception, Gerard Vermeulen gives permission # to link PyQwt dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt in this form, provided that equally powerful # versions of Qt and PyQt have been released under the terms of the GNU # General Public License. # # If PyQwt is dynamically linked with non-free versions of Qt and PyQt, # PyQwt becomes a free plug-in for a non-free program. from Qwt import * try: to_na_array = toNumarray except NameError: pass try: to_np_array = toNumeric except NameError: pass # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/Qwt5/ipy_user_conf.py0000444000175000017500000000752311147310176022107 0ustar poxpox""" User configuration file for IPython This is a more flexible and safe way to configure ipython than *rc files (ipythonrc, ipythonrc-pysh etc.) This file is always imported on ipython startup. You can import the ipython extensions you need here (see IPython/Extensions directory). Feel free to edit this file to customize your ipython experience. Note that as such this file does nothing, for backwards compatibility. Consult e.g. file 'ipy_profile_sh.py' for an example of the things you can do here. See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed description on what you could do here. """ # Most of your config files and extensions will probably start with this import import IPython.ipapi ip = IPython.ipapi.get() # You probably want to uncomment this if you did %upgrade -nolegacy # import ipy_defaults import os def main(): # uncomment if you want to get ipython -p sh behaviour # without having to use command line switches # import ipy_profile_sh # Configure your favourite editor? # Good idea e.g. for %edit os.path.isfile import ipy_editors # Choose one of these: #ipy_editors.scite() #ipy_editors.scite('c:/opt/scite/scite.exe') #ipy_editors.komodo() #ipy_editors.idle() # ... or many others, try 'ipy_editors??' after import to see them ipy_editors.emacs() # Or roll your own: #ipy_editors.install_editor("c:/opt/jed +$line $file") o = ip.options # An example on how to set options #o.autocall = 1 o.system_verbose = 0 #import_all("os sys") #execf('~/_ipython/ns.py') # -- prompt # A different, more compact set of prompts from the default ones, that # always show your current location in the filesystem: #o.prompt_in1 = r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Normal\n\C_Green|\#>' #o.prompt_in2 = r'.\D: ' #o.prompt_out = r'[\#] ' # Try one of these color settings if you can't read the text easily # autoexec is a list of IPython commands to execute on startup #o.autoexec.append('%colors LightBG') #o.autoexec.append('%colors NoColor') #o.autoexec.append('%colors Linux') # for sane integer division that converts to float (1/2 == 0.5) #o.autoexec.append('from __future__ import division') ip.IP.runcode(ip.IP.compile('from __future__ import division')) # For %tasks and %kill #import jobctrl # For autoreloading of modules (%autoreload, %aimport) #import ipy_autoreload # For winpdb support (%wdb) #import ipy_winpdb # For bzr completer, requires bzrlib (the python installation of bzr) #ip.load('ipy_bzr') # Tab completer that is not quite so picky (i.e. # "foo". and str(2). will work). Complete # at your own risk! #import ipy_greedycompleter # If you are on Linux, you may be annoyed by # "Display all N possibilities? (y or n)" on tab completion, # as well as the paging through "more". Uncomment the following # lines to disable that behaviour import readline readline.parse_and_bind('set completion-query-items 1000') readline.parse_and_bind('set page-completions no') #print dir(ip) #print dir(ip.IP) ip.ex('import numpy as np') ip.ex('import scipy as sp') ip.ex('sp.pkgload()') ip.ex('sp.pkgload("scipy.constants")') ip.ex('from PyQt4.Qt import *') ip.ex('from PyQt4.Qwt5 import *') ip.ex('from PyQt4.Qwt5.qplt import *') ip.ex('import PyQt4.Qwt5.iqt') # main() # some config helper functions you can use def import_all(modules): """ Usage: import_all("os sys") """ for m in modules.split(): ip.ex("from %s import *" % m) # import_all def execf(fname): """ Execute a file in user namespace """ ip.ex('execfile("%s")' % os.path.expanduser(fname)) # execf() main() pyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/Qwt5/qplt.py0000444000175000017500000007547611264104533020235 0ustar poxpox#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2003-2009 Gerard Vermeulen # # This file is part of PyQwt. # # PyQwt is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PyQwt is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # In addition, as a special exception, Gerard Vermeulen gives permission # to link PyQwt dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt in this form, provided that equally powerful # versions of Qt and PyQt have been released under the terms of the GNU # General Public License. # # If PyQwt is dynamically linked with non-free versions of Qt and PyQt, # PyQwt becomes a free plug-in for a non-free program. """ Provides a command line interpreter friendly layer over `QwtPlot`. An example of its use is: >>> import numpy as np >>> from PyQt4.Qt import * >>> from PyQt4.Qwt5 import * >>> from PyQt4.Qwt5.qplt import * >>> application = QApplication([]) >>> x = np.arange(-2*np.pi, 2*np.pi, 0.01) >>> p = Plot( ... Curve(x, np.cos(x), Pen(Magenta, 2), 'cos(x)'), ... Curve(x, np.exp(x), Pen(Red), 'exp(x)', Y2), ... Axis(Y2, Log), ... 'PyQwt using Qwt-%s -- http://qwt.sf.net' % QWT_VERSION_STR) >>> QPixmap.grabWidget(p).save('cli-plot-1.png', 'PNG') True >>> x = x[0:-1:10] >>> p.plot( ... Curve(x, np.cos(x-np.pi/4), Symbol(Circle, Yellow), 'circle'), ... Curve(x, np.cos(x+np.pi/4), Pen(Blue), Symbol(Square, Cyan), 'square')) >>> QPixmap.grabWidget(p).save('cli-plot-2.png', 'PNG') True """ import sys import time from PyQt4.Qt import * from PyQt4.Qwt5 import * from grace import GraceProcess # Qt.GlobalColor aliases Black = Qt.black Blue = Qt.blue Cyan = Qt.cyan DarkBlue = Qt.darkBlue DarkCyan = Qt.darkCyan DarkGray = Qt.darkGray DarkGreen = Qt.darkGreen DarkMagenta = Qt.darkMagenta DarkRed = Qt.darkRed DarkYellow = Qt.darkYellow Gray = Qt.gray Green = Qt.green LightGray = Qt.lightGray Magenta = Qt.magenta Red = Qt.red White = Qt.white Yellow = Qt.yellow # Qt.PenStyle aliases NoLine = Qt.NoPen SolidLine = Qt.SolidLine DashLine = Qt.DashLine DotLine = Qt.DotLine DashDotLine = Qt.DashDotLine DashDotDotLine = Qt.DashDotDotLine # QwtPlot.Axis aliases Y1 = Left = QwtPlot.yLeft Y2 = Right = QwtPlot.yRight X1 = Bottom = QwtPlot.xBottom X2 = Top = QwtPlot.xTop # QwtScaleEngine aliases Lin = QwtLinearScaleEngine Log = QwtLog10ScaleEngine # QwtScaleEngine.Attribute aliases NoAttribute = QwtScaleEngine.NoAttribute IncludeReference = QwtScaleEngine.IncludeReference Symmetric = QwtScaleEngine.Symmetric Floating = QwtScaleEngine.Floating Inverted = QwtScaleEngine.Inverted # QwtSymbol.Style aliases NoSymbol = QwtSymbol.NoSymbol Circle = QwtSymbol.Ellipse Square = QwtSymbol.Rect Diamond = QwtSymbol.Diamond # font Font = QFont('Verdana') class Tracker(QObject): def __init__(self, parent): QObject.__init__(self, parent) parent.setMouseTracking(True) parent.installEventFilter(self) # __init__() def eventFilter(self, _, event): if event.type() == QEvent.MouseMove: self.emit(SIGNAL("MouseMoveTracked"), event.pos()) return False # eventFilter() # class Tracker class Plot(QwtPlot): """A command line interpreter friendly layer over `QwtPlot`. The interpretation of the `*rest` parameters is type dependent: - `Axis`: enables the axis. - `Curve`: adds a curve. - `str` or `QString`: sets the title. - `int`: sets a set of mouse events to the zoomer actions. - (`int`, `int`): sets the size. - `QWidget`: sets the parent widget """ def __init__(self, *rest): self.size = (600, 400) # get an optional parent widget parent = None for item in rest: if isinstance(item, QWidget): parent = item self.size = None QwtPlot.__init__(self, parent) # look self.setCanvasBackground(White) self.plotLayout().setAlignCanvasToScales(True) grid = QwtPlotGrid() grid.attach(self) grid.setPen(QPen(Black, 0, DotLine)) legend = QwtLegend() legend.setItemMode(Qwt.QwtLegend.ClickableItem) self.insertLegend(legend, Qwt.QwtPlot.RightLegend) # zooming self.zoomers = [] zoomer = QwtPlotZoomer(X1, Y1, QwtPicker.DragSelection, QwtPicker.AlwaysOff, self.canvas()) zoomer.setRubberBandPen(QPen(Black)) self.zoomers.append(zoomer) zoomer = Qwt.QwtPlotZoomer(X2, Y2, QwtPicker.DragSelection, QwtPicker.AlwaysOff, self.canvas()) zoomer.setRubberBand(QwtPicker.NoRubberBand) self.zoomers.append(zoomer) self.setZoomerMouseEventSet(0) # initialization for item in rest: if isinstance(item, Axis): self.plotAxis(item) elif isinstance(item, Curve): self.plotCurve(item) elif (isinstance(item, str) or isinstance(item, QString)): text = QwtText(item) font = QFont(Font) font.setPointSize(14) font.setBold(True) text.setFont(font) self.setTitle(text) elif isinstance(item, int): self.setZoomerMouseEventSet(item) elif (isinstance(item, tuple) and len(tuple) == 2 and isinstance(item[0], int) and isinstance(item[1], int)): self.size = item elif isinstance(item, QWidget): # accept a parent silently pass else: print("Plot() fails to accept %s." % item) if self.size: apply(self.resize, self.size) # connections self.connect(self, SIGNAL("legendClicked(QwtPlotItem*)"), self.toggleVisibility) # finalize self.show() # __init__() def plot(self, *rest): """Plot additional curves and/or axes. The interpretation of the `*rest` parameters is type dependent: - `Axis`: enables the axis. - `Curve`: adds a curve. """ for item in rest: if isinstance(item, Axis): self.plotAxis(item) elif isinstance(item, Curve): self.plotCurve(item) else: print("Plot.plot() fails to accept %s." % item) # plot() def plotAxis(self, axis): self.enableAxis(axis.orientation) engine = axis.engine() engine.setAttributes(axis.attributes) self.setAxisScaleEngine(axis.orientation, engine) if isinstance(engine, Log): self.setAxisMaxMinor(axis.orientation, 8) self.setAxisTitle(axis.orientation, axis.title) self.clearZoomStack() # plotAxis() def plotCurve(self, curve): c = QwtPlotCurve(curve.name) c.setAxis(curve.xAxis, curve.yAxis) if curve.pen: c.setPen(curve.pen) else: c.setStyle(QwtPlotCurve.NoCurve) if curve.symbol: c.setSymbol(curve.symbol) c.setData(curve.x, curve.y) c.attach(self) self.clearZoomStack() # plotCurve() def clearZoomStack(self): """Force autoscaling and clear the zoom stack """ self.setAxisAutoScale(Y1) self.setAxisAutoScale(Y2) self.setAxisAutoScale(X1) self.setAxisAutoScale(X2) self.replot() for zoomer in self.zoomers: zoomer.setZoomBase() # clearZoomStack() def setZoomerMouseEventSet(self, index): """Attach the Qwt.QwtPlotZoomer actions to a set of mouse events. """ if index == 0: pattern = [ QwtEventPattern.MousePattern(Qt.LeftButton, Qt.NoModifier), QwtEventPattern.MousePattern(Qt.MidButton, Qt.NoModifier), QwtEventPattern.MousePattern(Qt.RightButton, Qt.NoModifier), QwtEventPattern.MousePattern(Qt.LeftButton, Qt.ShiftModifier), QwtEventPattern.MousePattern(Qt.MidButton, Qt.ShiftModifier), QwtEventPattern.MousePattern(Qt.RightButton, Qt.ShiftModifier), ] for zoomer in self.zoomers: zoomer.setMousePattern(pattern) elif index in (1, 2, 3): for zoomer in self.zoomers: zoomer.initMousePattern(index) else: raise ValueError('index must be in (0, 1, 2, 3)') self.__mouseEventSet = index # setZoomerMouseEventSet() def getZoomerMouseEventSet(self): return self.__mouseEventSet # getZoomerMouseEventSet() def formatCoordinates(self, x, y): """Format mouse coordinates as real world plot coordinates. """ result = [] todo = ((Y1, "y0=%+.6g", y), (Y2, "y1=%+.6g", y), (X1, "x0=%+.6g", x), (X2, "x1=%+.6g", x), ) for axis, template, value in todo: if self.axisEnabled(axis): value = self.invTransform(axis, value) result.append(template % value) return result # formatCoordinates() def toggleVisibility(self, plotItem): """Toggle the visibility of a plot item """ plotItem.setVisible(not plotItem.isVisible()) self.replot() # toggleCurve() def gracePlot(self, saveall="", pause=0.2): """Clone the plot into Grace for very high quality hard copy output. Know bug: Grace does not scale the data correctly when Grace cannot cannot keep up with gracePlot. This happens when it takes too long to load Grace in memory (exit the Grace process and try again) or when 'pause' is too short. """ g = GraceProcess(debug = 0) g('subtitle "%s"' % self.title().text()) index = 0 for xAxis, yAxis, graph, xPlace, yPlace in ( (X1, Y1, 'g0', 'normal', 'normal'), (X1, Y2, 'g1', 'normal', 'opposite'), (X2, Y1, 'g2', 'opposite', 'normal'), (X2, Y2, 'g3', 'opposite', 'opposite') ): if not (self.axisEnabled(xAxis) and self.axisEnabled(yAxis)): continue g('%s on; with %s' % (graph, graph)) # x-axes if QWT_VERSION < 0x050200: xmin = self.axisScaleDiv(xAxis).lBound() xmax = self.axisScaleDiv(xAxis).hBound() else: xmin = self.axisScaleDiv(xAxis).lowerBound() xmax = self.axisScaleDiv(xAxis).upperBound() #majStep = minStep = axisScale.majStep() #majStep *= 2 g('world xmin %g; world xmax %g' % (xmin, xmax)) g('xaxis label "%s"; xaxis label char size 1.5' % self.axisTitle(xAxis).text()) g('xaxis label place %s' % xPlace) g('xaxis tick place %s' % xPlace) g('xaxis ticklabel place %s' % xPlace) time.sleep(pause) if isinstance(self.axisScaleEngine(xAxis), Log): g('xaxes scale Logarithmic') g('xaxis tick major 10') g('xaxis tick minor ticks 9') else: #print 'lin x-axis from %s to %s.' % (min, max) g('xaxes scale Normal') #g('xaxis tick major %12.6f; xaxis tick minor %12.6f' # % (majStep, minStep)) # y-axes if QWT_VERSION < 0x050200: ymin = self.axisScaleDiv(yAxis).lBound() ymax = self.axisScaleDiv(yAxis).hBound() else: ymin = self.axisScaleDiv(yAxis).lowerBound() ymax = self.axisScaleDiv(yAxis).upperBound() #majStep = minStep = axisScale.majStep() #majStep *= 2 g('world ymin %g; world ymax %g' % (ymin, ymax)) g('yaxis label "%s"; yaxis label char size 1.5' % self.axisTitle(yAxis).text()) g('yaxis label place %s' % yPlace) g('yaxis tick place %s' % yPlace) g('yaxis ticklabel place %s' % yPlace) time.sleep(pause) if isinstance(self.axisScaleEngine(yAxis), Log): #print 'log y-axis from %s to %s.' % (min, max) g('yaxes scale Logarithmic') g('yaxis tick major 10') g('yaxis tick minor ticks 9') else: #print 'lin y-axis from %s to %s.' % (min, max) g('yaxes scale Normal') #g('yaxis tick major %12.6f; yaxis tick minor %12.6f' % # (majStep, minStep)) # curves for curve in self.itemList(): if not isinstance(curve, QwtPlotCurve): continue if not curve.isVisible(): continue if not (xAxis == curve.xAxis() and yAxis == curve.yAxis()): continue g('s%s legend "%s"' % (index, curve.title().text())) #print "curve.symbol().style()", curve.symbol().style() if curve.symbol().style() > QwtSymbol.NoSymbol: g('s%s symbol 1;' 's%s symbol size 0.4;' 's%s symbol fill pattern 1' % (index, index, index)) #print "curve.style()", curve.style() if curve.style(): g('s%s line linestyle 1' % index) else: g('s%s line linestyle 0' % index) for i in range(curve.dataSize()): g('%s.s%s point %g, %g' % (graph, index, curve.x(i), curve.y(i))) index += 1 # finalize g('redraw') if saveall: time.sleep(pause) g('saveall "%s"' % saveall) time.sleep(pause) g.kill() # gracePlot() # class Plot class Curve: """A command line friendly layer over `QwtPlotCurve`. Parameters: - `x`: sequence of numbers - `y`: sequence of numbers The interpretation of the `*rest` parameters is type dependent: - `Axis`: attaches an axis to the curve. - `Pen`: sets the pen to connect the data points. - `Symbol`: sets the symbol to draw the data points. - `str`, `QString`, or `QwtText`: sets the curve title. """ def __init__(self, x, y, *rest): self.x = x self.y = y self.xAxis, self.yAxis = X1, Y1 self.pen = None self.symbol = None self.name = "" for item in rest: if isinstance(item, QwtPlot.Axis): if item in (X1, X2): self.xAxis = item elif item in (Y1, Y2): self.yAxis = item elif isinstance(item, Pen): self.pen = item elif isinstance(item, Symbol): self.symbol = item elif (isinstance(item, str) or isinstance(item, QString)): self.name = item else: print("Curve fails to accept %s." % item) if not self.symbol and not self.pen: self.pen = QPen() # __init__() class Axis: """A command line interpreter friendly class. The interpretation of the `*rest` parameters is type dependent: - `QwtPlot.Axis`: sets the orientation of the axis. - `QwtScaleEngine`: sets the axis type (Lin or Log). - `int` : sets the attributes of the axis. - `string` or `QString`: sets the title of the axis. """ def __init__(self, *rest): self.attributes = NoAttribute self.engine = QwtLinearScaleEngine self.title = QwtText('') font = QFont(Font) font.setPointSize(12) font.setBold(True) self.title.setFont(font) for item in rest: if isinstance(item, QwtPlot.Axis): self.orientation = item elif item in [Lin, Log]: self.engine = item elif isinstance(item, int): self.attributes = item elif (isinstance(item, str) or isinstance(item, QString)): self.title.setText(item) else: print("Axis() fails to accept %s." % item) # __init__() # class Axis class Symbol(QwtSymbol): """A command line friendly layer over `QwtSymbol`. The interpretation of the `*rest` parameters is type dependent: - `QColor` or `Qt.GlobalColor`: sets the symbol fill color. - `QwtSymbol.Style`: sets symbol style. - `int`: sets the symbol size. """ def __init__(self, *rest): QwtSymbol.__init__(self) self.setSize(5) for item in rest: if isinstance(item, (QColor, Qt.GlobalColor)): brush = self.brush() brush.setColor(item) self.setBrush(brush) elif isinstance(item, QwtSymbol.Style): self.setStyle(item) elif isinstance(item, int): self.setSize(item) else: print("Symbol fails to accept %s." % item) # __init__() # class Symbol class Pen(QPen): """A command line friendly layer over `QPen`. The interpretation of the `*rest` parameters is type dependent: - `Qt.PenStyle`: sets the pen style. - `QColor` or `Qt.GlobalColor`: sets the pen color. - `int`: sets the pen width. """ def __init__(self, *rest): QPen.__init__(self) for item in rest: if isinstance(item, Qt.PenStyle): self.setStyle(item) elif isinstance(item, (QColor, Qt.GlobalColor)): self.setColor(item) elif isinstance(item, int): self.setWidth(item) else: print("Pen fails to accept %s." % item) # __init__() # class Pen print_xpm = [ '32 32 12 1', 'a c #ffffff', 'h c #ffff00', 'c c #ffffff', 'f c #dcdcdc', 'b c #c0c0c0', 'j c #a0a0a4', 'e c #808080', 'g c #808000', 'd c #585858', 'i c #00ff00', '# c #000000', '. c None', '................................', '................................', '...........###..................', '..........#abb###...............', '.........#aabbbbb###............', '.........#ddaaabbbbb###.........', '........#ddddddaaabbbbb###......', '.......#deffddddddaaabbbbb###...', '......#deaaabbbddddddaaabbbbb###', '.....#deaaaaaaabbbddddddaaabbbb#', '....#deaaabbbaaaa#ddedddfggaaad#', '...#deaaaaaaaaaa#ddeeeeafgggfdd#', '..#deaaabbbaaaa#ddeeeeabbbbgfdd#', '.#deeefaaaaaaa#ddeeeeabbhhbbadd#', '#aabbbeeefaaa#ddeeeeabbbbbbaddd#', '#bbaaabbbeee#ddeeeeabbiibbadddd#', '#bbbbbaaabbbeeeeeeabbbbbbaddddd#', '#bjbbbbbbaaabbbbeabbbbbbadddddd#', '#bjjjjbbbbbbaaaeabbbbbbaddddddd#', '#bjaaajjjbbbbbbaaabbbbadddddddd#', '#bbbbbaaajjjbbbbbbaaaaddddddddd#', '#bjbbbbbbaaajjjbbbbbbddddddddd#.', '#bjjjjbbbbbbaaajjjbbbdddddddd#..', '#bjaaajjjbbbbbbjaajjbddddddd#...', '#bbbbbaaajjjbbbjbbaabdddddd#....', '###bbbbbbaaajjjjbbbbbddddd#.....', '...###bbbbbbaaajbbbbbdddd#......', '......###bbbbbbjbbbbbddd#.......', '.........###bbbbbbbbbdd#........', '............###bbbbbbd#.........', '...............###bbb#..........', '..................###...........', ] grace_xpm = [ '48 39 6 1', ' c #000000000000', '. c #FFFFFFFFFFFF', 'X c #BEFBBEFBBEFB', 'o c #51445144FFFF', 'O c #FFFF14514103', '+ c #0000AAAA1861', ' ', ' .............................................. ', ' .............................................. ', ' ............... ............. ', ' .............................................. ', ' ................. ............... ', ' .............................................. ', ' ....... ...... ', ' ....... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ...... ', ' ....... XXXXXXXXXXXXXXXXXXXXXXXXXXoXXXX ...... ', ' ..... . XXoooXX XXXXXXXXXXXoooXXXX ...... ', ' .. .... XXXXXXXXXXXXXXXXXXXXXXXXoXooOXX ...... ', ' .. .... XXOOOXX XXXXXXXXXXXXoXOoXXX ...... ', ' .. .... XXXXXXXXXXXXXXXXXXXXXXXoOOXooXX ...... ', ' .. .... XX+++XX XXXXooXXXXOoXXXXoXX ...... ', ' .. .. . XXXXXXXXXXXXXXXoXoXXXOoXXXXXXXX ...... ', ' .. .... XXXXXXXXXXXXXXXoXoXOOooXXXXXXXX ...... ', ' .. .... XXXXXXXXXXXXXXoXXooXXoXXXXXXXXX ...... ', ' .. .... XXXXXXXoXXXXXooXOOoXoXXXXXXXXXX ...... ', ' .. .... XXXXXXooXXXXXoOOXXooXXXXXXXXXXX ...... ', ' .. .. . XXXXXXoXoXXXoOXXXXXXXXXXXXXXXXX ...... ', ' .. .... XXXXXooXoXXOoXXXXXXXXXXXXXXXXXX ...... ', ' .. .... XXXXooXXooOooXXXXXXXXXXXXXXXXXX ...... ', ' .. .... XXXXoXXOOoXoXXXXXXXXXX+++++XXXX ...... ', ' .. .... XXXXoXOXXoXoXXXXXXXXXX+++++XXXX ...... ', ' .. .. . XXXooOXXXXoXXXX+++++XX+++++XXXX ...... ', ' .. .... XXOoXXXXXXXXXXX+++++XX+++++XXXX ...... ', ' .. .... XOoXXXXX+++++XX+++++XX+++++XXXX ...... ', ' .. .... XXoXXXXX+++++XX+++++XX+++++XXXX ...... ', ' ....... XooXXXXX+++++XX+++++XX+++++XXXX ...... ', ' ..... . XXXXXXXX+++++XX+++++XX+++++XXXX ...... ', ' ....... ...... ', ' .............................................. ', ' ........ .... .... .... .... .... .... ....... ', ' .............................................. ', ' .............. ............ ', ' .............................................. ', ' .............................................. ', ' ', ] class IPlot(QMainWindow): """A QMainWindow widget with a Plot widget as central widget. It provides: #. a toolbar for printing and piping into Grace. #. a legend with control to toggle curves between hidden and shown. #. mouse tracking to display the coordinates in the status bar. #. an infinite stack of zoom regions. The interpretation of the `rest` parameters is type dependent: - `Axis`: enables the axis. - `Curve`: adds a curve. - `str` or `QString`: sets the title. - `int`: sets a set of mouse events to the zoomer actions. - (`int`, `int`): sets the size. """ def __init__(self, *rest): QMainWindow.__init__(self) self.__plot = Plot(self, *rest) self.setCentralWidget(self.__plot) toolBar = QToolBar(self) self.addToolBar(toolBar) printButton = QToolButton(toolBar) printButton.setText("Print") printButton.setIcon(QIcon(QPixmap(print_xpm))) toolBar.addWidget(printButton) toolBar.addSeparator() graceButton = QToolButton(toolBar) graceButton.setText("Grace") graceButton.setIcon(QIcon(QPixmap(grace_xpm))) toolBar.addWidget(graceButton) toolBar.addSeparator() mouseComboBox = QComboBox(toolBar) for name in ('3 buttons (PyQwt)', '1 button', '2 buttons', '3 buttons (Qwt)'): mouseComboBox.addItem(name) mouseComboBox.setCurrentIndex(self.__plot.getZoomerMouseEventSet()) toolBar.addWidget(mouseComboBox) toolBar.addSeparator() action = QWhatsThis.createAction(toolBar) toolBar.addAction(action) toolBar.addSeparator() self.connect(printButton, SIGNAL('clicked()'), self.printPlot) self.connect(graceButton, SIGNAL('clicked()'), self.__plot.gracePlot) self.connect(mouseComboBox, SIGNAL('activated(int)'), self.__plot.setZoomerMouseEventSet) self.connect(Tracker(self.__plot.canvas()), SIGNAL("MouseMoveTracked"), self.showCoordinates) self.statusBar().showMessage("Move the mouse within the plot canvas" " to show the cursor position.") printButton.setWhatsThis( 'Print to a printer or an (E)PS file.' ) graceButton.setWhatsThis( 'Clone the plot into Grace.\n\n' 'The hardcopy output of Grace is better for\n' 'scientific journals and LaTeX documents.' ) mouseComboBox.setWhatsThis( 'Configure the mouse events for the QwtPlotZoomer.\n\n' '3 buttons (PyQwt style):\n' '- left-click & drag to zoom\n' '- middle-click to unzoom all\n' '- right-click to walk down the stack\n' '- shift-right-click to walk up the stack.\n' '1 button:\n' '- click & drag to zoom\n' '- control-click to unzoom all\n' '- alt-click to walk down the stack\n' '- shift-alt-click to walk up the stack.\n' '2 buttons:\n' '- left-click & drag to zoom\n' '- right-click to unzoom all\n' '- alt-left-click to walk down the stack\n' '- alt-shift-left-click to walk up the stack.\n' '3 buttons (Qwt style):\n' '- left-click & drag to zoom\n' '- right-click to unzoom all\n' '- middle-click to walk down the stack\n' '- shift-middle-click to walk up the stack.\n\n' 'If some of those key combinations interfere with\n' 'your Window manager, press the:\n' '- escape-key to unzoom all\n' '- minus-key to walk down the stack\n' '- plus-key to walk up the stack.' ) self.__plot.legend().setWhatsThis( 'Clicking on a legend button toggles\n' 'a curve between hidden and shown.' ) self.__plot.canvas().setWhatsThis( 'Clicking on a legend button toggles a curve\n' 'between hidden and shown.\n\n' 'A QwtPlotZoomer lets you zoom infinitely deep\n' 'by saving the zoom states on a stack. You can:\n' '- select a zoom region\n' '- unzoom all\n' '- walk down the stack\n' '- walk up the stack.\n\n' 'The combo box in the toolbar lets you attach\n' 'different sets of mouse events to those actions.' ) self.resize(700, 500) self.show() # __init__() def plot(self, *rest): self.__plot.plot(*rest) # plot() def printPlot(self): printer = QPrinter(QPrinter.HighResolution) printer.setColorMode(QPrinter.Color) printDialog = QPrintDialog(printer) if printDialog.exec_(): self.__plot.print_(printer) # printPlot() def showCoordinates(self, position): self.statusBar().showMessage(' -- '.join( self.__plot.formatCoordinates(position.x(), position.y()))) # showCoordinates() def __getattr__(self, attr): """Inherit everything from Plot """ if hasattr(self.__plot, attr): return getattr(self.__plot, attr) else: raise AttributeError('%s has no attribute named %s' % (self.__class__.__name__, attr)) # __getattr__() # class IPlot # Admire! def testPlot(): if 'np' not in dir(): import anynumpy as np x = np.arange(-2*np.pi, 2*np.pi, 0.01) p = Plot(Axis(Bottom, "linear x-axis"), Axis(Left, "linear y-axis"), Axis(Right, Log, "logarithmic y-axis"), Curve(x, np.cos(x), Pen(Magenta, 2), "cos(x)"), Curve(x, np.exp(x), Pen(Red), "exp(x)", Right), "PyQwt using Qt-%s and Qwt-%s" % (QT_VERSION_STR, QWT_VERSION_STR), ) x = x[0:-1:10] p.plot( Curve(x, np.cos(x-np.pi/4), Symbol(Circle, Yellow), "circle"), Curve(x, np.cos(x+np.pi/4), Pen(Blue), Symbol(Square, Cyan), "square"), ) return p # testPlot() def testIPlot(): if 'np' not in dir(): import anynumpy as np x = np.arange(-2*np.pi, 2*np.pi, 0.01) p = IPlot(Axis(Bottom, "linear x-axis"), Axis(Left, "linear y-axis"), Axis(Right, Log, "logarithmic y-axis"), Curve(x, np.cos(x), Pen(Magenta, 2), "cos(x)"), Curve(x, np.exp(x), Pen(Red), "exp(x)", Right), "PyQwt using Qt-%s and Qwt-%s"% (QT_VERSION_STR, QWT_VERSION_STR), ) x = x[0:-1:10] p.plot( Curve(x, np.cos(x-np.pi/4), Symbol(Circle, Yellow), "circle"), Curve(x, np.cos(x+np.pi/4), Pen(Blue), Symbol(Square, Cyan), "square"), ) return p # testIPlot() def standard_map(x, y, kappa, n): if 'np' not in dir(): import anynumpy as np xs = np.zeros(n, np.Float) ys = np.zeros(n, np.Float) for i in range(n): xs[i] = x ys[i] = y xn = y - kappa*np.sin(2.0*np.pi*x) yn = x + y if (xn > 1.0) or (xn < 0.0): x = xn - np.floor(xn) else: x = xn if (yn > 1.0) or (yn < 0.0): y = yn - np.floor(yn) else: y = yn return xs, ys # standard_map() def testStandardMap(): import random x = random.random() y = random.random() kappa = random.random() print("x = %s, y = %s, kappa = %s" % (x, y, kappa)) xs, ys = standard_map(x, y, kappa, 1 << 18) title = "PyQwt using Qt-%s and Qwt-%s" % (QT_VERSION_STR, QWT_VERSION_STR) p = IPlot(Curve(xs, ys, Symbol(Circle, Red), "standard_map"), title) return p # testStandardMap() if __name__ == '__main__': a = QApplication(sys.argv) p1, p2, p3 = testPlot(), testIPlot(), testStandardMap() a.exec_() # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/Qwt5/grace.py0000444000175000017500000000644611264104533020325 0ustar poxpox#!/usr/bin/env python # # Copyright (C) 2003-2009 Gerard Vermeulen # # This file is part of PyQwt. # # PyQwt is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PyQwt is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # In addition, as a special exception, Gerard Vermeulen gives permission # to link PyQwt dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt in this form, provided that equally powerful # versions of Qt and PyQt have been released under the terms of the GNU # General Public License. # # If PyQwt is dynamically linked with non-free versions of Qt and PyQt, # PyQwt becomes a free plug-in for a non-free program. import subprocess import sys if sys.version_info[:2] < (2, 6): import os import signal class GraceProcess: """Provides a simple interface to a Grace subprocess.""" def __init__ (self, debug = None): self.debug = debug self.p = subprocess.Popen( ["xmgrace", "-nosafe", "-noask", "-dpipe", "0"], stdin=subprocess.PIPE, close_fds=True) self.command("view xmin 0.15") self.command("view xmax 0.85") self.command("view ymin 0.15") self.command("view ymax 0.85") self.flush() # __init__() def command(self, text): if self.debug: print(text) self.p.stdin.write(text + '\n') self.flush() # command() def flush(self): self.p.stdin.flush() # flush() def wait(self): return self.p.wait() # wait() def kill(self): if sys.version_info[:2] < (2, 6): os.kill(self.p.pid, signal.SIGKILL) else: self.p.kill() # kill() def __call__(self, text): self.command(text) # __call__() # class GraceProcess if __name__ == '__main__': import time g = GraceProcess() g('world xmax 100') g('world ymax 10000') g('xaxis tick major 20') g('xaxis tick minor 10') g('yaxis tick major 2000') g('yaxis tick minor 1000') g('s0 on') g('s0 symbol 1') g('s0 symbol size 0.3') g('s0 symbol fill pattern 1') g('s1 on') g('s1 symbol 1') g('s1 symbol size 0.3') g('s1 symbol fill pattern 1') # Display sample data for i in range(1,101): g('g0.s0 point %d, %d' % (i, i)) g('g0.s1 point %d, %d' % (i, i * i)) # Update the Grace display after every ten steps if i % 10 == 0: g('redraw') # Wait a second, just to simulate some time needed for # calculations. Your real application shouldn't wait. time.sleep(1) # Tell Grace to save the data: g('saveall "sample.agr"') # Close Grace: g.wait() # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4lib/PyQt4/Qwt5/anynumpy.py0000444000175000017500000000201611264104533021111 0ustar poxpox# import either NumPy, or numarray, or Numeric for name in ('numpy', 'numarray', 'Numeric'): failed = False try: eval(compile('from %s import *' % name, 'eval', 'exec')) if name == 'numpy': from numpy.oldnumeric.compat import * Float = float UInt8 = uint8 except ImportError: failed = True if not failed: break else: import PyQt4.Qt as Qt if not Qt.QCoreApplication.instance(): a = Qt.QApplication([]) Qt.QMessageBox.critical( None, 'Numerical Python Extension Required', 'This example requires a Numerical Python Extension, but\n' 'failed to import either NumPy, or numarray, or Numeric.\n' 'NumPy is available at http://sourceforge.net/projects/numpy' ) raise SystemExit( 'Failed to import either NumPy, or numarray, or Numeric.\n' 'NumPy is available at http://sourceforge.net/projects/numpy' ) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/include-5.2.0/0000755000175000017500000000000011275562660015740 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/include-5.2.0/qwt_plot_rescaler.h0000444000175000017500000000710111234406472021630 0ustar poxpox/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann * * This library is free software; you can redistribute it and/or * modify it under the terms of the Qwt License, Version 1.0 *****************************************************************************/ #ifndef QWT_PLOT_RESCALER_H #define QWT_PLOT_RESCALER_H 1 #include "qwt_global.h" #include "qwt_double_rect.h" #include "qwt_double_interval.h" #include "qwt_plot.h" #include class QwtPlotCanvas; class QResizeEvent; /*! \brief QwtPlotRescaler takes care of fixed aspect ratios for plot scales QwtPlotRescaler autoadjusts the axes of a QwtPlot according to fixed aspect ratios. */ class QWT_EXPORT QwtPlotRescaler: public QObject { public: /*! \brief Rescale Policy The rescale policy defines how to rescale the reference axis and their depending axes. - Fixed The interval of the reference axis remains unchanged, when the geometry of the canvas changes. All other axes will be adjusted according to their aspect ratio. - Expanding The interval of the reference axis will be shrinked/expanded, when the geometry of the canvas changes. All other axes will be adjusted according to their aspect ratio. The interval, that is represented by one pixel is fixed. - Fitting The intervals of the axes are calculated, so that all axes include their minimal interval. */ enum RescalePolicy { Fixed, Expanding, Fitting }; enum ExpandingDirection { ExpandUp, ExpandDown, ExpandBoth }; explicit QwtPlotRescaler(QwtPlotCanvas *, int referenceAxis = QwtPlot::xBottom, RescalePolicy = Expanding ); virtual ~QwtPlotRescaler(); void setEnabled(bool); bool isEnabled() const; void setRescalePolicy(RescalePolicy); RescalePolicy rescalePolicy() const; void setExpandingDirection(ExpandingDirection); void setExpandingDirection(int axis, ExpandingDirection); ExpandingDirection expandingDirection(int axis) const; void setReferenceAxis(int axis); int referenceAxis() const; void setAspectRatio(double ratio); void setAspectRatio(int axis, double ratio); double aspectRatio(int axis) const; void setIntervalHint(int axis, const QwtDoubleInterval&); QwtDoubleInterval intervalHint(int axis) const; QwtPlotCanvas *canvas(); const QwtPlotCanvas *canvas() const; QwtPlot *plot(); const QwtPlot *plot() const; virtual bool eventFilter(QObject *, QEvent *); void rescale() const; protected: virtual void canvasResizeEvent(QResizeEvent *); virtual void rescale(const QSize &oldSize, const QSize &newSize) const; virtual QwtDoubleInterval expandScale( int axis, const QSize &oldSize, const QSize &newSize) const; virtual QwtDoubleInterval syncScale( int axis, const QwtDoubleInterval& reference, const QSize &size) const; virtual void updateScales( QwtDoubleInterval intervals[QwtPlot::axisCnt]) const; Qt::Orientation orientation(int axis) const; QwtDoubleInterval interval(int axis) const; QwtDoubleInterval expandInterval(const QwtDoubleInterval &, double width, ExpandingDirection) const; private: double pixelDist(int axis, const QSize &) const; class AxisData; class PrivateData; PrivateData *d_data; }; #endif pyqwt5-5.2.1~cvs20091107+dfsg/test/0000755000175000017500000000000011275562661014635 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/test/test_numeric.py0000555000175000017500000000607411234231736017707 0ustar poxpox#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import Numeric as np from PyQt4.Qt import * from PyQt4.Qwt5 import * class TestImageConversionFunctions(unittest.TestCase): def testHorizontalLinesARGB32(self): colors = (Qt.red, Qt.green, Qt.blue, Qt.white, Qt.black) alpha = 0xff000000 red = 0x00ff0000 green = 0x0000ff00 blue = 0x000000ff white = 0x00ffffff black = 0x00000000 image = QImage(3, len(colors), QImage.Format_ARGB32) painter = QPainter(image) for i, color in enumerate(colors): painter.setPen(color) painter.drawLine(0, i, image.width(), i) del painter array = np.zeros((image.height(), image.width()), np.UInt32) array[0,:] = alpha|red array[1,:] = alpha|green array[2,:] = alpha|blue array[3,:] = alpha|white array[4,:] = alpha|black self.assertEqual(array == toNumpy(image), True) self.assertEqual(image == toQImage(array), True) # testHorizontalLinesARGB32() def testVerticalLinesARGB32(self): colors = (Qt.red, Qt.green, Qt.blue) alpha = 0xff000000 red = 0x00ff0000 green = 0x0000ff00 blue = 0x000000ff image = QImage(len(colors), 5, QImage.Format_ARGB32) painter = QPainter(image) for i, color in enumerate(colors): painter.setPen(color) painter.drawLine(i, 0, i, image.height()) del painter array = np.zeros((image.height(), image.width()), np.UInt32) array[:,0] = alpha|red array[:,1] = alpha|green array[:,2] = alpha|blue self.assertEqual(array == toNumpy(image), True) self.assertEqual(image == toQImage(array), True) # testVerticalLinesARGB32() def testHorizontalLinesIndexed8(self): image = QImage(3, 5, QImage.Format_Indexed8) image.setColorTable([qRgb(i, i, i) for i in range(256)]) for i in range(image.height()): for j in range(image.width()): image.setPixel(j, i, i) array = np.zeros((image.height(), image.width()), np.UInt8) for i in range(image.height()): array[i,:] = i self.assertEqual(array == toNumpy(image), True) self.assertEqual(image == toQImage(array), True) # testHorizontalLinesIndexed8() def testVerticalLinesIndexed8(self): image = QImage(5, 3, QImage.Format_Indexed8) image.setColorTable([qRgb(i, i, i) for i in range(256)]) for i in range(image.width()): for j in range(image.height()): image.setPixel(i, j, i) array = np.zeros((image.height(), image.width()), np.UInt8) for i in range(image.width()): array[:,i] = i self.assertEqual(array == toNumpy(image), True) self.assertEqual(image == toQImage(array), True) # testVerticalLinesIndexed8() # class TestImageConversionFunctions if __name__ == '__main__': unittest.main() # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/test/test_numarray.py0000555000175000017500000000616511234231736020104 0ustar poxpox#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import numarray as np from PyQt4.Qt import * from PyQt4.Qwt5 import * class TestImageConversionFunctions(unittest.TestCase): def testHorizontalLinesARGB32(self): colors = (Qt.red, Qt.green, Qt.blue, Qt.white, Qt.black) alpha = 0xff000000 red = 0x00ff0000 green = 0x0000ff00 blue = 0x000000ff white = 0x00ffffff black = 0x00000000 image = QImage(3, len(colors), QImage.Format_ARGB32) painter = QPainter(image) for i, color in enumerate(colors): painter.setPen(color) painter.drawLine(0, i, image.width(), i) del painter array = np.zeros((image.height(), image.width()), dtype=np.UInt32) array[0,:] = alpha|red array[1,:] = alpha|green array[2,:] = alpha|blue array[3,:] = alpha|white array[4,:] = alpha|black self.assertEqual(np.all(array == toNumpy(image)), True) self.assertEqual(image == toQImage(array), True) # testHorizontalLinesARGB32() def testVerticalLinesARGB32(self): colors = (Qt.red, Qt.green, Qt.blue) alpha = 0xff000000 red = 0x00ff0000 green = 0x0000ff00 blue = 0x000000ff image = QImage(len(colors), 5, QImage.Format_ARGB32) painter = QPainter(image) for i, color in enumerate(colors): painter.setPen(color) painter.drawLine(i, 0, i, image.height()) del painter array = np.zeros((image.height(), image.width()), dtype=np.UInt32) array[:,0] = alpha|red array[:,1] = alpha|green array[:,2] = alpha|blue self.assertEqual(np.all(array == toNumpy(image)), True) self.assertEqual(image == toQImage(array), True) # testVerticalLinesARGB32() def testHorizontalLinesIndexed8(self): image = QImage(3, 5, QImage.Format_Indexed8) image.setColorTable([qRgb(i, i, i) for i in range(256)]) for i in range(image.height()): for j in range(image.width()): image.setPixel(j, i, i) array = np.zeros((image.height(), image.width()), dtype=np.UInt8) for i in range(image.height()): array[i,:] = i self.assertEqual(np.all(array == toNumpy(image)), True) self.assertEqual(image == toQImage(array), True) # testHorizontalLinesIndexed8() def testVerticalLinesIndexed8(self): image = QImage(5, 3, QImage.Format_Indexed8) image.setColorTable([qRgb(i, i, i) for i in range(256)]) for i in range(image.width()): for j in range(image.height()): image.setPixel(i, j, i) array = np.zeros((image.height(), image.width()), dtype=np.UInt8) for i in range(image.width()): array[:,i] = i self.assertEqual(np.all(array == toNumpy(image)), True) self.assertEqual(image == toQImage(array), True) # testVerticalLinesIndexed8() # class TestImageConversionFunctions if __name__ == '__main__': unittest.main() # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/test/test_numpy.py0000555000175000017500000000616211233762711017414 0ustar poxpox#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import numpy as np from PyQt4.Qt import * from PyQt4.Qwt5 import * class TestImageConversionFunctions(unittest.TestCase): def testHorizontalLinesARGB32(self): colors = (Qt.red, Qt.green, Qt.blue, Qt.white, Qt.black) alpha = 0xff000000 red = 0x00ff0000 green = 0x0000ff00 blue = 0x000000ff white = 0x00ffffff black = 0x00000000 image = QImage(3, len(colors), QImage.Format_ARGB32) painter = QPainter(image) for i, color in enumerate(colors): painter.setPen(color) painter.drawLine(0, i, image.width(), i) del painter array = np.zeros((image.height(), image.width()), dtype=np.uint32) array[0,:] = alpha|red array[1,:] = alpha|green array[2,:] = alpha|blue array[3,:] = alpha|white array[4,:] = alpha|black self.assertEqual(np.all(array == toNumpy(image)), True) self.assertEqual(image == toQImage(array), True) # testHorizontalLinesARGB32() def testVerticalLinesARGB32(self): colors = (Qt.red, Qt.green, Qt.blue) alpha = 0xff000000 red = 0x00ff0000 green = 0x0000ff00 blue = 0x000000ff image = QImage(len(colors), 5, QImage.Format_ARGB32) painter = QPainter(image) for i, color in enumerate(colors): painter.setPen(color) painter.drawLine(i, 0, i, image.height()) del painter array = np.zeros((image.height(), image.width()), dtype=np.uint32) array[:,0] = alpha|red array[:,1] = alpha|green array[:,2] = alpha|blue self.assertEqual(np.all(array == toNumpy(image)), True) self.assertEqual(image == toQImage(array), True) # testVerticalLinesARGB32() def testHorizontalLinesIndexed8(self): image = QImage(3, 5, QImage.Format_Indexed8) image.setColorTable([qRgb(i, i, i) for i in range(256)]) for i in range(image.height()): for j in range(image.width()): image.setPixel(j, i, i) array = np.zeros((image.height(), image.width()), dtype=np.uint8) for i in range(image.height()): array[i,:] = i self.assertEqual(np.all(array == toNumpy(image)), True) self.assertEqual(image == toQImage(array), True) # testHorizontalLinesIndexed8() def testVerticalLinesIndexed8(self): image = QImage(5, 3, QImage.Format_Indexed8) image.setColorTable([qRgb(i, i, i) for i in range(256)]) for i in range(image.width()): for j in range(image.height()): image.setPixel(i, j, i) array = np.zeros((image.height(), image.width()), dtype=np.uint8) for i in range(image.width()): array[:,i] = i self.assertEqual(np.all(array == toNumpy(image)), True) self.assertEqual(image == toQImage(array), True) # testVerticalLinesIndexed8() # class TestImageConversionFunctions if __name__ == '__main__': unittest.main() # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/COPYING0000444000175000017500000004312210411526316014675 0ustar poxpox GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. pyqwt5-5.2.1~cvs20091107+dfsg/MANIFEST.in0000444000175000017500000000213711234406472015405 0ustar poxpox# MANIFEST template file to make a distribution tarball # package stuff include ANNOUNCEMENT-5.2.0 COPYING* include MANIFEST.in GNUmakefile pyqwt-5.2.patch # configure include configure/configure.py include configure/PyQwt.nsi.in include configure/configqt.bat # fixed Qwt-5.2.0 headers graft include-5.2.0 recursive-exclude include-5.2.0 .cvsignore *~ # PyQwt python code for PyQt/Qt3 graft qt3lib recursive-exclude qt3lib .cvsignore *~ # PyQwt python code for PyQt4/Qt4 graft qt4lib recursive-exclude qt4lib .cvsignore *~ # Qt3 examples graft qt3examples recursive-exclude qt3examples *.html *.png *.pyc *.svg .cvsignore *~ typescript # Qt4 examples graft qt4examples recursive-exclude qt4examples *.html *.png *.pyc *.svg .cvsignore *~ typescript # support code graft support recursive-exclude suppport .cvsignore *~ # qwt-svn graft qwt-5.2 recursive-exclude qwt-5.2 *~ # sip files graft sip recursive-exclude sip .cvsignore *~ # tests include tests/test_*.py # Documentation graft sphinx recursive-exclude sphinx static *.doctree *.pickle .cvsignore *~ # Local Variables: *** # mode: sh *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/pyqwt-5.2.patch0000444000175000017500000000212611226124437016353 0ustar poxpox--- qwt-5.2/qwtconfig.pri.pyqwt Sat Jul 11 16:59:22 2009 +++ qwt-5.2/qwtconfig.pri Sat Jul 11 16:59:23 2009 @@ -48,7 +48,7 @@ # might need a debug version. # Enable debug_and_release + build_all if you want to build both. - CONFIG += debug # release/debug/debug_and_release + CONFIG += release # release/debug/debug_and_release #CONFIG += debug_and_release #CONFIG += build_all } @@ -75,7 +75,7 @@ # it will be a static library. ###################################################################### -CONFIG += QwtDll +# CONFIG += QwtDll ###################################################################### # QwtPlot enables all classes, that are needed to use the QwtPlot @@ -97,7 +97,7 @@ # QwtSVGItem. ###################################################################### -#CONFIG += QwtSVGItem +CONFIG += QwtSVGItem ###################################################################### # If you have a commercial license you can use the MathML renderer pyqwt5-5.2.1~cvs20091107+dfsg/pyqwt-5.1.patch0000444000175000017500000000211011163735136016347 0ustar poxpox--- qwt-5.1/qwtconfig.pri.pyqwt Sat Mar 28 16:35:07 2009 +++ qwt-5.1/qwtconfig.pri Sat Mar 28 16:35:11 2009 @@ -75,7 +75,7 @@ # it will be a static library. ###################################################################### -CONFIG += QwtDll +# CONFIG += QwtDll ###################################################################### # QwtPlot enables all classes, that are needed to use the QwtPlot @@ -97,7 +97,7 @@ # QwtSVGItem. ###################################################################### -#CONFIG += QwtSVGItem +CONFIG += QwtSVGItem ###################################################################### # If you have a commercial license you can use the MathML renderer --- qwt-5.1/src/qwt_global.h.pyqwt Sat Mar 28 16:35:06 2009 +++ qwt-5.1/src/qwt_global.h Sun Mar 29 20:07:51 2009 @@ -19,8 +19,8 @@ // QWT_VERSION is (major << 16) + (minor << 8) + patch. -#define QWT_VERSION 0x050102 -#define QWT_VERSION_STR "5.1.2" +#define QWT_VERSION 0x050103 +#define QWT_VERSION_STR "5.1.3" #if defined(Q_WS_WIN) pyqwt5-5.2.1~cvs20091107+dfsg/Doc/0000755000175000017500000000000011275562661014363 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/Doc/pyqwt/0000755000175000017500000000000011275562661015547 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/Doc/pyqwt/QwtArrayDoubleExample.txt0000444000175000017500000000115610434023150022507 0ustar poxpox>>> import PyQt4.Qwt5 as Qwt >>> import numpy as NP >>> a = Qwt.QwtArrayDouble(NP.arange(10, 20, 4)) >>> for i in a: # thanks to __getitem__ ... print i ... 10.0 14.0 18.0 >>> for i in range(len(a)): # thanks to __len__ ... print a[i] # thanks to __getitem__ ... 10.0 14.0 18.0 >>> for i in range(len(a)): # thanks to __len__ ... a[i] = 10+3*i # thanks to __setitem__ ... >>> for i in a: # thanks to __getitem__ ... print i ... 10.0 13.0 16.0 >>> pyqwt5-5.2.1~cvs20091107+dfsg/Doc/pyqwt/qplt.example0000444000175000017500000000163311016344204020065 0ustar poxpox>>> x = np.arange(-2*np.pi, 2*np.pi, 0.01) # 1 >>> p = Plot(Curve(x, np.cos(x), Pen(Magenta, 2), "cos(x)"), # 2 ... Axis(Bottom, "x axis"), # 3 ... Axis(Left, "y axis"), # 4 ... Axis(Right, Log), # 5 ... Curve(x, np.exp(x), Pen(Red), "exp(x)", Right), # 6 ... ("PyQwt demo based on Qwt-%s (http://qwt.sf.net)" # 7 ... % QWT_VERSION_STR)) # 8 >>> x = x[0:-1:10] # 9 >>> p.plot(Curve(x, np.cos(x-np.pi/4), # 10 ... Symbol(Circle, Yellow), "circle"), # 11 ... Curve(x, np.cos(x+np.pi/4), # 12 ... Pen(Blue), Symbol(Square, Cyan), "square")) # 13 pyqwt5-5.2.1~cvs20091107+dfsg/Doc/pyqwt/pyqwt.tex0000444000175000017500000011051411020545425017440 0ustar poxpox\documentclass{manual} % Links \newcommand{\mailinglist}{\ulink{mailing list} {mailto:pyqwt-users@lists.sourceforge.net}} \newcommand{\Qwt}{\ulink{Qwt} {http://qwt.sourceforge.net}} \newcommand{\Grace}{\ulink{Grace} {http://plasma-gate.weizmann.ac.il/Grace/}} \newcommand{\target}{5.1.0} % Source code \newcommand{\Download}{\ulink{download} {http://pyqwt.sourceforge.net/download.html}} \newcommand{\Sip}{\ulink{sip-4.7.6.tar.gz} {http://pyqwt.sourceforge.net/support/sip-4.7.6.tar.gz}} \newcommand{\PyQtGpl}{\ulink{PyQt-x11-gpl-3.17.4.tar.gz} {http://pyqwt.sourceforge.net/support/PyQt-x11-gpl-3.17.4.tar.gz}} \newcommand{\PyQtMac}{\ulink{PyQt-mac-gpl-3.17.4.tar.gz} {http://pyqwt.sourceforge.net/support/PyQt-mac-gpl-3.17.4.tar.gz}} \newcommand{\PyQtFourGpl}{\ulink{PyQt-x11-gpl-4.4.2.tar.gz} {http://pyqwt.sourceforge.net/support/PyQt-x11-gpl-4.4.2.tar.gz}} \newcommand{\PyQtFourMac}{\ulink{PyQt-mac-gpl-4.4.2.tar.gz} {http://pyqwt.sourceforge.net/support/PyQt-mac-gpl-4.4.2.tar.gz}} \newcommand{\NumPy}{\ulink{NumPy} {http://numpy.scipy.org}} \newcommand{\NumPyTarGz}{\ulink{NumPy-1.1.0.tar.gz} {http://prdownloads.sourceforge.net/numpy/numpy-1.1.0.tar.gz?download}} \newcommand{\numarray}{\ulink{numarray} {http://www.stsci.edu/resources/software_hardware/numarray}} \newcommand{\numarrayTarGz}{\ulink{numarray-1.5.2.tar.gz} {http://prdownloads.sourceforge.net/numpy/numarray-1.5.2.tar.gz?download}} \newcommand{\Numeric}{\ulink{Numeric} {http://www.numpy.org}} \newcommand{\NumericTarGz}{\ulink{Numeric-24.2.tar.gz} {http://prdownloads.sourceforge.net/numpy/Numeric-24.2.tar.gz?download}} \newcommand{\PyQwtTarGz}{\ulink{PyQwt-\target.tar.gz} {http://prdownloads.sourceforge.net/pyqwt/PyQwt-\target.tar.gz?download}} \newcommand{\PyQwtLatestTarGz}{\ulink{PyQwt-5.0.1.tar.gz} {http://prdownloads.sourceforge.net/pyqwt/PyQwt-5.0.1.tar.gz?download}} \newcommand{\PythonExe}{\ulink{python-2.5.2.msi} {http://www.python.org/ftp/python/2.5/python-2.5.2.msi}} \newcommand{\NumPyExe}{\ulink{numpy-1.1.0-win32-superpack-python2.5.exe} {http://prdownloads.sourceforge.net/numpy/numpy-1.1.0-win32-superpack-python2.5.exe}} \newcommand{\QtExe}{\ulink{qt-win-opensource-4.4.0-mingw.exe} {ftp://ftp.trolltech.com/qt/source/qt-win-opensource-4.4.0-mingw.exe}} \newcommand{\DevCpp}{\ulink{Dev-C++} {http://prdownloads.sourceforge.net/dev-cpp/devcpp-4.9.9.2_setup.exe}} \newcommand{\PyQtExe}{\ulink{PyQt-Py2.5-gpl-4.4.2-1.exe} {http://pyqwt.sourceforge.net/support/PyQt-Py2.5-gpl-4.4.2-1.exe}} \newcommand{\PyQwtExe}{\ulink{PyQwt5.1.0-Python2.5-PyQt4.4.2-NumPy1.1.0-1.exe} {http://prdownloads.sourceforge.net/pyqwt/PyQwt5.1.0-Python2.5-PyQt4.4.2-NumPy1.1.0-1.exe}} \newcommand{\PrerequisitesEnd}{ The source package \PyQwtTarGz{} contains a subversion snapshot of the \Qwt-5.1 bug fix branch which may fix some bugs in \Qwt-5.1.0. However, \Qwt-5.0.0, \Qwt-5.0.1, and \Qwt-5.0.2 are also supported. I recommend to compile and link the bug fix branch statically into PyQwt. To exploit the full power of PyQwt, you should install at least one of the numerical Python extensions: \NumPy{}, \numarray{}, or \Numeric{} and built PyQwt with support for the numerical Python extension(s) of your choice. PyQwt-\target{} and recent versions of the numerical Python extensions support the \ulink{N-D array interface}{http://numpy.scipy.org/array_interface.shtml} protocol. Therefore, PyQwt supports those extensions, even if they have not been installed when PyQwt has been built. However, the functionality is somewhat reduced in this case, since conversion from an QImage to a Numerical Python array is not supported. I am testing PyQwt with \NumPyTarGz{}, \numarrayTarGz{}, and \NumericTarGz{}. \NumPy{} is actively developed and recommended; \numarray{} and \Numeric{} are deprecated. } \newcommand{\Future}{ \begin{notice}[warning] The documentation is for PyQwt-5.1.0 which has not yet been released. The latest release is \PyQwtLatestTarGz{} and refer to the documentation included in the latest release when using it. \end{notice} } \renewcommand{\Future}{} \newcommand{\Blurb}{ PyQwt is a set of Python bindings for the \Qwt{} C++ class library which extends the Qt framework with widgets for scientific, engineering and financial applications. It provides a widget to plot 2-dimensional data and various widgets to display and control bounded or unbounded floating point values. The main features of PyQwt are: \begin{itemize} \item it really shines with the Numerical Python extension \NumPy{}. \NumPy{} extends Python with multi-dimensional array types to turn Python into an ideal system for numerical computing and experimentation, better than for instance MatLab and IDL. \item it requires and extends PyQt, a set of Python bindings for Qt. \item it supports the use of PyQt, Qt, Qwt, \NumPy{} (\numarray{} and \Numeric{} are deprecated) and optionally SciPy in a GUI Python application or in an interactive Python session. \item it runs on POSIX, Mac OS X and Windows (any operating system supported by Qt and Python). \end{itemize} } \title{PyQwt-5.1 Manual} % boilerplate.tex? \author{Gerard Vermeulen} \date{\today} \release{\target} \setshortversion{\target} \makeindex \begin{document} \maketitle % This makes the contents more accessible from the front page of the HTML. \ifhtml \chapter*{Front Matter \label{front}} \fi \input{copyright} \begin{abstract} \noindent \Blurb{} \end{abstract} \tableofcontents \chapter{Introduction \label{introduction}} \Future{} PyQwt is a set of Python bindings for the \Qwt{} library featuring fast plotting of Python lists and tuples and the powerful array types provided by the Python extension modules \NumPy{}, \numarray{}, and \Numeric{}. \section{Qwt \label{qwt-intro}} \Future{} Qwt is a C++ library based on the Qt GUI framework from Troll Tech AS. The Qwt library contains widgets and components useful to write technical, scientific, and financial programs. It includes the following widgets: \begin{itemize} \item \class{QwtCompass}: a very fancy QDial-like widget to display and control a direction. \item \class{QwtCounter}: a QSpinBox-like widget to display and control a bounded floating point value. \item \class{QwtDial}: a QDial-like widget to display and control a floating point value. \item \class{QwtKnob}: a potentiometer-like widget to display and control a bounded floating point value. \item \class{QwtPlot}: a widget to plot two-dimensional data points. \item \class{QwtSlider}: a QSlider-like widget to display and control a bounded floating point value. \item \class{QwtThermo}: a thermometer-like widget to display a floating point value. \item \class{QwtWheel}: a wheel-like widget with its axis parallel to the computer screen to control a floating point value over a very large range in very small steps. \end{itemize} The widgets are documented in the \Qwt{} manual. \begin{notice}[note] The designer plugins of the \Qwt{} library for Qt-3.x.x and Qt-4.x.x work with PyQwt. If you did built PyQwt against its internal bugfix subversion snapshot of \Qwt{}, you must install either the original or the internal \Qwt{} library. \end{notice} \section{The Python Numerical Extension modules \label{numeric-intro}} \Future{} The \NumPy{}, \numarray{}, and \Numeric{} modules extend Python with multi-dimensional array types and a complete set of 'standard' functions and operators to manipulate the arrays. Python together with at least one of those modules is an ideal language experimental numerical and scientific computing (as powerful as APL, MatLab, IDL and others, but much more elegant). If you do not have a mathematical background, you can think of those array types as columns in a spreadsheet. The spreadsheet lets you do operations on whole columns at once. Look at the following simple example: \verbatiminput{numpy.example} The function call \samp{arange(0.0, 10.0, 3.0)} returns a NumPy array of 4 equidistant points from 0 to 9 inclusive: \samp{array([ 0., 3., 6., 9.])}. The function call \samp{sin(x)} and statement \samp{x*x} show that \samp{sin} and \samp{*} manipulate NumPy arrays element by element. All this in C, for a manifold speedup with respect to pure Python. \section{PyQwt \label{pyqwt-intro}} \Future{} The PyQwt widgets can be used in Graphical User Interface (GUI) programs as well as from the Command Line Interface (CLI). This section addresses: \begin{itemize} \item the CLI facilities (iqt, qwt.qplt), \item the functions to convert \class{QImage} instances to Numeric and numarray arrays and vice versa. \end{itemize} The documentation for writing GUI programs consists of the \Qwt{} manual, supplemented by chapter \ref{reference} to document the differences between PyQwt and Qwt. \subsection{Command line interface \label{cli-intro}} \Future{} \begin{notice}[note] PyQt-4.3 and later has most of the functionality of the \module{iqt} module. \end{notice} The programming style \emph{imposed} by PyQt (before version 4.3) and other GUI toolkit wrappers is to create an application instance with some widgets and to enter an event loop that locks you from the Python command line interpreter. The \module{iqt} module enables you to: \begin{itemize} \item create and control (Py)Qt widgets from the command line interpreter or an enhanced interpreter like \ulink{ipython}{http://ipython.scipy.org}. \item to interact with those widgets through (Py)Qt's GUI. \end{itemize} When Python has the GNU \module{readline} module, the \module{iqt} module works by hooking \cfunction{qApp->processEvents()} on the event hook of the \module{readline} module. The GNU readline library closes the event loop by calling \cfunction{qApp->processEvent()} at a maximum rate of 10 times per second while reading your keyboard input. When Python does not have the GNU \module{readline} module, the \module{iqt} module uses the {\ulink{techniques} {http://www.riverbankcomputing.com/pipermail/pyqt/2007-July/016512.html}} suggested on the PyQt mailing list. To see how the \module{iqt} works, play with \file{ICompass.py} by running \begin{verbatim} python -i ICompass.py \end{verbatim} or \begin{verbatim} python ICompass.py \end{verbatim} or \begin{verbatim} ipython ICompass.py \end{verbatim} My \file{.pythonrc.py} file (a symbolic link to \file{/usr/lib/python2.5/site-packages/PyQt4/Qwt5/pythonrc.py}) tries to import the modules \module{numpy} and \module{scipy}. Then, it tries to import everything from the modules \module{PyQt4.Qt}, \module{PyQt4.Qwt5}, and \module{PyQt4.Qwt5.qplt} before creating an QApplication instance. Finally, it configures \module{readline} for tab-completion and history saving and cleans up the global namespace: \verbatiminput{../../qt4lib/PyQt4/Qwt5/pythonrc.py} \subsection{Qwt5.qplt or PyQt4.Qwt5.qplt \label{qwt-qplt}} \Future{} The module \module{qplt} defines a tiny data-directed programming language to simplify the use of \class{QwtPlot} from the Python command line interpreter. The following small example works with the \file{.pythonrc.py} file in section \ref{cli-intro}: \verbatiminput{qplt.example} \subsubsection{Qwt5.qplt.Plot or PyQt4.Qwt5.qplt.Plot \label{intro-qplt-plot}} \Future{} \begin{classdesc}{Plot}{*arguments} \class{Plot} takes any number of optional arguments. The data-directed interpretation of each optional argument is: \begin{itemize} \item \class{Axis}, to enable and redefine an axis. \item \class{Curve}, to add a curve to the plot. \item \class{QString} or a \class{string}, to set the title of the plot. \item \class{int}, to attach a set of mouse events to the zoomer actions. \item (\class{int}, \class{int}), to set the size of the plot. \end{itemize} \class{Plot} has an infinite deep stack of zoom regions. You can: \begin{itemize} \item select a zoom region \item unzoom all \item walk down the stack \item walk up the stack. \end{itemize} \class{Plot} uses \method{__getattr__()} to inherit all methods of \class{QwtPlot}. \end{classdesc} In addition, the class \class{Plot} defines the following methods: \begin{methoddesc}[Plot]{clearZoomStack}{self} Force autoscaling and clear the zoom stack. \end{methoddesc} \begin{methoddesc}[Plot]{formatCoordinates}{self, x, y} Format mouse coordinates as real world plot coordinates. \end{methoddesc} \begin{methoddesc}[Plot]{getZoomerMouseEventSet}{self} Return the index of the set of mouse events attached to the QwtPlotZoomer actions. \end{methoddesc} \begin{methoddesc}[Plot]{gracePlot}{self, saveall="", pause=0.2} Clone the plot into \Grace{} for very high quality hard copy output. When \var{saveall} is not equal to \code{""}, the plot is saved to a file named by the variable \var{saveall}. The \Grace{} process gets killed after saving the plot. Know bug: Grace does not scale the data correctly when Grace cannot cannot keep up with gracePlot. This happens when it takes too long to load Grace in memory (exit the Grace process and try again) or when 'pause' is too short. \end{methoddesc} \begin{methoddesc}[Plot]{plot}{self, *curves} Plot a list of curves. \end{methoddesc} \begin{methoddesc}[Plot]{plotAxis}{self, orientation, options, title} Plot and enables an axis. \end{methoddesc} \begin{methoddesc}[Plot]{plotCurve}{self, curve} Plot a single curve. \end{methoddesc} \begin{methoddesc}[Plot]{setZoomerMouseEventSet}{self, index} Attach the QwtPlotZoomer actions to set of mouse events. \end{methoddesc} \begin{methoddesc}[Plot]{toggleCurve}{self, key} Toggle a curve between hidden and shown. \end{methoddesc} \subsubsection{Qwt5.qplt.IPlot or PyQt4.Qwt5.qplt.IPlot \label{intro-qplt-iplot}} \Future{} \begin{classdesc}{IPlot}{*arguments} \class{IPlot} is a main window with a Plot widget as central widget. The data-directed interpretation of each optional argument is the same as for \class{Plot}: \begin{itemize} \item \class{Axis}, to enable and redefine an axis. \item \class{Curve}, to add a curve to the plot. \item \class{QString} or a \class{string}, to set the title of the plot. \item \class{int}, to attach a set of mouse events to the zoomer actions. \item (\class{int}, \class{int}), to set the size of the plot. \end{itemize} The functionality of \class{Plot} is enhanced with a tool bar with buttons for printing and cloning into \Grace{} and a combo box to attach the zoomer actions to a set of mouse events. In addition, the position of the cursor in the plot region is tracked and displayed in a status bar. \class{IPlot} uses \method{__getattr__()} to inherit all methods of \class{IPlot}. In addition, the class \class{IPlot} defines the following methods: \begin{methoddesc}[Plot]{onMouseMoved}{self, event} Translate the mouse coordinates to plot coordinates for display in the status bar. \end{methoddesc} \begin{methoddesc}[IPlot]{printPlot}{self} Initialize a high resolution printer (if possible) for color output to file and print the plot. \end{methoddesc} \end{classdesc} \subsubsection{Qwt5.qplt.Curve or PyQt4.Qwt5.qplt.Curve \label{intro-qplt-curve}} \Future{} \begin{classdesc}{Curve}{x, y, *arguments} \class{Curve} takes two obligatory arguments followed by any number of optional arguments. The arguments \var{x} and \var{y} must be sequences of \class{float} objects. The data-directed interpretation of each optional argument is: \begin{itemize} \item \class{QwtPlot.Axis}, to attach an axis to the curve. Predefined instances of \class{QwtPlot.Axis} are \constant{yLeft}, \constant{yRight}, \constant{xBottom} and \constant{xTop} or \constant{Y1}, \constant{Y2}, \constant{X1} and \constant{X2}. \item \class{Pen}, to select a pen to connect the data points. \item \class{Symbol}, to select a symbol to the data points. \item \class{string} or \class{QString}, to set the title of the curve. \end{itemize} \end{classdesc} \subsubsection{Qwt5.qplt.Axis or PyQt4.Qwt5.qplt.Axis \label{intro-qplt-axis}} \Future{} \begin{classdesc}{Axis}{*arguments} \class{Axis} takes any number of optional arguments. The data-directed interpretation of each optional argument is: \begin{itemize} \item \class{QwtPlot.Axis}, to set the orientation of the axis. Predefined instances of \class{QwtPlot.Axis} are \constant{yLeft}, \constant{yRight}, \constant{xBottom} and \constant{xTop} or \constant{Y1}, \constant{Y2}, \constant{X1} and \constant{X2}. \item \class{QwtScaleEngine}, to set the axis type. Predefined instances of \class{QwtScaleEngine} are \class{QwtLinearScaleEngine} and \class{QwtLog10ScaleEngine} or \class{Lin} and \class{Log}. \item \class{int}, to set the attributes. \item \class{string} or \class{QString}, to set the title of the axis. \end{itemize} \end{classdesc} \subsubsection{Qwt5.qplt.Pen or PyQt4.Qwt5.qplt.Pen \label{intro-qplt-pen}} \Future{} \begin{classdesc}{Pen}{*arguments} \class{Pen} takes any number of optional arguments. The data-directed interpretation of each optional argument is: \begin{itemize} \item \class{Qt.PenStyle}, to set the style of the pen. \item \class{QColor} or \class{Qt.GlobalColor}, to set the color of the pen. \item \class{int}, to set the width of the pen. \end{itemize} \end{classdesc} \subsubsection{Qwt5.qplt.Symbol or PyQt4.Qwt5.qplt.Symbol \label{intro-qplt-symbol}} \Future{} \begin{classdesc}{Symbol}{*arguments} \class{Symbol} takes any number of optional arguments. The data-directed interpretation of each optional argument is: \begin{itemize} \item \class{QColor} or \class{Qt.GlobalColor}, to set the fill color of the symbol. \item \class{QwtSymbol.Style}, to set the style of the symbol. Predefined instances of \class{SymbolStyle} are \constant{NoSymbol}, \constant{Circle}, \constant{Square} and \constant{Diamond}. \item \class{int}, to set the size of the symbol. \end{itemize} \end{classdesc} \chapter{Installation \label{installation}} \section{Prerequisites \label{prerequisites}} \Future{} Build prerequisites for \PyQwtTarGz{}: \begin{enumerate} \item \ulink{Python}{http://www.python.org}.\\ Supported versions: Python-2.5.x, Python-2.4.x. \item \ulink{Qt}{http://www.trolltech.com}.\\ Supported versions: Qt-4.4.x, Qt-4.3.x, Qt-4.2.x, Qt-3.3.x, and Qt-3.2.x. \item \Sip{}.\\ Supported versions: sip-4.7.x, and sip-4.6.x. \item Either \PyQtGpl{}, or \PyQtMac{}, or \PyQtFourGpl{}, or \PyQtFourMac{}.\\ Supported versions: PyQt-4.4.x, PyQt-4.3.x, PyQt-4.2.x, and PyQt-3.17.x. \end{enumerate} \PrerequisitesEnd{} \section{Unpack, configure, build, and install \label{install}} \Future{} \begin{enumerate} \item Unpack \PyQwtTarGz{}. \item Invoke the commands to build PyQwt-\target{} for Qt-4: \begin{verbatim} cd PyQwt-5.1.0 cd configure python configure.py -Q ../qwt-5.1 make make install \end{verbatim} This assumes that the correct Python interpreter is on your path. Replace \strong{make} by \strong{nmake}, if you use MSVC or MSVC.net. The commands build PyQwt against the included Qwt subversion snapshot and install PyQwt. Test the installation by playing with the example programs. \item Invoke the commands to build PyQwt-\target{} for Qt-3: \begin{verbatim} cd PyQwt-5.1.0 cd configure python configure.py -3 -Q ../qwt-5.1 make make install \end{verbatim} \end{enumerate} See the last note below for all configuration options. \begin{notice}[note] If you run into problems, create two log files \begin{verbatim} python configure.py --your --options > configure.log make > make.log \end{verbatim} and send the log files to the \mailinglist{}. \end{notice} \begin{notice}[note] Check if all development packages have been installed when make produces lots of errors on Linux. \end{notice} \begin{notice}[note] The configure.py script takes many options. The command \begin{verbatim} python configure.py -h \end{verbatim} displays a full list of the available options: \verbatiminput{configure.help} \end{notice} \section{Binary Installer for Windows \label{windows}} \Future{} Make sure to install \begin{enumerate} \item \PythonExe{}, \item \NumPyExe{}, \item \PyQtExe{}, \end{enumerate} before installing \PyQwtExe{}. \chapter{PyQwt Module Reference \label{reference}} \Future{} The reference should be used in conjunction with the Qwt manual on your hard disk or \Qwt{} on the web. Only the differences specific to the Python bindings are documented here. In this chapter, \emph{is not yet implemented} implies that the feature can be easily implemented if needed, \emph{is not implemented} implies that the feature is not easily implemented, and \emph{is not Pythonic} implies that the feature will not be implemented because it violates the Python philosophy (e.g. may use dangling pointers). If a class is described as being \emph{fully implemented} then all non-private member functions and all public class variables have been implemented. Undocumented classes have not yet been implemented or are still experimental. \section{Function reference\label{functions}} \Future{} \begin{funcdesc}{toImage}{array} Convert \var{array} to a QImage, where \var{array} must be a two-dimensional NumPy, numarray, or Numeric array of type UnsignedInt8 or UnsignedInt32. \end{funcdesc} \begin{funcdesc}{toNumarray}{image} Convert \var{image} of type \class{QImage} to a numarray array. This function is only present if numarray has been detected when building PyQwt. \end{funcdesc} \begin{funcdesc}{toNumeric}{image} Convert \var{image} of type \class{QImage} to a Numeric array. This function is only present if Numeric has been detected when building PyQwt. \end{funcdesc} \begin{funcdesc}{toNumpy}{image} Convert \var{image} of type \class{QImage} to a NumPy array. This function is only present if NumPy has been detected when building PyQwt. \end{funcdesc} \begin{funcdesc}{to_na_array}{image} Convert \var{image} of type \class{QImage} to a Numarray array. This function has been deprecated and is only present if Numarray has been detected when building PyQwt. Use \function{toNumarray(aQImage)}. \end{funcdesc} \begin{funcdesc}{to_np_array}{image} Convert \var{image} of type \class{QImage} to a Numeric array. This function has been deprecated and is is only present if Numeric has been detected when building PyQwt. Use \function{toNumpy(aQImage)} \end{funcdesc} \section{Wrappers for \ctype{QwtArray} \label{qwtarray}} \Future{} PyQwt has a partial interface to the following C++ QwtArray templates: \begin{enumerate} \item \class{QwtArrayDouble} for \ctype{QwtArray} \item \class{QwtArrayInt} for \ctype{QwtArray} \item \class{QwtArrayQwtDoubleInterval} for \ctype{QwtArray} \item \class{QwtArrayQwtDoublePoint} for \ctype{QwtArray} when PyQwt has been built against PyQt3 or for \ctype{QwtArray} when PyQwt has been built against PyQt4. \end{enumerate} Those classes have at least 3 constructors -- taking QwtArrayDouble as an example: \begin{enumerate} \item \code{array = QwtArrayDouble()} \item \code{array = QwtArrayDouble(int)} \item \code{array = QwtArrayDouble(otherArray)} \end{enumerate} QwtArrayDouble and QwtArrayInt have also a constructor which takes a sequence of items convertable to a C++ double and a C++ long: \begin{itemize} \item \code{array = QwtArrayDouble(Numeric.array([0.0, 1.0]))} \item \code{array = QwtArrayInt(Numeric.array([0, 1]))} \end{itemize} All those classes have 16 member functions -- taking QwtArrayDouble as example: \begin{enumerate} \item \code{array = array.assign(otherArray)} \item \code{item = array.at(index)} \item \code{index = array.bsearch(item)} \item \code{index = contains(item)} \item \code{array = otherArray.copy()} \item \code{result = array.count()} \item \code{array.detach()} \item \code{array = array.duplicate(otherArray)} \item \code{bool = array.fill(item, index=-1)} \item \code{index = array.find(item, index=0)} \item \code{bool = array.isEmpty()} \item \code{bool = array.isNull()} \item \code{bool = array.resize(index)} \item \code{result = array.size()} \item \code{array.sort()} \item \code{bool = array.truncate(index)} \end{enumerate} Iterators are not yet implemented. However, the implementation of the Python slots \function{__getitem__}, \function{__len__} and \function{__setitem__} let you use those classes almost as a sequence. For instance: \verbatiminput{QwtArrayDoubleExample.txt} \section{Class reference \label{classes}} \Future{} \begin{classdesc*}{QwtAbstractScale} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtAbstractScaleDraw} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtAbstractSlider} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtAlphaColorMap} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtAnalogClock} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtArrayData} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtArrayDouble} is a wrapper for \ctype{QwtArray}, see \ref{qwtarray}. \end{classdesc*} \begin{classdesc*}{QwtArrayInt} is a wrapper for \ctype{QwtArray}, see \ref{qwtarray}. \end{classdesc*} \begin{classdesc*}{QwtArrayQwtDoubleInterval} is a wrapper for \ctype{QwtArray}, see \ref{qwtarray}. \end{classdesc*} \begin{classdesc*}{QwtArrayQwtDoublePoint} is a wrapper for \ctype{QwtArray}, see \ref{qwtarray}. \end{classdesc*} \begin{classdesc*}{QwtArrowButton} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtClipper} is fully implemented, but only available when PyQwt has been built for Qwt-5.1.x. \end{classdesc*} \begin{classdesc*}{QwtColorMap} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtCompass} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtCompassMagnetNeedle} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtCompassRose} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtCompassWindArrow} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtCounter} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtCurveFitter} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtData} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtDial} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtDialNeedle} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtDialScaleDraw} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtDialSimpleNeedle} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtDoubleInterval} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtDoublePoint} is fully implemented, but only available when PyQwt has been built for Qt-3. When PyQwt has been built for Qt-4, replace this class with \class{QPointF} except for in signals. For example, clicking in the canvas of the plot displayed canvas by the following program \begin{verbatim} #!/usr/bin/env python import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt def aSlot(aQPointF): print 'aSlot gets:', aQPointF # aSlot() def make(): demo = Qwt.QwtPlot() picker = Qwt.QwtPlotPicker(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.PointSelection, Qwt.QwtPlotPicker.CrossRubberBand, Qwt.QwtPicker.AlwaysOn, demo.canvas()) picker.connect(picker, Qt.SIGNAL('selected(const QwtDoublePoint&)'), aSlot) return demo # make() def main(args): app = Qt.QApplication(args) demo = make() demo.show() sys.exit(app.exec_()) # main() if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** \end{verbatim} shows that the signal return on object of type QPointF: \begin{verbatim} aSlot gets: \end{verbatim} \end{classdesc*} \begin{classdesc*}{QwtDoubleRange} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtDoubleRect} is fully implemented, but only available when PyQwt has been built for Qt-3. When PyQwt has been built for Qt-4, replace this class with \class{QRectF} except for in signals. See \class{QwtDoublePoint}. \end{classdesc*} \begin{classdesc*}{QwtDoubleSize} is fully implemented, but only available when PyQwt has been built for Qt-3. When PyQwt has been built for Qt-4, replace this class with \class{QSizeF} except for in signals. See \class{QwtDoublePoint}. \end{classdesc*} \begin{classdesc*}{QwtDynGridLayout} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtEventPattern} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtIntervalData} is fully implemented. \begin{cfuncdesc}{}{QwtIntervalData}{ const QwtArray \&intervals, const QwtArray \&values} is implemented as \begin{verbatim} intervalData = QwtIntervalData(intervals, values) \end{verbatim} where intervals is a QwtArrayQwtDoubleInterval or a list containing QwtDoubleInterval instances. \end{cfuncdesc} \begin{cfuncdesc}{void}{setData}{ const QwtArray \&intervals, const QwtArray \&values} is implemented as \begin{verbatim} intervalData.setData(intervals, values) \end{verbatim} where intervals is a QwtArrayQwtDoubleInterval or a list containing QwtDoubleInterval instances. \end{cfuncdesc} \end{classdesc*} \begin{classdesc*}{QwtKnob} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtLegend} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtLegendItem} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtLegendItemManager} is fully implemented, but only available when PyQwt has been built for Qwt-5.1.x. \end{classdesc*} \begin{classdesc*}{QwtLinearColorMap} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtLinearScaleEngine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtLog10ScaleEngine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtLegendMagnifier} is fully implemented, but only available when PyQwt has been built for Qwt-5.1.x. \end{classdesc*} \begin{classdesc*}{QwtMetricsMap} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPaintBuffer} is fully implemented. This class does not exist when PyQwt has been built for Qt-4. \end{classdesc*} \begin{classdesc*}{QwtPainter} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPanner} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPicker} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPickerClickPointMachine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPickerClickRectMachine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPickerDragPointMachine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPickerDragRectMachine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPickerMachine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPickerPolygonMachine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlainTextEngine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlot} \begin{cfuncdesc}{void}{print}{ QPrinter \&printer, const QwtPlotPrintFilter \&filter} is implemented as \begin{verbatim} plot.print_(printer, filter) \end{verbatim} \end{cfuncdesc} \begin{cfuncdesc}{void}{print}{ QPainter *painter, const QRect \&rect, const QwtPlotPrintFilter \&filter} is implemented as \begin{verbatim} plot.print_(painter, rect, filter) \end{verbatim} \end{cfuncdesc} \end{classdesc*} \begin{classdesc*}{QwtPlotCanvas} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlotCurve} \begin{cfuncdesc}{void}{setData}{double *x, double *y, int size} is implemented as \begin{verbatim} curve.setData(x, y) \end{verbatim} where \var{x} and \var{y} can be any combination of lists, tuples and Numerical Python arrays. The data is copied to C++ data types. \end{cfuncdesc} \begin{cfuncdesc}{void}{setRawData}{double *x, double *y, int size} is not Pythonic. \end{cfuncdesc} \end{classdesc*} \begin{classdesc*}{QwtPlotDict} is fully implemented. FIXME: is the auto delete feature dangerous? \end{classdesc*} \begin{classdesc*}{QwtPlotGrid} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlotItem} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlotLayout} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlotMagnifier} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlotMarker} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlotPanner} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlotPicker} is fully implemented. \begin{cfuncdesc}{QwtText}{trackerText}{QwtDoublePoint \&point} is implemented as \begin{verbatim} qwtText = plotPicker.trackerTextF(point) \end{verbatim} where \var{point} is a QwtDoublePoint when PyQwt has been built for Qt-3 or a QPointF when PyQwt has been built for Qt-4. \end{cfuncdesc} \end{classdesc*} \begin{classdesc*}{QwtPlotPrintFilter} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlotRasterItem} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlotScaleItem} is fully implemented, but only available when PyQwt has been built for Qwt-5.1.x. \end{classdesc*} \begin{classdesc*}{QwtPlotSpectrogram} FIXME: protected methods. \end{classdesc*} \begin{classdesc*}{QwtPlotSvgItem} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPlotZoomer} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtPolygon} When PyQwt has been built for Qt-3, replace this class with \class{QPointArray} except for in signals. See \class{QwtDoublePoint}. When PyQwt has been built for Qt-4, replace this class with \class{QPolygon} except for in signals. See \class{QwtDoublePoint}. \end{classdesc*} \begin{classdesc*}{QwtPolygonFData} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtRasterData} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtRect} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtRichTextEngine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtRoundScaleDraw} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtScaleArithmic} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtScaleDiv} \begin{cfuncdesc}{} {QwtScaleDiv}{ const QwtDoubleInterval\&, QwtValueList[NTickList]} is implemented as \begin{verbatim} scaleDiv = QwtScaleDiv(qwtDoubleInterval, majorTicks, mediumTicks, minorTicks) \end{verbatim} \end{cfuncdesc} \begin{cfuncdesc}{} {QwtScaleDiv}{ double, double, QwtTickList[NTickList]} is implemented as \begin{verbatim} scaleDiv = QwtScaleDiv(lower, upper, majorTicks, mediumTicks, minorTicks) \end{verbatim} \end{cfuncdesc} \end{classdesc*} \begin{classdesc*}{QwtScaleDraw} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtScaleEngine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtScaleMap} is fully implemented. \begin{cfuncdesc}{} {QwtScaleMap}{ int, int, double, double} does not exist in C++, but is provided by PyQwt. \end{cfuncdesc} \end{classdesc*} \begin{classdesc*}{QwtScaleTransformation} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtScaleWidget} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtSimpleCompassRose} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtSlider} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtSpline} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtSplineCurveFitter} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtSymbol} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtText} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtTextEngine} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtTextLabel} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtThermo} is fully implemented. \end{classdesc*} \begin{classdesc*}{QwtWheel} is fully implemented. \end{classdesc*} \input{pyqwt.ind} \end{document} %% Local Variables: %% fill-column: 79 %% End:pyqwt5-5.2.1~cvs20091107+dfsg/Doc/pyqwt/copyright.tex0000444000175000017500000000231611014067033020261 0ustar poxpoxCopyright \copyright{} 2001-2008 Gerard Vermeulen Copyright \copyright{} 2000 Mark Colclough PyQwt is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PyQwt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PyQwt; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. In addition, as a special exception, Gerard Vermeulen gives permission to link PyQwt dynamically with non-free versions of Qt and PyQt, and to distribute PyQwt in this form, provided that equally powerful versions of Qt and PyQt have been released under the terms of the GNU General Public License. If PyQwt is dynamically linked with non-free versions of Qt and PyQt, PyQwt becomes a free plug-in for a non-free program. %% Local Variables: %% fill-column: 79 %% End: pyqwt5-5.2.1~cvs20091107+dfsg/Doc/pyqwt/numpy.example0000444000175000017500000000141510641724114020260 0ustar poxpox>>> from numpy import * # 1 >>> x = arange(0.0, 10.0, 3.0) # 2 >>> y = sin(x) # 3 >>> x # 4 array([ 0., 3., 6., 9.]) # 5 >>> y # 6 array([ 0. , 0.14112001, -0.2794155 , 0.41211849]) # 7 >>> sqrt(x*x) # 8 array([ 0., 3., 6., 9.]) # 9 >>> x*x # 10 array([ 0., 9., 36., 81.]) # 11 pyqwt5-5.2.1~cvs20091107+dfsg/Doc/GNUmakefile0000444000175000017500000000175511007512536016430 0ustar poxpoxMKHOWTO := $(HOME)/CVS/PyQwt/BUILD/Python-2.5.2/Doc/tools/mkhowto SOURCES := \ pyqwt/configure.help \ pyqwt/copyright.tex \ pyqwt/pyqwt.tex doc: $(SOURCES) if [ ! -e html/pyqwt ]; then mkdir -p html/pyqwt; fi (cd html/pyqwt; rm -f *.css *.dat *.html *.idx *.old *.pl *.gif) cp -p html/icons/*.png html/pyqwt python $(MKHOWTO) -D --html --dir html/pyqwt \ --image-type png --favicon pyfav.png \ --up-link http://pyqwt.sourceforge.net --up-title "Pyqwt Home" \ pyqwt/pyqwt.tex (cd html/pyqwt; rm -f *.dat *.idx *.old *.pl *.gif) python nospam.py html/pyqwt/*.html rm -f pyqwt.l2h* date -u "+%Y-%m-%d %T" > doc htdoc: doc $(SOURCES) if [ ! -e html/htdoc ]; then mkdir -p html/htdoc; fi (cd html/htdoc; rm -f *.css *.dat *.html *.idx *.old *.pl *.gif) cp -pr html/pyqwt/* html/htdoc python sourceforge.py html/htdoc/*.html date -u "+%Y-%m-%d %T" > htdoc pyqwt/configure.help: ../configure/configure.py python ../configure/configure.py --help > pyqwt/configure.help # EOF pyqwt5-5.2.1~cvs20091107+dfsg/Doc/sourceforge.py0000444000175000017500000000173610411536702017251 0ustar poxpox#!/usr/bin/env python import os import re import sys group_id = '142394' def stamp(html): """Stamp a Python HTML documentation page with the SourceForge logo""" def replace(m): return ('%s ' 'Hosted on ' 'SourceForge Logo' % (m.group(1), group_id)) mailRe = re.compile(r'(.*)') ## m = mailRe.search(html) ## if m: ## print m.groups() return re.sub(mailRe, replace, html) # stamp() if __name__ == '__main__': for name in sys.argv[1:]: html = open(name, 'r').read() text = stamp(html) if text != html: os.remove(name) file = open(name, 'w') file.write(text) file.close() pyqwt5-5.2.1~cvs20091107+dfsg/Doc/nospam.py0000444000175000017500000000230610411536701016214 0ustar poxpox#!/usr/bin/env python import os import random import re import sys def hide(html): """Hide a chunk of HTML text for dumb robots""" list = [] for c in html: if random.randrange(2): list.append('&#%s;' % ord(c)) else: list.append('&#%s;' % hex(ord(c))[1:]) return ''.join(list) def filter(html): """Filter all dumb robot readable mail anchors from a HTML text""" def replace(m): if m.group(1): return ('%s' % (m.group(1), hide(m.group(2)), hide(m.group(3)))) else: return ('%s' % (hide(m.group(2)), hide(m.group(3)))) # compatible with latex2html mail anchors mailRe = re.compile( r'(.+)', re.M) return re.sub(mailRe, replace, html) # filter() if __name__ == '__main__': for name in sys.argv[1:]: html = open(name, 'r').read() text = filter(html) if text != html: os.remove(name) file = open(name, 'w') file.write(text) file.close() # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/README0000444000175000017500000000011411106003355014507 0ustar poxpoxSee the installation instructions in sphinx/build/html/installation.html. pyqwt5-5.2.1~cvs20091107+dfsg/ANNOUNCEMENT-5.2.00000444000175000017500000000321311235001261016104 0ustar poxpoxWhat is PyQwt ( http://pyqwt.sourceforge.net ) ? - it is a set of Python bindings for the Qwt C++ class library which extends the Qt framework with widgets for scientific and engineering applications. It provides a 2-dimensional plotting widget and various widgets to display and control bounded or unbounded floating point values. - it requires and extends PyQt, a set of Python bindings for Qt. - it supports the use of PyQt, Qt, Qwt, and optionally NumPy or SciPy in a GUI Python application or in an interactive Python session. - it runs on POSIX, Mac OS X and Windows platforms (practically any platform supported by Qt and Python). - it plots fast: fairly good hardware allows a rate of 100,000 points/second. (PyQwt with Qt-3 is faster than with Qt-4). - it is licensed under the GPL with an exception to allow dynamic linking with non-free releases of Qt and PyQt. The most important new features of PyQwt v5.2.0 are: - support for Qwt v5.2.0 - support for PyQt upto v4.5.4, PyQt upto v3.18.1, and SIP upto v4.8.2. - switch to documentation generated by Sphinx. - provide a normal qwt plugin for the pyuic4 user interface compiler instead of the anormal qwt plugin included in PyQt. The most important bug fixes in PyQwt-5.2.0 are: - fixed crashes in the QImage-array conversion functions. - fixed three transfer of ownership bugs. PyQwt-5.2.0 supports: 1. Python v2.6.x and v2.5.x. 2. PyQt v3.18.1 downto v3.17.5. 3 PyQt v4.5.x, v4.4.x. 4 SIP v4.8.1 downto v4.7.3. 5. Qt v3.3.x. 6. Qt v4.5.x, v4.4.x, and v4.3.x. 7. Qwt v5.2.x, v5.1.x, and v5.0.x. 8. Recent versions of NumPy, numarray, and/or Numeric. Enjoy -- Gerard Vermeulen pyqwt5-5.2.1~cvs20091107+dfsg/untabify.py0000555000175000017500000000303110411526316016033 0ustar poxpox#!/usr/bin/env python import optparse import os import sys def parse_invokation(): """Return the parsed options and arguments from the command line """ usage = ( '%prog [-h] [-t N] directory (one or more file name extensions)' ) parser = optparse.OptionParser(usage=usage) parser.add_option( '-t', '--tabs', default=8, action='store', type='int', metavar='N', help='Have tabs N characters apart [default 8]' ) options, arguments = parser.parse_args() if len(arguments) < 2: parser.print_help() sys.exit(1) return options, arguments # parse_invokation() def process(filename, tabsize): """Stolen from Python-X.Y.Z/Tools/scripts/untabify """ try: f = open(filename) text = f.read() f.close() except IOError, msg: print "%r: I/O error: %s" % (filename, msg) return newtext = text.expandtabs(tabsize) if newtext == text: return f = open(filename, "w") f.write(newtext) f.close() print filename # process() def main(): options, arguments = parse_invokation() top = os.path.abspath(arguments[0]) extensions = arguments[1:] for root, directories, files in os.walk(top): for file in files: _, extension = os.path.splitext(file) if extension in extensions: process(os.path.join(root, file), options.tabs) # main if __name__ == "__main__": main() # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/sphinx/0000755000175000017500000000000011275562661015167 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/sphinx/index.rst0000444000175000017500000000035311105675444017023 0ustar poxpoxPyQwt User Manual ================= .. toctree:: :maxdepth: 2 introduction.rst installation.rst reference.rst copyright.rst Indices and Tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` pyqwt5-5.2.1~cvs20091107+dfsg/sphinx/cli-plot-1.png0000444000175000017500000002437711264134316017557 0ustar poxpox‰PNG  IHDRXýW‰Ï pHYs  :èÝ™Þ IDATxœíÝ]–ë6’…Q°WÍ£Võrš~±Ý³ÒÊöHÔÌ䥸 q€o?TɺJé(H1D$§¿ÿúo`TÿÓ:-ÑC£†F# í_­ÀÒ×××|ãõzµMsþîœð:^Êc¼Y*Ô’#Qp½š.òÖ×ýS™¬÷þ7aO8)Úájò ›?Ì~9' ÷¬n¥WBo]Ðêý^¬WæúÞPxÖíÐhÆê{ø'5?Ͻ~T{Eõ¢í£¦„W×ÈPù“…šzØ#\,«é¼IúúúJ_q¿‹e<ÏP|-ãu³×œùa´@o»ƒÀ-]5ÂC)#EÑ Ù¼e¼Øî_ܹ~ò롌ç_l¶È›-û>É>ÃYζ\NŠöÜݧÝçYWkÿg‹ò¬nÑû7i2¬ºWmý‰~ Âe#Ïþ”}¨#­¬Û¡ÑEtqøàëÿ¼+º}}åí\>Ù§ñV´¯•èƒ74yù·ž³Éc‡J¯?Ù¨³g»¸§Ä‚ƒ‰÷ý|†ggßjºÞA¼õøÃ]re|R´»STü k§ìs¬ï¿pQ³ºEWÂýrO/Ý“qÑŒu¯Ð‡.ºs™ò<)Ÿ²³qøB ¤èª^J„ËÁº'RWÍ­·,†oÄäy_˶hgcPw7èû§Êár©P»/a¾þ”ø@]¼\骮}~þ´OµÞæ–ûA+ñw ? ‹–þNï.ôV¿D:_vQOvýÐ)~ `®«FhòóRâãÙ?Uøºwø3~îDÑ®±/(¡ÐúSùÅ:æPÿ“ef‡³(÷ÿý󳪶r¯ó›¿è­ Š«¢í§<œÍ­¸xäYžÍ_þœvý BÒëLw3Ö½¼joÞKÞê¬ ‰{ñŸh¢«=Â'^«ðû:|äõ³ÞŸ¸Å|>Yà–õ;º»=òS´Ãѿڋ%þáÅ+:qV·Ãû›ü.’×½¢ëO…xëSÖÓW+ £ì†„]Àô;ÿõùÃïyþiÙ÷­¼?LùsÛ¢]?CÍüœl³L~Œ¬aìÆ²y ù›5!„Âc¹W¹±þ¼ï7 .Ë}Ý·º8T¤&^ ú{Usrcþ¯e½ŸBxÿÓòH/Q¹QèFXuÁÏõá|$äFù¿>ïë.øsŸ‡„!WhxÙýôþµÆî [G[=Ö‡q­¿4t¥e#œ÷î=úÜöùÍù‰œù޶z¿rúî…ëyD)çf`À¥}=¿V2žpsüÃòŸû‰0é÷«È?ŽðùU7÷î½xÿlõ&ß9WÈùÔg®œËHéänãè·žŸ”rΟ}ßy÷õLܧoÃÏêÝûý»ÝåZ}¾·Ó=c)cMv}H<¤=ý B“ûë»Ø%=û§6ÇΖPÞùÛ 8¤RO_9ÏÁNs:[|ÕóœFN…AÑÙ¾ž[‘ŸNöDÞÀlËß>î® Ô3„à3çQ¢ƒœï°™MêÇzQÉ‚Æ_©žn¬Ë\k¹G¨ÄÙNlxêghõ¡¤ÿç?gÿôÏ_mîÙŸõð©çMÝì^ï)243B;aæ;¬F=æ<Éâ.ç rÚšÂôvþQ!ÕSú´×kû¦µ¾çð¼nû?9;Ü¡–PâSÖ³È|Sª§±eÉéæ‹‘—zÆxϹ,ã<çìY£­ìwûž[&¾ž<ñè†FÓ¼NÇS Ôñ¡xŠªc3júä{ÔǑӖ‹œ \äL@N«h®s®¨ä,'zaÅyDôl‚ÌC£qß9ÝïŠÕÓƒË Žr^"§™ùƒî?gá(g7¿®[×üFö÷œÝ¹8¼2”Çã6L¾I»ÿb„T½ìYI7¿ý{9ûpϲ#ýóC£qä´å%g¬yÉCNûsÌn8Ë~ídœU‡êã~åôw0õš^=}‹çô±>ôSONN'4gùUê)¡øÐ¨îiXѧÖ} ¾¤¬þºà¡n~#¬¯x#<< ÀLæÛuNÇ¿ IÖ³•„×w‘39 ¬r}䜇]Æ6?×èÈ#§­–9ïì&åt0:Êr·%уN=%p…zŒ‡ fß`|wAØbÖh9m‘Ó9ŸúlvÓ4ItA¿õÄõq¥ êõô'5gëŸ{«g5'}ä;¥·´;P_ÔßÇ•ëE±Ô°·é& û‚gh~Ù#§­Æ9“7qÔÓ–@Îi :ß—ꩃY£qÇW*î>1ÂõtéFΦëC‡õlb>Xðýöžó‡JN b ξµ ±õú <  Æ‘ÓVËœw¶uÔÓ–Çœïƒ.è1畜;ÎéotT»žþÜËÙn}賞uí zÌyD%g}çõ<û'¨Ç<}_A{Óêÿh'}9»âൖ¿º>÷à 9m5Ëyó5©§-g9O» ³œ§ö99Ž0êìÚ¼PGN[Ýæltd}·õ,h á}¶˜<å¼²ÏÙSóÛ\z~Ó½–ËÍ/÷\_¡~ÿŸÌ} õ)EÜó=Á„OlÿþÏÿÞÿÏ_ÿ]ÿçºi-—›_î\ÿëæaë'9û“C Æ‘ÓV휹?RO[ís®»àyö9Ó¨ä\Û4¼ ûY-Ë.`úŽoúŸ´¼0¯ÊR$§-‰õ´æ¢ ¾ßÑ/FÔÓƒÊüÅg¾VJ¿Vþ¢@K¬>qȼšej}c#M’Ä?á€ú8rÚªšóÁKQO[Ír®»`BêÙÜòÃÞÙï‚ëî¸~ØÚៜýXȬÑ8rÚj3ë©§­69÷/ƒPOö3_ÿsßÕ–92×ϰÁõ€)FGý`DtH=ï쟘5Ééæ ŠNêé9mUŸ-éhoõlíiÎZëÃ(õüy–ÊvÁ±ê‰B…F¸>ýݦ)ª,ErÚ"§­ræuÁ›?¥ TOühyøPsº´¿šÄ-tËÉáÅl—Ûgû0]žÚ›Y£qä´U)§Áîõ´”ŸsšžvÁ{¯Öy=÷­Mù×ë¿RǬѸ9›=Öa=›"§­ÌœÕ§Æt^Ïsó…ÝçÛóuÞ¯ïï ³Fb8¬þ!&ˆ¢ ®PGN[esÚuêiëvN“.x}ЭçÙ¾ZÇCšV8×h9mÕÈiñ ÔÓVƒ.øëµïëÙŽMÎòëCoõlÝuëù°ùÍaæ'ÙOÙß߆FãÈi‹œ¶úÉi>5&ëã~êyb=4ìÚçÙ]N]04ŠŽ0?SW¹ ¢}Í@âÐhÆ?u¹¸ÆÐh9mÏiôÜÔÓÖUNO‡IèÖ³ûvUÔÇÝÎÙèè±nëÙ9mItÁÐA=qC£@a­/Kâš³.(Y£Ù#§­R9­wÁG¯§µƒœE»`þ™MUëIóËÆÐh9mIü@¨§µª]ð׫Þÿ Ñzâ–æ0"†CáLË óêAøDN[–9KþL(VO÷]P¬ž+üF˜êãrr¶˜Ñs=[ §­ª]ðÁÆJõüDóËÆe˜Ð¥÷¯þ¾ FGC{\¡>Žœ¶ æ4ÝðQOKîGDõÔÉ)Y£qä´EN[9uº`¨gA'§¨/†Ã¨Ðþjã`²L6¨#§­Asûbä·žŸ;‚~s~ÒÍIóËÆÐh9mÙç,ó[ɸõ4±­—óÙúà´ž;*9%0k½`³à‡‡YŒY£qä´EN[îržtAw9Os@P—Ÿ³î|™þëY9sœï úÊyN7'“e²1k¨¥û‰ÄFDÞM¢ùeÛ6ÂèwŠÍùBŸ”^wv–Oƒæ,¶á´ž¹!¾oœ'©šóÁ븨g•œöçÞvqÕ«ï*K‘œ¶Šä,ñ”#×ó–´Áö9Ós@“e¾¾¾–&÷z½¸‚€áÀ39¿Zý$«²kON[ä´Õ2ç.H=m©ä”p»n®/¸Þ‰\ßë9—%êóÆûý~ô<«ùÞNóæË½ÐŠôt¹ÞÓ;¼Ã¦àbY<[±uÁ†‹i{#¸\îå?MxâѬѳáÓ³ÝÄ̓—Ùýß2å=½1ùˆñô]|ì ¶Ï3ß>b´Xù‡O<À¹FãÈiË2gɹò#Ö3ù%CøÕ“ÿ¨VÎg/¢»Üi~Ù>&ˬ÷ðÖcžë/g·3H¬mœÖìs–yßãÖóÚ|5‰û/J=m©ä”p°GxÝÞ6á|FÁQtjÛÛæN«æ§;qÏ;Ô9ŸÈ(õ¬…œ›— áQ¤ž¶TrJà2Lqä´5zÎùYí~Ý”è‚ånM%§.ÃYŸU²*•QÖäâ2Lqä´eœ³ØöyÐzîž=›.X©ž“²ÜÄÐh9m‘ÓVÁœ¦û‚ÔÓ–JN \† ¨®Öü©|*ဨ3ÈYeÃ7P=«7g™.8n=ËØçäÀ¶l\¡>Žœ¶ÈiK¢ †ÒõÔš…kaŸ“æ—Y£ÐÄDÔGDeƒ£-fƑӖeÎÂCÍŸÝŽYÎÂ]p¸z¦’S³FãlrZF}ð CÕ³¼±r–ß«žå©ä”ÀÐ(ÐBù/F7¨ˆÏŸ,sq oÝÙY> ”³Jÿ¥žóÕ$Ê¥žµ¨ä”P¼n®h¿þ'•¥HN[f9 ¿Ý!êY« †²þ[>ÙËŸ8 Rá½TƬÑ8rÚ"§­œœ-º`ÏõlA%§fÆ‘Ó9^ „`0¬w;g£}A–»-•œ˜5Z‘«‰‚S#¢Àc Æ‘Ó9mÝÈ9OiÔKÕÓúY;\îˆá\£qä´%qìD诞'ˆ*[O»çîm¹ï,³÷÷ç&ö´ÝÌ…&• ‡beîpgGx_ÿk¯³?7f¡!¢ëYR'9ÝtÁNêé†yί¯¯e/ðõz Õ ™5GN[ä\½Fá飫œnº``¹[SÉ)¡QHÑø²îƒ§.ˆ ®G;q+ÔǑӖAÎ*ïR»žþº`‘zøb¤»ÜixÙ#§-rÚ’è‚¡h=MŸXx¹#C£@_\vATððà‡y‚Ì2kt¨ýK†FãÈi‹œ¶>r¶>Xð‚d=Ë]úå|cóWCM]p@}œqÎwS“ý]ƒÖ³±œîwÅêéÞ>gâaÞ?õ­å…yØ|1rß‹` ñ§aÛØs-/Ì«;áSÿ9ënøTê©ÒKÕÓ|"ªÈrWÉ)Y£qä´%qìDP©§H *õ$ç˜5 ÈÒ邨`ØSf?ǬÑ8rÚ"§Ÿ ¢Þsþ §-¨7ÄÐhœ}Î2§Þ·žeÔËyw}˜¦õaÔÓ9Äê) ‡Î˜2 ; Æ‘ÓVfÎê>õ<ê‚s)’³ÀûÖ­'¿fã€ú8rÚz”³â[tWÏ“}Aw9OÓÖ>'Í/C£€FDb¸B}\‘œæË ]Ïå¼ì‚Žr^"§-•œ#§-r½Øù‰Öbû‚ÔÓ–nN~#ÌÆõP0ìw_ÇW“€74¿l Æ‘ÓV~κ¡q=?¼|`ïËýà¹Ìžé๬çð8 >Žœ¶Èwgj̸õ,ó¾Ç­çÀ˜5 8ÃQ .¨#§-rûž/s» RO[º9™,“­å…y%Ö¶P.§õ¥êG¯§µ9sö©§-Ýœ4¿l-/Ì à—Éî;Qߘ#kÌ#§­Û9½­zõLž zò×.÷kž3 Zϱ1k4Žœ¶2sVs•êùxjLç˽:rˆY£@;L`h4®`NÓ3ŽRO[ÅsuAêi‹œbh4Žœ¶ÈÂIÌúbD=m‘s@œk¾uù­—Ñl]®F8Ž0ÔÇ‘ÓVNÎo«T=­»`ÏËýLÙ}uÕzÒü²q¦8rÚ:g«I ]ÏÈ9 fµpM%À%fÆ•Íi7q”zÚ2½lPò!ó÷ׇëY9ĬÑ8rÚ.gá©1ճʖ zâC£@IL5G-a¡Ñ8rÚº‘³ñ%â¿|•.ØároŠœbÖh9mI;ž×³ÖÔ˜n—{#äÔ;`}aB´ÇQTÇõÙZ^˜W÷ÀUŸÈi+3gõ;¯guº9i~ÙZ^˜Wbm ä´ÖsN“.xs„ çz¶@Î1k^ÉM`‚hQrët0k4Žœ¶îål×Vîål×û\îgÊx¬z"„Àõ)Èi«ÃœM÷;¬gSäC£À3Œˆâ«‘Ó⌣ÔÓVRN]°«z:@Îq@}9mu’³h ¼3q´“z^«¸Í¢žøÄÐ(\rþe×ÁŽàˆ¨7Ê`h4Žœ¶nälºá;Íé¬ v¸Ü›"瀘5GN[Ú9uÁ ^OÈ9 †Fdþº €ç#§-Õœ•»`òDbÕzzEÎå̵:ǹʮ}¥œ¯AA=m}ät|5 Éz:Ö}ÎeÎIº™‡O̼¸²Ð †C›cÏÇ[ï½ÛC£___Ë÷ˆ×ëõ¤š*»öä´Ïéã}LÓ$ÑûYî×j-„Qê‰fÆ‘ÓVjÎÖïæûõÝWµ·åÞ9TäÌ2‰»‰Ë…%¹ñ}#øˆáàFû•d~õeÎʘEprƒÏEÂJÎ7¼üU¤žÕýl9-KÔçõ:WüÆÞ!óÏçœ*v}cñð1o„æ.è¾P-÷ãSÕ¨U?ïnì{! /ç#§-ï9§ÏínCï2‘ØCÒä´µÏi5Ÿ@·áÓ–JN b$ ‡¢_üF˜­e#ìþÀÕL¹óe¨gô…C¸Ñ©§-rÚâ\£†¸ S9mItÁà§ž±#(¼äŒ!§-•œZ6BàC¹ßþp®øÐèÅYIu‡ |ê$§ù;Èí‚ÔÓÛ9MŠì¶ž8W¼®‡­7MQe)’ÓV½œËüò¬W¤ž¶2sVsºõd²L6f¢S ‡b04¿lPGN[5rZtAGõ¼œ/ã(ç%rÚRÉ)Y£q r&œjùà¨çÌh_zÚ"§-•œ˜5о0"ÚövPÔÇ‘ÓÖqN“ ŸiÔ®§?99ÛqªZO&Ëdã\£qä´UêØ ë}Áêé 9mísÒü²1k]˜¯&÷1k4®MÎûóeÆ­g™.8n=Ë §-•œ˜5GN[–9§©Ü¾ ¯zž1ò•ó9m©ä”À¬Q8÷Õ– ¢½bWu14GN[§9ou´ò]P¾žÎÜÎÙèN·õÄ9fƑӖAÎ*û‚Õ³ rÚâ\£†˜5 5ŒˆGh~Ùk–óæÄÑ!ê9O©Ò‡¨gEä´¥’SC£qä´•™³úŽ`çõ¬.5gëÍ{oõD‚–æR1Bx‡0…05›ERÕïn´¼0¯î9ý|RÍÝhÔUëé9m©ä”Àõqä´uœó,{»}AízúCN[*9%p@=cD@yÌ#§­Ôœ­» ÇzM$ö˜ó9m©ä”ÀÐh\ËœwŽ èªž­»`謞Ó–JN P¸¦Ò°ØÉy€3Ëdã õqä´õ‘sÚþ[^~”¬§c7r6}7ºõ¤ùech4Žœ¶r~;ê‚Aºž.‘Ó–JN Ì…κ €q0k4®qÎäù2ÂõtÙ…ëé9m©ä”ÀÐh9mírzì‚Ám=w_ŒœæÜ!§-•œ˜5Šv¦ð}êL>ÑÚah4Žœ¶¾sN“ó.(VO÷â9}¼~ê‰d Æ‘ÓÖûýþþQÐm !hÕSı¡¿z"³FQË©1†ÅÐh\ûœiGÛçL¡ÓýÖós}ð›ó9m©ä”Ðò¼*»öä4£ÓƒD=CÝät³U爛¸£å…y1©.ˆ6X;Ðç#§UüÎéfàŒëz®ÓÖ9£§ç^0ÈùK[6B‰µ-ó¹Ï«I|äô9x®ç'rÚ$çÜáÎFé®ÿµ?Ìq焎L×T\ùúúZöó^¯×8Ýî³FãÈ™éäGAw9O¸Î¹úbä:ç 9m©ä”ÀÐh9sœO‘ø0x«ç9rÚÒÍy=Ή œk$NÕØà <…/FþÑð²14GÎ{b]ÐKÎrÚŠçôñŨŸz"C£qä¼!aj C£¶ÈiK7gô ˆåŸ–ù2ë‰3ëÛ£ahF8^¾²w?ðÂÍ¡Ñëɢ˿Î7ºoPç%glÃ×2ç.8M“ßk/­xYî1ä´¥›3qðì_×wvßù6#gÄÍ}A†FmÉçt¶2èÖs´îeˆêñLƈ¨³ \Ðè>è³FãÈyñ’!äþ.è~ÃÇr·EN[*9%04ç(çåÏ„µsö>;ÆÑr¿DN[º9Ó#ijF‘¥÷.¨‰£X¡ùekya^ÝÙY>ÕËùä<Ú:Ã9*Ë]…J=É9 –æUYŠäü`r5 …Šª,wÇõô÷ÅHe¹«ä”ÀÐ(’1ŠBX§,ða6¨#çüì!ŒÕU–» •zêæ¤ùekyø„ÄÚÈFì‚Ag¹«P©'9Äõjê_ª~È.` Æ ÓdjŒ&å®sÅA=ýÍ” *ËýÙ¹F±Áõqãæ4ï‚.7|gT–»ŠÓz:+³Êrç\£†˜5Š#E‡C5¶3FÁ¹Fã†ËYøGÁáꉂN=É9 fÆ•³üÔ˜±êYAýùSYTêIÎ14*¨Üü&ˆ²˜,“Y£q£ä¬ÕG©g-Ó4½~wÝÖÓë.¬Òrç€z#ÛFýN±9_è“ÒK¬maœºàφoˆzVô~¿Ý6•µãzú«±Òr‡‘ƒ=¹·]\5‚ゥ9"ʇ€3“e¾¾¾–&÷z½.z¡ •YOsÍÈÌ9,XñÛ¥Çz!§-rÚRÉ)!ç7B«ŸdUví»ÍÙhjL·õlä;§ûóˈÕÓ=•œn7ÂÍõ×;‘ëûSžjù±—97ÂÃ?aµå,žyõåµ}éz¼¡X^ÅÌÞnÀÄ¿–¦•±ow6|zöTg rY¢>o¬×9G7¦í=sΤ?ßüw•Ì«®÷¢.÷ÝÍ6±yž³ §Ý=nnˆ.w<ñ¯†3_T–bo9[,Ø[=[Îé2¸n=9Ž0ÛÇd™õÞzÌs]ß³ÛÐк (äµÒ:‹˜ƒß¯ÛÛf8ôIÅUvíæ|‡ÍüˆxN×TrZϱœ»õÁ±zº§’S¶6¶ÍV_7T–b9=íöPOOôrúžö¯WO<Æêм úÞð¡ 6ãpƒË0ÅiçlÞ«!ܦ9R‘Ó9m©ä”Àe˜âüæœs]œÃÓO\ñ[ÏOä´EN[*9%04Ú/—]}~1ˆ¡Ñ8Éœ~ºà®x’õtŒœ¶È9 –×#TÙµ×Ëé§ .VYôêé›XN÷[o±z®p@}6®Pß WXC  ùech4N%g˜&‰.¨ROÉœŽ&”¬§c*9%0k4ÎuÎeÃçp8ô„ëz®Ó9m©ä”À¬Ñ>ÈtA }¸ÄÐhœûœß]ÐcÎãCüýå§b<ßðµ¯grÚSˆ©RÏ'9S®Sqø˜åÎÎNðÍe˜âZæTlk‡ã¸"o‡œcR©çÜs'»>¶{ÿ˜”¿RÄШcê]€?___ËþÜëõ:ìj)é ³FãÚä¼Ûþ,t‚ånë8§ÎúàörG†Fãäìz_ånK §Ô[ ž!„Øê×:û=¯®PïO]PjÇJ”×h 4¼lÌ«š³ƒ.¸8y,w[ä´¥›3e.(q@}\Õ.ø~çwA‘Ÿ…Xî¶ÈiK7çkåâד_Ö“b6}ôð1½bhÔÝÕ$€GÞ\Ÿ §R&‚î³îŽ¡£ýΖæÕ‚0 †C§irq–µØ.)ËÝ–÷œ?ëƒ÷œ?ts¦þëæÎ”Çt£å…y%Ö¶P:§Ý‚¾®~þ†Xî¶4r¾9®±Ã¡Ñ&I:ÀõMõ4541k4®TNë.øÓýÏB£/wkW9=ýLØC==aÖ¨!¨“è‚aðz@N«±z×9WtsÒü²14ÚBÇ#¢~~¤„=®éè ç³Ì9MO¼zÎÿaþôw\¾¹—{Iä´EÎ14g–³ðŽàpõ,¬“œn~&줞n\Ÿk”aÒ[8 ¾–އC|CÅëC]4¿l Æä¬Ò½Ô3ö.½äŒ!§ŸõÁ{Îäç{š³Ö¾à(õ¬…œ¶ÈiK%§fÖdDÔÃ|øÁú\â€ú¸üœu»`ãz&ogû_îu9͹[œæÜÑÍÉd™lÌËï‚uß ‹z&Dp‘39 ¬¢¹Î¹¢›“æ—¡Ñ–ƒb4 Ò0k4î^Îv‡IôYÏvºÊéà‹QWõt@%§fÆÝÈÙô`A‰C—˽)9Ö9s@-/ÌÛ›™¿6ð[ÇÖ‡º˜,“­å…yugg>(„Æ]p›Ó͹µ6ºZîÓ–nNš_6†Fã’º`™óhßÒO=}è-gµŸ O^¢·z¶¦’Sç}ÆÁŽ`{üf½±?ЬѸӜκ`ãzÞ˜Q$¾Ü!§-rˆ¡Ñ¸ãœÎº`8Ìé`Òüžör÷çFΦëC‡õlJ%§¨Ï⯠6ã¬Ë¢1Öâ\£qÛœ^»`ËzÞyYÕåî•ÇœÇc(þrÑÍÉáÙ8×hœD gõôw…ärwŒœ¶tsÒü²14z‡ã.Øã`¢ -8ÖhbÖhÜwN ^hVÏ›%[îîÝËYaý=y‰>ëÙŽJN Ì{‡×TÊpZOgsGe–{¯9­ÝÖ³•œa8Háæ›pC£—¦)è|Àk×3÷Õ–{œyο1úÊyŽœbhôÜϾ ÷œ?®r– »_›êéINΣ£=׳•œ=Áˆè5¾ŒbõÊ=ò9AÔoÎO rf}O ž¶å¼\å¼Dε¼0¯Ç]û£A9Drº9²¾“zº‘™Óp}HÛ w^Ïêö99³L¶–æu‡áÐD|ÅŸ›Öh~ÙýtÔ=æ<Ïi;E"wÃ×O=} §-rˆY£+'yÜå€=qvNv >†FãÈùóFOC=M5Ëyóe©§-•œë6gÞçèq1º­g#9Ÿì&¿ø@õ¬B%§†F‡”ñ âÛ'ÖXІFãzΙøËÃ,¾ƒö\Ï,s–\F¬gI*9%04×gÎå±éŸ&£2ôYÏvlr¾ïÞ|Ù±êYžJN ·Ï5ºœ/”óÚÉ{§mõøÞ9šë3q³>èK9=÷ÙcïWï ·÷_¯—Õ[UÙµï?çÅß™Š~?e÷õ¬Ë2gt)?XF¬gIs¦lÉϳ¿ß°/4ÁÐh\Ï9פ›ÕT¤ †¾ëÙB‘œÖ‡¡ëY@vί¯¯¥i½^¯Ã‹=&åo¿ ¼[~ÅÔØ,ÀëÆS¤&~M˜¦iþRãüÆ<Ño¬×6yŠÞØsŒå^ùÆÑ÷"ÁXî›3ºÝIмÄK  ­6¿þó÷_M^7Or™woÖ“_öaö9»_]þq„ón ãH™Éqö˜ýýê}aúû¯ÿ¶zín¦Þ@}rýƭƇO$.Èô}pÉ#y$ä‘)C ®>04!`h°ÄoÂ<'ÏÉsòœ#<'¢4!…ôÖU¾O‘Ó9m‘Ó–JÎaõÖ¸¥åõ4Ç!`h4BÀÐh„€¡ÑCkyÒíõIcO/^¢:Ï.ƒâ¹ûO8SÉ9ó¿f‘OºÖr—ЬnN²îùg×®D†M1ÝÖs¹ôhë §T*)Dâ“.´åÂÐhÄf=s¾ÎùÿTø/æþzÜmóœñ_É5ÿk¦Ö'¶_P…Ê€‰çx–К)ñI‡¹fpó]Ûój·|Œ€²E1­PIŸt¡-§ªpýmËóH÷æ[¡Û²‹zºrø-Ûs`-Î+é<ÞšÛOúšç-§®ªPe‰æ\t]}<öI\Å“&QI·k&0ã7ˆõΖÛ/‰AjgËy¼Í÷Õy¼™Êš©òIG üF˜„ŸÐ­Ì•ô¿èýo U*©Åÿ']kË©âÿ.ÉÔ±•ð’IEND®B`‚pyqwt5-5.2.1~cvs20091107+dfsg/sphinx/GNUmakefile0000444000175000017500000000506411105612575017234 0ustar poxpox# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . SOURCES := \ cli-plot-1.png \ cli-plot-2.png \ configure.help .PHONY: help clean html web pickle htmlhelp latex changes linkcheck all: html help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " pickle to make pickle files (usable by e.g. sphinx-web)" @echo " htmlhelp to make HTML files and a HTML help project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " changes to make an overview over all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" clean: -rm -rf build/* configure.help: ../configure/configure.py python ../configure/configure.py --help > configure.help cli-plot-1.png cli-plot-2.png: ../qt4lib/PyQt4/Qwt5/qplt.py python -m doctest ../qt4lib/PyQt4/Qwt5/qplt.py html: $(SOURCES) mkdir -p build/html build/doctrees static $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html @echo @echo "Build finished. The HTML pages are in build/html." pickle: $(SOURCES) mkdir -p build/pickle build/doctrees $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle @echo @echo "Build finished; now you can process the pickle files or run" @echo " sphinx-web build/pickle" @echo "to start the sphinx-web server." web: pickle htmlhelp: $(SOURCES) mkdir -p build/htmlhelp build/doctrees $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in build/htmlhelp." latex: $(SOURCES) mkdir -p build/latex build/doctrees $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex @echo @echo "Build finished; the LaTeX files are in build/latex." @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ "run these through (pdf)latex." changes: $(SOURCES) mkdir -p build/changes build/doctrees $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes @echo @echo "The overview file is in build/changes." linkcheck: $(SOURCES) mkdir -p build/linkcheck build/doctrees $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in build/linkcheck/output.txt." # EOFpyqwt5-5.2.1~cvs20091107+dfsg/sphinx/conf.py0000444000175000017500000001311511264134316016453 0ustar poxpox# -*- coding: utf-8 -*- # # PyQwt documentation build configuration file, created by # sphinx-quickstart on Wed Sep 3 22:01:35 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module imports are okay, they're removed automatically). # # All configuration values have a default value; values that are commented out # serve to show the default value. import sys, os import time # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. #sys.path.append(os.path.abspath('some/directory')) # General configuration # --------------------- # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc'] # Add any paths that contain templates here, relative to this directory. templates_path = ['templates'] # The suffix of source filenames. source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General substitutions. project = 'PyQwt' copyright = '2001-%s, Gerard Vermeulen' % time.strftime('%Y') # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. # # The short X.Y version. version = '5.2' # The full version, including alpha/beta/rc tags. release = '5.2.1' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. today_fmt = '%B %d, %Y' # List of documents that shouldn't be included in the build. #unused_docs = [] # List of directories, relative to source directories, that shouldn't be searched # for source files. #exclude_dirs = [] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). add_module_names = False # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # Options for HTML output # ----------------------- # The style sheet to use for HTML and HTML Help pages. A file of that name # must exist either in Sphinx' static/ path, or in one of the custom paths # given in html_static_path. html_style = 'default.css' # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (within the static path) to place at the top of # the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_use_modindex = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, the reST sources are included in the HTML build as _sources/. #html_copy_source = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = '' # Output file base name for HTML help builder. htmlhelp_basename = 'PyQwtdoc' # Options for LaTeX output # ------------------------ # The paper size ('letter' or 'a4'). latex_paper_size = 'a4' # The font size ('10pt', '11pt' or '12pt'). latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, document class [howto/manual]). latex_documents = [ ('index', 'PyQwt.tex', 'PyQwt Documentation', 'Gerard Vermeulen', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_use_modindex = True pyqwt5-5.2.1~cvs20091107+dfsg/sphinx/introduction.rst0000444000175000017500000001527211233752204020433 0ustar poxpoxIntroduction ************ PyQwt is a set of Python bindings for the `Qwt `_ library featuring fast plotting of Python lists and tuples and the powerful multi-dimensional arrays provided by `NumPy `_, the fundamental package for efficient scientific and engineering computing in Python. [#]_ NumPy ===== The `NumPy `_ package extends Python with multi-dimensional arrays and a complete set of 'standard' functions and operators to manipulate the arrays. NumPy turns Python into is an ideal language experimental numerical and scientific computing (as powerful as APL, MatLab, IDL and others, but much more elegant). If you do not have a mathematical background, you can think of a 1-dimensional array as a column in a spreadsheet. The spreadsheet lets you change whole columns element by element in one single statement. In a similar way, NumPy lets you change whole arrays element by element in one single statement as illustrated by the following snippet:: >>> import numpy as np >>> x = np.arange(0.0, 10.0, 3.0) >>> y = np.sin(x) >>> x array([ 0., 3., 6., 9.]) >>> y array([ 0. , 0.14112001, -0.2794155 , 0.41211849]) >>> x*x array([ 0., 9., 36., 81.]) The statement:: >>> np.arange(0.0, 10.0, 3.0) returns a NumPy array of 4 equidistant points from 0 to 9 inclusive:: array([ 0., 3., 6., 9.]) The statements ``y = np.sin(x)`` and ``x*x`` show that NumPy arrays are manipulated element by element. All this in has been coded in C, for a manifold speedup with respect to pure Python. You can think of a 2-dimension array as a spreadsheet: in both cases you you can operate on blocks, columns, rows, slices of colums, slices of rows or individual elements. Want to learn more? Look at the `Tentative NumPy Tutorial `_ for a tutorial or at the `Guide to NumPy `_ for an advanced book. Qwt === `Qwt `_ is a C++ library based on the `Qt GUI framework `_. The Qwt library contains widgets useful for writing technical, scientific, and financial programs. It includes the following widgets: QwtCompass a very fancy QDial-like widget to display and control a direction. QwtCounter a QSpinBox-like widget to display and control a bounded floating point value. QwtDial a QDial-like widget to display and control a floating point value. QwtKnob a potentiometer-like widget to display and control a bounded floating point value. QwtPlot a widget to plot data in two dimensions. QwtSlider a QSlider-like widget to display and control a bounded floating point value. QwtThermo a thermometer-like widget to display a floating point value. QwtWheel a wheel-like widget with its axis parallel to the computer screen to control a floating point value over a very large range in very small steps. See the `Qwt manual `_ for a complete overview of the Qwt library. PyQwt with NumPy ================ PyQwt is mostly used to write graphical user interface applications. However, the following snippet shows how to use PyQwt in combination with NumPy from the command line interpreter. Line by line explanations follow the snippet:: >>> import numpy as np >>> from PyQt4.Qt import * >>> from PyQt4.Qwt5 import * >>> from PyQt4.Qwt5.qplt import * >>> application = QApplication([]) >>> x = np.arange(-2*np.pi, 2*np.pi, 0.01) >>> p = Plot( ... Curve(x, np.cos(x), Pen(Magenta, 2), "cos(x)"), ... Curve(x, np.exp(x), Pen(Red), "exp(x)", Y2), ... Axis(Y2, Log), ... "PyQwt using Qwt-%s -- http://qwt.sf.net" % QWT_VERSION_STR) >>> QPixmap.grabWidget(p).save('cli-plot-1.png', 'PNG') True >>> x = x[0:-1:10] >>> p.plot( ... Curve(x, np.cos(x-np.pi/4), Symbol(Circle, Yellow), "circle"), ... Curve(x, np.cos(x+np.pi/4), Pen(Blue), Symbol(Square, Cyan), "square")) >>> QPixmap.grabWidget(p).save('cli-plot-2.png', 'PNG') True The statements:: >>> import numpy as np >>> from PyQt4.Qt import * >>> from PyQt4.Qwt5 import * >>> from PyQt4.Qwt5.qplt import * import numpy, PyQt4, Qwt5 and qplt. The statement:: >>> application = QApplication([]) initializes and starts the Qt library so that it handles mouse movements, mouse button presses, and keyboard key presses. [#]_ The statement:: >>> x = np.arange(-2*np.pi, 2*np.pi, 0.01) creates an array with elements increasing from -2*np.pi to 2*np.pi in steps of 0.01. The statement:: >>> p = Plot( ... Curve(x, np.cos(x), Pen(Magenta, 2), "cos(x)"), ... Curve(x, np.exp(x), Pen(Red), "exp(x)", Y2), ... Axis(Y2, Log), ... "PyQwt using Qwt-%s -- http://qwt.sf.net" % QWT_VERSION_STR) creates and shows a plot widget with two curves and an additional right vertical logarithmic axis. The statement:: >>> QPixmap.grabWidget(p).save('cli-plot-1.png', 'PNG') True takes a snapshot of the plot widget and saves it into a file: .. image:: cli-plot-1.png The statement:: >>> x = x[0:-1:10] creates a new array from the old one by selecting every tenth element start from the index 0. The statement:: >>> p.plot( ... Curve(x, np.cos(x-np.pi/4), Symbol(Circle, Yellow), "circle"), ... Curve(x, np.cos(x+np.pi/4), Pen(Blue), Symbol(Square, Cyan), ... "square")) plots two new curves on the widget using the new array. The statement:: >>> QPixmap.grabWidget(p).save('cli-plot-2.png', 'PNG') True takes a snapshot of the plot widget and saves it into a file: .. image:: cli-plot-2.png .. _getting-help: Getting help ============ PyQwt and PyQwt3D have a low volume mailing list to answer questions on installation problems and how to use the more advanced features. In particular, many of the more advanced examples using object oriented programming have been written to answer questions. Most questions help to improve PyQwt! Please, `subscribe `_ to the mailing list before posting on the `mailing list `_. The mailing list is a subscribers only list and mail from non-subscribers is deferred to filter spam (more than 95 % of the mail by non-subscribers is spam and mail by non-subscribers is rejected). The mailing list is configured to garantee anonimity as much as possible. .. [#] The older numerical Python extension packages, `numarray `_ and `Numeric `_ are deprecated. .. [#] PyQt-4.3.x and later support displaying Qt widgets from the Python command line interpreter.pyqwt5-5.2.1~cvs20091107+dfsg/sphinx/configure.help0000444000175000017500000000574511105612576020024 0ustar poxpoxUsage: python configure.py [options] Each option takes at most one argument, but some options accumulate arguments when repeated. For example, invoke: python configure.py -I . -I .. to search the current *and* parent directories for headers. Options: -h, --help show this help message and exit Common options: -3, --qt3 build for Qt3 and PyQt [default Qt4] -4, --qt4 build for Qt4 and PyQt4 [default Qt4] -Q /sources/of/qwt, --qwt-sources=/sources/of/qwt compile and link the Qwt source files in /sources/of/qwt statically into PyQwt -I /usr/lib/qt3/include/qwt, --extra-include-dirs=/usr/lib/qt3/include/qwt add an extra directory to search for headers (the compiler must be able to find the Qwt headers without the -Q option) -L /usr/lib/qt3/lib, --extra-lib-dirs=/usr/lib/qt3/lib add an extra directory to search for libraries (the linker must be able to find the Qwt library without the -Q option) -j N, --jobs=N concatenate the SIP generated code into N files [default 1 per class] (to speed up make by running simultaneous jobs on multiprocessor systems) Make options: --debug enable debugging symbols [default disabled] --extra-cflags=EXTRA_CFLAG add an extra C compiler flag --extra-cxxflags=EXTRA_CXXFLAG add an extra C++ compiler flag -D HAS_EXTRA_SENSORY_PERCEPTION, --extra-defines=HAS_EXTRA_SENSORY_PERCEPTION add an extra preprocessor definition -l extra_sensory_perception, --extra-libs=extra_sensory_perception add an extra library --extra-lflags=EXTRA_LFLAG add an extra linker flag SIP options: -x EXTRA_SENSORY_PERCEPTION, --excluded-features=EXTRA_SENSORY_PERCEPTION add a feature for SIP to exclude (normally one of the features in sip/features.sip) -t EXTRA_SENSORY_PERCEPTION, --timelines=EXTRA_SENSORY_PERCEPTION add a timeline option for SIP (normally one of the timeline options in sip/timelines.sip) --sip-include-dirs=SIP_INCLUDE_DIR add an extra directory for SIP to search --trace enable trace of the execution of the bindings [default disabled] Detection options: --disable-numarray disable detection and use of numarray [default enabled] --disable-numeric disable detection and use of Numeric [default enabled] --disable-numpy disable detection and use of NumPy [default enabled] Install options: --module-install-path=MODULE_INSTALL_PATH specify the install directory for the Python modules pyqwt5-5.2.1~cvs20091107+dfsg/sphinx/reference.rst0000444000175000017500000003157211106072402017643 0ustar poxpoxPyQwt Reference Guide ********************* .. module:: PyQt4.Qwt5 :mod:`PyQt4.Qwt5` ================= The reference should be used in conjunction with the `Qwt manual `_. Only the differences specific to the Python bindings are documented here. In this chapter, **is not yet implemented** implies that the feature can be easily implemented if needed, **is not implemented** implies that the feature is not easily implemented, and **is not Pythonic** implies that the feature will not be implemented because it violates the Python philosophy (e.g. may use dangling pointers). If a class is described as being **is fully implemented** then all non-private member functions and all public class variables have been implemented. Undocumented classes have not yet been implemented or are still experimental. Class reference --------------- .. class:: QwtAbstractScale is fully implemented. .. class:: QwtAbstractScaleDraw is fully implemented. .. class:: QwtAbstractSlider is fully implemented. .. class:: QwtAlphaColorMap is fully implemented. .. class:: QwtArrayData is fully implemented. .. class:: QwtArrayDouble FIXME. .. class:: QwtArrayInt FIXME. .. class:: QwtArrayQwtDoubleInterval FIXME. .. class:: QwtArrayQwtDoublePoint FIXME. .. class:: QwtArrowButton is fully implemented. .. class:: QwtClipper is fully implemented, but only available when PyQwt wraps Qwt-5.1.x. .. class:: QwtColorMap is fully implemented. .. class:: QwtCompass is fully implemented. .. class:: QwtCompassMagnetNeedle is fully implemented. .. class:: QwtCompassRose is fully implemented. .. class:: QwtCompassWindArrow is fully implemented. .. class:: QwtCounter is fully implemented. .. class:: QwtCurveFitter is fully implemented. .. class:: QwtData is fully implemented. .. class:: QwtDial is fully implemented. .. class:: QwtDialNeedle is fully implemented. .. class:: QwtDialScaleDraw is fully implemented. .. class:: QwtDialSimpleNeedle is fully implemented. .. class:: QwtDoubleInterval is fully implemented. .. class:: QwtDoublePoint is fully implemented, but only available when PyQt wraps Qt-3. When PyQt wraps Qt-4, replace this class with `QPointF` except in signals. For example, clicking in the canvas of the plot displayed by the following program:: #!/usr/bin/env python import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt def aSlot(aQPointF): print 'aSlot gets:', aQPointF # aSlot() def make(): demo = Qwt.QwtPlot() picker = Qwt.QwtPlotPicker(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.PointSelection, Qwt.QwtPlotPicker.CrossRubberBand, Qwt.QwtPicker.AlwaysOn, demo.canvas()) picker.connect( picker, Qt.SIGNAL('selected(const QwtDoublePoint&)'), aSlot) return demo # make() def main(args): app = Qt.QApplication(args) demo = make() demo.show() sys.exit(app.exec_()) # main() if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** shows that the signal returns an object of type `QPointF`:: aSlot gets: .. class:: QwtDoubleRange is fully implemented. .. class:: QwtDoubleRect is fully implemented, but only available when PyQt wraps Qt-3. When PyQt wraps Qt-4, replace this class with `QRectF` except in signals: see :class:`QwtDoublePoint`. .. class:: QwtDoubleSize is fully implemented, but only available when PyQt wraps Qt-3. When PyQt wraps Qt-4, replace this class with `QSizeF` except in signals: see :class:`QwtDoublePoint`. .. class:: QwtDynGridLayout is fully implemented. .. class:: QwtEventPattern is fully implemented. .. class:: QwtIntervalData FIXME .. class:: QwtKnob is fully implemented. .. class:: QwtLegend is fully implemented. .. class:: QwtLegendItem is fully implemented. .. class:: QwtLegendItemManager is fully implemented, but only available when PyQwt wraps Qwt-5.1.x. .. class:: QwtLinearColorMap is fully implemented. .. class:: QwtLinearScaleEngine is fully implemented. .. class:: QwtLog10ScaleEngine is fully implemented. .. class:: QwtLegendMagnifier is fully implemented, but only available when PyQwt wraps Qwt-5.1.x. .. class:: QwtMetricsMap is fully implemented. .. class:: QwtPaintBuffer is fully implemented when PyQt wraps Qt-3. .. class:: QwtPainter is fully implemented. .. class:: QwtPanner is fully implemented. .. class:: QwtPicker is fully implemented. .. class:: QwtPickerClickPointMachine is fully implemented. .. class:: QwtPickerClickRectMachine is fully implemented. .. class:: QwtPickerDragPointMachine is fully implemented. .. class:: QwtPickerDragRectMachine is fully implemented. .. class:: QwtPickerMachine is fully implemented. .. class:: QwtPickerPolygonMachine is fully implemented. .. class:: QwtPlainTextEngine is fully implemented. .. class:: QwtPlot is fully implemented, but: .. cfunction:: void print(QPrinter &printer, const QwtPlotPrintFilter &filter) is implemented as:: plot.print_(printer, filter) .. cfunction:: void print(QPainter *painter, const QRect &rect, const QwtPlotPrintFilter &filter) is implemented as:: plot.print_(painter, rect, filter) .. class:: QwtPlotCanvas is fully implemented. .. class:: QwtPlotCurve is fully implemented, but: .. cfunction:: void setData(double *x, double *y, int size) is implemented as:: curve.setData(x, y) where `x` and `y` can be any combination of lists, tuples and Numerical Python arrays. The data is copied to C++ data types. .. cfunction:: void setRawData(double *x, double *y, int size) is not Pythonic. .. class:: QwtPlotDict is fully implemented. FIXME: is the auto delete feature dangerous? .. class:: QwtPlotGrid is fully implemented. .. class:: QwtPlotItem is fully implemented. .. class:: QwtPlotLayout is fully implemented. .. class:: QwtPlotMagnifier is fully implemented. .. class:: QwtPlotMarker is fully implemented. .. class:: QwtPlotPanner is fully implemented. .. class:: QwtPlotPicker is fully implemented, but: .. cfunction:: QwtText trackerText(QwtDoublePoint &point) is implemented as:: qwtText = plotPicker.trackerTextF(point) where `point` is a `QwtDoublePoint` when PyQt wraps Qt-3 or a `QPointF` when PyQt wraps Qt-4. .. class:: QwtPlotPrintFilter is fully implemented. .. class:: QwtPlotRasterItem is fully implemented. .. class:: QwtPlotScaleItem is fully implemented, but only available when PyQwt wraps Qwt-5.1.x. .. class:: QwtPlotSpectrogram FIXME: protected methods. .. class:: QwtPlotSvgItem is fully implemented. .. class:: QwtPlotZoomer is fully implemented. .. class:: QwtPolygon When PyQt wraps Qt-3, replace this class with `QPointArray` except in signals: see :class:`.QwtDoublePoint`. When PyQt has been built for Qt-4, replace this class with `QPolygon` except in signals: see :class:`.QwtDoublePoint`. .. class:: QwtPolygonFData is fully implemented. .. class:: QwtRasterData is fully implemented. .. class:: QwtRect is fully implemented. .. class:: QwtRichTextEngine is fully implemented. .. class:: QwtRoundScaleDraw is fully implemented. .. class:: QwtScaleArithmic is fully implemented. .. class:: QwtScaleDiv .. cfunction:: QwtScaleDiv(const QwtDoubleInterval&, QwtValueList[NTickList]) is implemented as:: scaleDiv = QwtScaleDiv( qwtDoubleInterval, majorTicks, mediumTicks, minorTicks) .. cfunction:: QwtScaleDiv(double, double, QwtTickList[NTickList]) is implemented as:: scaleDiv = QwtScaleDiv( lower, upper, majorTicks, mediumTicks, minorTicks) .. class:: QwtScaleDraw is fully implemented. .. class:: QwtScaleEngine is fully implemented. .. class:: QwtScaleMap is fully implemented. .. cfunction:: QwtScaleMap(int, int, double, double) does not exist in C++, but is provided by PyQwt. .. class:: QwtScaleTransformation is fully implemented. .. class:: QwtScaleWidget is fully implemented. .. class:: QwtSimpleCompassRose is fully implemented. .. class:: QwtSlider is fully implemented. .. class:: QwtSpline is fully implemented. .. class:: QwtSplineCurveFitter is fully implemented. .. class:: QwtSymbol is fully implemented. .. class:: QwtText is fully implemented. .. class:: QwtTextEngine is fully implemented. .. class:: QwtTextLabel is fully implemented. .. class:: QwtThermo is fully implemented. .. class:: QwtWheel is fully implemented. Function reference ------------------ .. function:: toImage(array) Convert `array` to a `QImage`, where `array` must be a 2D NumPy, numarray, or Numeric array containing data of type uint8 or uin32. .. function:: toNumarray(image) Convert `image` to a 2D numarray array, where `image` must be a `QImage` with depth 8 or 32. The resulting 2D numarray array contains data of type uint8 or uint32. .. function:: toNumeric(image) Convert `image` to a 2D Numeric array, where `image` must be a `QImage` of depth 8 or 32. The resulting 2D Numeric array contains data of type uint8 or uint32. .. function:: toNumpy(image) Convert `image` to a 2D NumPy array, where `image` must be a `QImage` of depth 8 or 32. The resulting 2D NumPy array contains data of type uint8 or uint32. .. function:: to_na_array(image) Deprecated. Use :func:`toNumarray`. .. function:: to_np_array(image) Deprecated. Use :func:`toNumeric`. Template reference ------------------ PyQwt has a partial interface to the following `QwtArray` templates: #. :class:`QwtArrayDouble` for `QwtArray` #. :class:`QwtArrayInt` for `QwtArray` #. :class:`QwtArrayQwtDoubleInterval` for `QwtArray` #. :class:`QwtArrayQwtDoublePoint` for `QwtArray` when PyQt has been built against Qt-3 or for `QwtArray` when PyQt has been built against Qt-4. Those classes have at least 3 constructors, taking `QwtArrayDouble` as an example: #. ``array = QwtArrayDouble()`` #. ``array = QwtArrayDouble(int)`` #. ``array = QwtArrayDouble(otherArray)`` ``QwtArrayDouble`` and ``QwtArrayInt`` have also a constructor which takes a sequence of items convertable to a C++ double and a C++ long. For instance: - ``array = QwtArrayDouble(numpy.array([0.0, 1.0]))`` - ``array = QwtArrayInt(numpy.array([0, 1]))`` All those classes have 16 member functions, taking QwtArrayDouble as example: #. ``array = array.assign(otherArray)`` #. ``item = array.at(index)`` #. ``index = array.bsearch(item)`` #. ``index = contains(item)`` #. ``array = otherArray.copy()`` #. ``result = array.count()`` #. ``array.detach()`` #. ``array = array.duplicate(otherArray)`` #. ``bool = array.fill(item, index=-1)`` #. ``index = array.find(item, index=0)`` #. ``bool = array.isEmpty()`` #. ``bool = array.isNull()`` #. ``bool = array.resize(index)`` #. ``result = array.size()`` #. ``array.sort()`` #. ``bool = array.truncate(index)`` Iterators are not yet implemented. However, the implementation of the special class methods ``__getitem__``, ``__len__`` and ``__setitem__`` let you use those classes almost as a sequence. For instance:: >>> from PyQt4.Qwt5 import * >>> import numpy as np >>> a = QwtArrayDouble(np.arange(10, 20, 4)) >>> for i in a: # thanks to __getitem__ ... print i ... 10.0 14.0 18.0 >>> for i in range(len(a)): # thanks to __len__ ... print a[i] # thanks to __getitem__ ... 10.0 14.0 18.0 >>> for i in range(len(a)): # thanks to __len__ ... a[i] = 10+3*i # thanks to __setitem__ ... >>> for i in a: # thanks to __getitem__ ... print i ... 10.0 13.0 16.0 :mod:`PyQt4.Qwt5.qplt` ====================== .. automodule:: PyQt4.Qwt5.qplt .. autoclass:: Axis :members: .. autoclass:: Curve :members: .. autoclass:: IPlot :members: .. autoclass:: Pen :members: .. autoclass:: Plot :members: .. autoclass:: Symbol :members: :mod:`PyQt4.Qwt5.grace` ======================= .. automodule:: PyQt4.Qwt5.grace .. autoclass:: GraceProcess :members: pyqwt5-5.2.1~cvs20091107+dfsg/sphinx/installation.rst0000444000175000017500000001110411264134316020403 0ustar poxpoxInstallation ************ Source Code Installation ======================== Build Prerequisites ------------------- Recommended build prerequisites for PyQwt-|release| are: #. `Python `_, version 2.6.x and 2.5.x are supported. #. `Qt `_, version 4.5.x, 4.4.x, 4.3.x, and 3.3.x are supported. #. `SIP `_, version 4.8.x and 4.7.x (x > 3) are supported. #. `PyQt `_ for Mac OS X, Windows, and/or X11, version 4.5.x, 4.4.x, 4.3.x, 3.18.x, and 3.17.x are supported. #. optionally `NumPy `_, version 1.3.x, 1.2.x, and 1.1.x are supported. #. optionally `Qwt `_, version 5.2.x, 5.1.x, and 5.0.x are supported. The source package `PyQwt-5.2.1.tar.gz `_ contains a snapshot of the Qwt-5.2 subversion bug fix branch which may fix some bugs in Qwt-5.2.0. I recommend to compile and link the bug fix branch statically into PyQwt. To exploit the full power of PyQwt, you should install at least one of the numerical Python extensions: * `NumPy `_ * `numarray `_ * `Numeric `_ and built PyQwt with support for the numerical Python extension(s) of your choice. However, only NumPy is actively developed and numarray and Numeric are deprecated. PyQwt-|release| and recent versions of the numerical Python extensions support the `N-D array interface `_ protocol. Therefore, PyQwt supports those extensions, even if they have not been installed when PyQwt has been built. In this case, the functionality is somewhat reduced, since conversion from an QImage to a Numerical Python array is not supported. Installation ------------ The installation procedure consists of three steps: #. Unpack PyQwt-|release|.tar.gz. #. Invoke the following commands to build PyQwt-|release| for Qt-4:: cd PyQwt-5.2.1 cd configure python configure.py -Q ../qwt-5.2 make make install or invoke the commands to build PyQwt-|release| for Qt-3:: cd PyQwt-5.2.1 cd configure python configure.py -3 -Q ../qwt-5.2 make make install This assumes that the correct Python interpreter is on your path. Replace :command:`make` by :command:`nmake`, if you use Microsoft Visual C++. The commands build PyQwt against the included Qwt subversion snapshot and install PyQwt. Test the installation by playing with the example programs. #. Fine tune (optional): * to use a Qwt library already installed on your system invoke commands similar to:: python configure.py -I/usr/include/qwt -lqwt make make install where the Qwt header files are assumed to be installed in ``/usr/include/qwt``. If the linker fails to find the qwt library, add:: -L /directory/with/qwt/library to the :command:`configure.py` options. The configure.py script takes many options. The command:: python configure.py -h displays a full list of the available options .. literalinclude:: configure.help Troubleshooting and getting help --------------------------------- #. Check whether all development packages have been installed when :command:`make` produces lots of errors on Linux. #. If you fail to install PyQwt, unpack PyQwt-5.2.1.tar.gz into a clean directory and create two log files containing :file:`stdout` *and* :file:`stderr`:: python configure.py --your --options 2&>1 >configure.log make 2&>1 >make.log Send the log files to the `mailing list `_ after `subscribing `_ to the mailing list, because the mailing list is for subscribers only, see :ref:`getting-help`. Windows Binary Installer ======================== Make sure that you have installed: #. `python-2.6.3.msi `_ #. `numpy-1.3.0-win32-superpack-python2.6.exe `_ #. `PyQt-Py2.6-gpl-4.6.1-1.exe `_ before installing `PyQwt5.2.1-Python2.6-PyQt4.6.1-NumPy1.3.0-1.exe `_. pyqwt5-5.2.1~cvs20091107+dfsg/sphinx/copyright.rst0000444000175000017500000000223511226065753017725 0ustar poxpoxCopyright ********* Copyright © 2001-2009 Gerard Vermeulen Copyright © 2000 Mark Colclough PyQwt is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PyQwt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PyQwt; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. In addition, as a special exception, Gerard Vermeulen gives permission to link PyQwt dynamically with non-free versions of Qt and PyQt, and to distribute PyQwt in this form, provided that equally powerful versions of Qt and PyQt have been released under the terms of the GNU General Public License. If PyQwt is dynamically linked with non-free versions of Qt and PyQt, PyQwt becomes a free plug-in for a non-free program. pyqwt5-5.2.1~cvs20091107+dfsg/sphinx/cli-plot-2.png0000444000175000017500000003500011264134316017541 0ustar poxpox‰PNG  IHDRXýW‰Ï pHYs  :èÝ™Þ IDATxœí]¶ì&’…C½jm{ gšõRvÏêŒÁ×5õƒ29¤Ä?Ä–ö×wu¥ó(¥­"`ûç×ßB!„<•ÿY-€BY !!„GCGH!äÑÐBy4ÿZ-€(ðõõu|øþþ^«„¨c¿p…iy%ÇXÃY^Д“Z€¡_Mmõõz*•zo¿ ëÁˆÑ‚Õ ä §6_ÎHáÆì6ºZó‚Z÷›¨WêÜ»¡€àn¡Ñ†êüÉÌÇ Ÿï7Ó®ˆn´«ÔñèwM˜üd‘%÷®šMÒ××WyÅ ¾‹5œçQØ4ZÃu›kÎq] µî !mÜÁ)‰e²£eL´û‰/ý“§C çwœZäSË~UrÕ3B¬å2b´~jO{ÕãOsÿ±¢ŒÙ-ûýé˜%aÕ+ÓêOö’¤#o~Êb5c¤«¸[hÔ‘m#‚§ÿ3Z‰¿¾¾Úúé`OŸÆšÑ¾<²#64máܪs. 2ºþ4?P±³%¾QpD—ûôí<ñ·ÚNÒĪãƒ]qfì1ZmŠŠ°vIŸÃÿ>A 1»e+áµÜËM×m¨{ƒºlç²ä<%OY,?¨¡ UÜÁ¦ƒ’ ÖõP\UÇoYoDå<…×Ò5Z,UÛ _Oõ(‚å2Á µ—P¯?#¨Ä…ˆMîà}b¯Ãý§MœÊosÇ hŽ[ØAÑhåwZ[è«F"—]–žî`!C:ÄŠŒãŽPex©0äûÓ„×½à0þÂGÂhiØ„`Pý™ü@±ŽYæ¶É2Á,Êë_³?ýiZåöõ«_´ªA1e´kÊC,·"qdLÏéWÁá´ô€(·›¨vê^›µO÷Òö@Å RøÛÄ’µÜ¡GØÃ·—ýSðÈôÙ‚ß¶˜ýÉUøwTÛÙ1ZPFöW×°XáW4BÌnÁï—Œ JqÝZæbÕSv§W+,nÞ#”‚.`ù—…í?¬ð›þ§åê·Ú~Xòs]£¥Ï0sÀÏH›¥299mªêÒºUÕÆHz2Ûíw¨÷ßÂÊû©š×A‘ <Íh7 §Èƥɰ"‘U<(4Zõt=ç™lˆ+fOu{£BîÄÍC£µÃlÁ¥ij× %ÄfM2Ÿû‡F !„7ïB!iè !„<:BB!†ŽBÈ£¡#$„òhè !„<:BB!¦ze®B!(4¬ø[–½ä{Pª{„ã–¦%„¢Ky‹;²ö{DÖ¬5úïÿ{Éu !—ÿüù×ÿù¥~Zñýcߨï÷®ÅUßãÂ1BBà?þµZÂmÒ#Lï´é>ÿù×ÿíû."Û¶-þ »/r“Ÿ?‰È¾ï±ŸoÛ¶ï""Û&ûþúÿ¯“lrüÖÄ Úø6f×™}ëûÅ "?%•<Ϩ®~MHß—ÈÇÅYÜ2ùÞ{k‚k ^'XoCWÇ|GXØÆ’B†8ÂÂ-¡÷w5òADŽÖÐ= éƒ] ÃÈ}Ýõƒd‹àý×ã°£Y œP‰Påûù$º¤å½Õ•c„Š/Ès(oþöw¾œû¡ v™ÆT鄲 Üç?CDñN@TdÙ`á Š[&è,¯ 10bÌKvº";ž¬­ÀìÊ1B€'¹rˆèã§ïÅ9ƒ…ÆTùïqÃr×Ëý|" É ˆìP=h°¢¸ešÎ\My;ËwIloÞg˜!³”7…?–™†Y£„óîú=þl 5t°”ଽ]fŠxADþ÷÷ßcúï¯_§o® ¢—HM¬›zêÖö-cÙëš¿É@ӖȈ°Ho¤ÐB°eÉ8:AEÞfÙë«Óò¿ ®ëvýIl¸BV:Bû•OäÕÿ'õš§ùNcª‰\d6Ò±ƒ(n£ó#¶Ü_vÙº„ÍY£«¸vûúq‰¯±EÀ›ç204šg“®¶¥Í2Îuh­Î°çYeõ B飿6NÀã3¼I{>SÔT÷=€ê3(Š<Ï«òcÆçDç~wN HDJd_{›J娢¸Å¦ÎϬ±)ò„È¡d7V<"¢å 2> f8M„hftH ŘËü|ŽkZä.&:vë-Y†5×õ.PÌÕ’·#ô]×q#×ob_:‚;CaÌ#DA-òÃ.ûvd޶ŸƒÕi=¯DÆv~'®÷¼~ã:‚ÙŸ'`h4ƒ› ¿ïûÇ6Æ2¦qF‹uõ™çr›1B w„ÁuP汎Èèun# se‚‰×—KøÔÑ"UbÅ-#tjí¥w.´g[õµF‰C£)ŒÌž.Á²6G›H~Àå„~KèŸp‚%û/QÜbPçkIµÈ+‘U/(-y/˜5:f ¶ÐÙ¸þ¢ò„çnÜ{»Jƒ±’Ç{»•ø+yÌ­äxLš·|ÑÈŒYñlƒX,²¬‰‹‰üÜËBANÏ Å-:[Wi˜ €%‘ah4Ð Bãòn%²oÀ¸3êaI¡³k\POÆtn<¡Þ f@iq¹=:'îò@Óù)ÂÐh†€ÈŽèèîmÓªëbQYüËö ÔÁ_ÄOxsKÎE;þ¯¿±áJ‰ƒÂÐh”EAolLõ~€·Mkà´×幃ßwÒu‡(n1¥óäGœ_q0†,yG ƒ24øæÑGØ÷ÌÉ3#y}ĬZ…hΟÙÃg¾T ± C£ÆåvŽBg•H/©²{ûªš6î~–\ˆšNÅÜÎËdÁãy7nQ”e¥#~#î›D1cV‹œÚî{YçkïiÉEXÑéÕДy+"“@ˆ\BbÏò>]£¯&HάÏä^u\ˆ@9³”òÓ¬t„f-ÓÚŒ7úâmfé3[dSžDÚ´*Dq‹-/h|‡Â«%90KùÞ¼Ì “×f¬+`Ù˜Ž5"«Ã±³E6Ä Š[u*¬¯U2áÅ·Ÿ«%ïäüN[ÏŸ¼—ÛnÞ}“Þ¡þúŸY%†1ß<‰,^bæ tÍŸÉyA2Žÿýýà÷ÿýõ·ÿŸ¾ÓrÛÍ»/ý¿žóOûI! f$R}ñ¶ûsÆþ«ðµ÷³äBëô½`r’Ì9= ”¸ÏÉá%¸fµ¸.`¹Kkø‰c导å:N¤úmų ÂÚapfýñ¥ñT&›ª®(½ä5½¹‘¿\Mx½•Úv‡(%ÞÆò0ïÊyá16Lx3tºƒ… hάŸ®Z؉b/x^lˆŒæÕlˆsö„F9¡þƒëÎ8EÐy[‘}óJ?6x*Â’Ò§³}E…khҴƄنó^±qA׃úz“N–q?)÷ˆÌý!ذ&2„Îy"{V¡ÁÌ!´I¯Î†) õ»ÌΖ1Ú)D)ñ6®™/Áÿ¼z5—#“>Cf[è/,Y|Q¿¥uŸïÝÝz/HÐIø¼rwÈ¬Ñ ‘Ä*CDw0¦cÉÔæÏ‹7&DqËd×®\iÀ˜œP?ôý!˜¶0Z¤V^†5cÙÈÜÌ)KNÒ™îfׯø\€[>ß¾Œ˜úÞê—ÃÐèF*=éÂú_¦ž)‰¨‡Cm¯µFFÀ¬Ñ y‘}ƒZÜÄ˜Š ¹’ªÍ¿ Š[útîûîeÔF²j5¼ „1!DâÂÐh†Ñ"µ¦‘ÝʘKžy¨†¢¸e´N¥¾ „1!DâÂÐèzXÅ}&­¬v¹èñ¡ëÒ\`A•LYd½ Ò‹ Y C£ D ˆÎ"»¯°Ê’ÇÀñ/ûnQÜ2Ngy_°à³HW –ŒŒRâ 04šB¤€è,9seµ¸†5ùô܆©íˆýí'۰{ÀШŒ‰Ý‚mÛ\ƒ1·ì–¤VT(ï²ûDj`hôgIÃëB£bFd"!@±d£N—>{ÉPõvRš›`L‘¸04*"©™C†D&Й©³²Zw[±ïGW°yýìI±ˆâE#×Nƒ0&„H\Vöo…Ù„Øû-çiÿék]‘M„ïàvà ¢d0+7æ…†™)²gB!©Ȫ"–E#o˜"çÓ°õ`•óB”ëL/سè(i…)ÑQK6ê<½‚Ôž¤ò˜"µÐroå0kTDL¿û“òäEGVT茈>Îra\÷#¸™­ûë±ô;¤ß~ÿãøðϯ¿ 2=qnÔYUĈÈ,:3";_Gîò2S€(néÑ9q\˜Í"ÝžïUMÿªœß~ÿëÌÄ|áÉ[Ÿ¶ª?þz’”ðë ~”Y£*DöÅÄ:E7¦ÚÊjg‰ @·4¦þn"Ý S5@S]¤~tû¼'¾Gúþ_Gƒ¡Ñö]}ÍŠZäÑYq”ôÐÿ"¢·ÆŸG ”»´žþ+C£ D ˆN‘½ýÊñ±KJ­Níï–רÆ©µQ¶:éê}LmØûϯ¿·­zŒ°žgh4„HÑ9P¤v?Àxl¢¸¥JçºÉ‚ÆÄÝ¡~´ÿs£»…04JnDkƒf¶ð§~@06PyFîÌUÀ ×Ÿgؼ04Úð'è@k f€) :£"Wô.~ò$ ¢¸%­ÓL˜ê¡Qâ³r÷ û•OÚºÒÕ4·EÌ_ö–Ƭ;»ÒihI=Â:·ÍŽcBˆÄ…¡ÑOV¿û3}‘Üœô4‰Õ ·ÉµC£?±&2„N‘:'ê&L¤/BXR®:“^°w™½Örƒ0&C£CaÖh‘¢35\ÔŒvâ•,³ºk’Ž @·œtΙ2_zcBˆÄe导äŠÙiLãÐYn[ÕT\tTî2O ³rc^³ õíù"Û.gÖ˜>©„Hq:Ë^(V½v"¿€¦×e˜´†F3´ˆ\1‡ì¶ÆœŽ‘é¦ÙˆÈ,å^°—ŽHö{©÷™L¾dà®5 ³FÉ£I÷¦5ãA 6Çu̇‚Œ¬båVçY­¢c‚ˆÄ…¡Ñ "D§¾ÈÃC-©Ë»/X¢Òoâk~§Æ{ã-Óc„6U݆F(,5IfÂÂ1ECDÔÀ‚vpÏ8“eá„úOæô|ÓÆ|cMd0!ÅšÈ vE~zA»:=@EÒù)ÂÐèM€0¦/ry@ì*éúÙm(Œ÷¥/8Ig_Ò¨1?yå·ßÿ8}3mÃú*%ë0Ë!Ò˧ÌCzŠPð÷¿Æ~ý‚OŸO??þêoÁÛÚþ€¡Q»TÞCSYä¯ôDKöñ‚¥:—¾a˜3f‘'~ûý÷à—ÿüúåtoA?#泟 Fè2ûbbµ3|Mó͑ڧ|®%›‰Ï€)Ñ©³Æ^¶Œá*Ò~²Ì?¿~ývq…'/xàºnm7ô”§S¥½)C£¸Ô$1…ÝÌþåáP™«8›Î¯Sϯö¾ ûŽéÓžaö-ãt¥žÂ€èìCˆáMyŒaMd06`¢¸ ¼à<1aÌ"Ãäž çÉܨÞ‚AWG GxZŒÐD¹®Y» 0œ1—ÄbœDº¤H]_Üe}Áõ:  Èq”äˆúþÏ9— S,ÿ2xL¢Çùá}Wyüò6½ï6¸Ô¤],v&ƒjDtíûݰó“:š`À3}dÕ7>-c„Zƒ´À}{@S_ä€;¶fIs³þk¼ 5cž°¿é„øÿƒýé@pBýM€0¦‘Û¶9‰^…ef‹lœ¤³õ »ùéWKÒù)ò±¡ßËMΈ}nÀxÍ“W¿aóY­(Š}cÊ“E§TÜèÁ JR§÷L­|¸ö7K®^Ž}…Ðz„i÷v ‡Þÿ­Ä¯†á³`9Lcè”y>\ÄgGX’œªåü bP½ì2g?&cžÞú{7C±ä ‘Ý^ÆÔB$.\kô&@óå ôæ þé\St† @xAYm¥B(’p­QBÊèôß³b:XXD4 ƒ©D‰ÿÉ2 ˹'?lÛÏ¿eòÙƤH-ÆŠÔó‚*W·L–8ah4…S¸p¨t®¿Ã¾1%4sË (–r^W:JçO‡ ,6ûè'"ÂÐ(Y@§/´îI2vÒD8”pB}‘S‡€Œ©Óv¯QK®îËÆšÏ.¢ïªåj®"Ÿ5m0 fX.²pñ‹å:KÀi!H>a}Á%º:A+W‘t~Š04 ăJòØL]5 ‚Y£ D ˆN‘ãïÒ¬%¨²rþò`/hÖ˜~&¶Y‘>"qah4„HÑ©&rä½Z¶$ĸ McŽm„H\%SAߎ|ßï2LÈQBÞ w„‰%¼!ÞÅÞ[Öõ5ã‡PŒ¹pT§°€bÉ.‘³œù#Œ9‘¸ w„§íý?A”+„Hѹ¿7:¶ÌXK*½µ‹œÛ ®i~ÑR/¦¯mCè@Ñ C£yÜ3ã-»ÁJI1ÕZu½ã>øffØ\Ûáþ™ɘí¿ïúµŸu™Þ0¶ë2Sh¹Â ÞÖ˜Ó‰ ³F3@,)æéÙpkˆ î¤1²SõEõWËŠ$ ÎÂædê™؆P¸1%Ä* f0%2±“)Ð@X²BäR/Öi`k3Ÿ»•8©‡¡Ñ ¯Ð¨Z˜Îþ‡0&Ã-©(¹zÎãU§ÂªëÚÏ"ijÓ,Òåê_×&å²Ý†FóÜ|ÁeÖ¿Š@qûpè}ïL—ÃÃÅæs§ÿúÍ!R tÚØŽUä××—ë~?Ü24šÁŽÈô,`;:ƒØÙŽFX(rå\/(ƒJœÃ Df’0 ¦Ž$Cá’ÙŠ0k4„H±¬Ój@,zµK:ïnh’ñß^Ðnq¡T$Ÿ" fÐ9&q˜]̺¿RKÎ’{}A”âÞ­%ø@B$. Vbàa.î"÷'A4ˆÂbå럠"éüah” äα >™ Zµ\!$w¨Ï`Mä±ÃíñÏoû¬étø^°]äÄF¾DäþÆ}¡ã¸RäF‹û„NŠ$ fŠ\9™:* Õ˜Ö0!27YÐ_"À2&Œ™T$ÇahtÖÞ&w lÊ|Õr9ä~¶¢óS„¡Ñ "D'E–\^$ï‘^„Ö(jÆì;Í1žzü»Jbµ$ f€) :ç‹lèT‰T’/ŸQÜ2b³@B$. ’ÛWé‚ä®ËcP¤àë›Ã õ D ˆÎj‘+¢A+,Y½Ž6Dq‹éñT#"ÓpBýPVnÌk¿òID¤ÂÆ„Úù2¸Æ,ø™¶ŽôÕÌ{A)nùô@³(¿(iø“8¡~(+7æÅa5áå¬ ˆäU¾ä™Ô¦bff€)ötnÛ¶mÛû·wz¶È†¼Êy"ýÔ˜ÊkZ+î::ß+„1!DâÂ¬Ñ "ŦÎK?À¢È ^³%HÞ·¿.„%Ewâÿ°;†0&„H\˜5JH q?î2Oˆ%ÍéVü\wk£Ž Ô‰\tCÃ-©á!Š[œNKcBˆÄ…¡Ñ é…=»’AúG&É]h9ý¶ÆZR)}¢¸Eeû‘ñ@B$. ’aðÖ‡áÐ6X‰"p¡"œPŸB¤ØÓyluRdMdúYÿMµ¶<‰4;KD­ÄÇöÒ!«%Ÿ" f0+`’Ü•kɳ^°>H~ò‚fƒä¦ÄÄ HÂÐ(0w~6ncD”ó0k4CZä±ù€n`Ì+܇¦%‡yAˆâ–WbóÊ×?³:qÌ4=Í@ˆÄ…¡Ñ "Dç³DŽô¾HËAòc¨x…AckF !†F—¢½ô¶ŒgÌgîý³•$¤†F3@ˆÓD–Ä¿møÕOü˜6Þ°‰TŒŒB·ôëœr—Æ„‰ C£ D ˆÎ9";³(»DÎJ(nÑ ¶ÞkaИ"qah”UØ`‰Ègæýz`kBt8¡^‘•óZ›ó$-Ra‡^%n`Lï¸ñRo³ä¶‰ìÓ¼ Dq£lCaLN¨ÊÊyíW>)Ùù´+åËÜĘG·_¥'‹²Õ N¢¸Q€0&„H\%š<1 æÆíöy!)˜5šB¤˜Ò¹ï?ÿ>1$2Nå^Q//¸m›—¬Ú˜°ZsYK¢aL‘¸0k4„HÑy7‘§щArKöFŒgµüÆ„‰ C£ÝxS3»°H ëÍYÆÓ— ÈÜ~¤éD bIÃÐh†ÜZ£/ÜÇiÂÇ´¹ãŸq“VÈ[º:eÉAk½ ñ‚v@è¤HÂÐh‘¶ˆ?±ÆÌˆ´±›„%D'E†F p£GÕb6I{Aïì· ’2 †F3Øyøž÷ —¦›?ûÆ”„Ȥœ$Š4$o—1Q¾[¥‰ C£(Ra‘6"¢û–|:׉Г¹ˆyc ˆH\Vöï„z‰>Ó¼`å$Ɯٜä604šB¤€èÌ‹4pg‘GׯØûxÐ’ƒäKªemˆø&Ïé %4ªµê¹‘g5Í$‘Ýù2FŒ™Î”)¹ôV>DZÍüAÙlÝšž ÷éšk.Ò qŒð°ibg B棙3Ù=‚äM+yl«K¨~}}¹7‹ïïïûBtö!D ˆÎ¡"µr&·#¶(†Rc®@·,ÒY"†0&„H\˜5šB¤€èÄùúŸERË‚äf-yÝ~¤é,½2ªìcÖ˜>"qâ »‰n«É|îÐ[už{˜¥ó.´~Þ~žãW.Ðë+Àç kÇyP0áù’x3˱À†8ÂXIÄJΕ±ÁG,9øºù@Õµ:­Ñùs­iYcöÜÅڷ^p¤T~Þy‰  SáÌœy­Î†ÈWK‡§C£ DÊjÛ% Ô“97 v¹úº}„둉„1¯"µ²÷‰48Â#AÆe"±ÔØ{ÅÑK‡¸õ<ýRêÑËŽ ÉûOKÈ ¶½Š4öU’qC;v€) :-м¸@‘Zïq,ZÒ²ïÏ-óM³H×Vè>ƒ´8B-SÚ¯|R%ri~ó¡ó:Hf sªBAs"C˜¹îÇkÖ˜>Í¡Qz¾¸ “o?¤]kdÛ6wuˆ—ÜŘ,ˆ$'S ‡S„kf¨¹¯[z{½1Ý渒”ÈŠ;9þ¦IDATÉòã^p½% €) :)’0k4„Hùœ<°èêùÎUÞ˜sŒÛYPçü#ÉŠ4$‡x|@E2kT†FïCp"938"Ê 9™Ÿ" f˜*òh¯š.¸½§ðhªÒc}‰xA‘£ƒäë-áô`V§E†F3@ˆ‹E–uÓhIEªuv·ö AcBˆÄ…¡Qò °öFêK…’·J~TL˜c„Ьt„5B¤¬ÖYèe¢"‡F}*!J<+ÒÈ-ÜØàZ£Cah4„HљٵPh¤TŸsKšB'E’•É2·¤7K¢#_æ±±ýº%¯Ù)ód {å–¼„ ï&V%HØBçT‘­^–l ¶ýÈ| —³fÌ "qîý@öÉ)B”k•H׸faÚ=ÞϘ]tô­X2™/cE¤Oh©ñ:‹!yê‡Â¬QmÆï<@Nœ“$m$ˆš‚-VŸ"œPŸB¤,Ò¹½q³ÇRò³’@·ó(q‘¢“" ³F3@ˆ”…:kzÀcçN(¥Æ¨XrtœÕRŠ$ Úã™»ðtÞ¬ÁѧÉŸpä¦pB}†j‘‹š_§ÙUEF•¸ª¼gµLl©ñ ëܨ5c¹Šd²Œ" f¨é¹¢Ùß š]eʾ”;VË9ë|µÎ·eИW®"éüah”ô±6 f0"ªÈ3ƒä„L‡Y£ DÊ"ï-Ÿ\Îf¦ÁˆìQ=Æ ªYÒ­q2 hÊEz™½ €x|(’04šB¤x:'ïTç1‡çø×ÓaZnÌ Dâ²rc^ˆÎ~§ÈiZ7¦ïm?ÑÖ-)"FDl46Z§ÊùM3„H\VnÌû:7&¼AâhpD±}ŸÇÛæ@B–ÀµF3@ˆ”Y:ýøÌ»—]CëÇ j‰z§%!R2«ËΕ˜="³Ës»»~)'Ôg€)3u–wp/ƒ‚Æ$R7HaI)Ñià> ŒÙ)òðp±˜\ú¯O€Y£d ©1SéÜ¡÷sÅz\¦ ó8 óõõåúyßßßOöv ˜5šAAä”ö"­sèÄ»àõD^pÛ6Cíx„§TË>ö}÷¦éG§ê/×YE†F3t¯5ª±ù@Í…®ÌÞ| ÞÜ÷]L¯*#òŒj9  "ÓqNR×EÀTâhå¸ 1nož" f€)³tfbG·7Ù7.±›"õ‚äm"ç/Êóô×B$. f€)I“&ÞB£†½âʽðÕÒR5€0f:4šè 2./Ôé& NbÚÆ„‘«¼0áÏC§2³ÊtPåÆÒÉ¢î¯Ç‡:HN¨Ï!Rê¬ò‚–ú1 J¼MäüEyS÷.@K¼°Gû«ÿå=ß †F3X™Ë—ð‚a¥Ä“4‹œ|wƒ¼ n4h‰Ó{)ÂÐ(©à# 6="zŒÇµArBÈff€)óu®ð‚s2!JB¤€è¤HÂÐh‘2Yç­³c¬—ø.²É¾(¾\»êzø¯}MºúH§õ‘ެQRC£“˜¶1ápš½ ßhïAç¶b?çé‘€ùì¨Bç§ÈÊyA“µÚÑjABÌ3fçUÌoCQ-Q€0&E’•óB”«!‘ÉÄÑѾÁû<ür1æ\tôUî(âÖ(’04JÊÙ}O6æÃnw#T„ê3@ˆ”b-ÑҵÔ(%¾Œšú5¦%C”øU$Ÿ"ÌÍ )r¤G)ô‚Õ3‘æ¢Z®Ûdß÷ªIƤHÂÐè4¦mL¨‰KUظ_ !„ ¡Ñ ¶DÆ»ú:OÓ$4º†›l«&À•3oïâ¥0×*’c„Š04šB¤”鬘ðÙo­ ˆ%ôžb<£EZˆ ¨/׃%®× C£Ï¢t\¡i óaÕ ·„kf€)Z:ÍÓ‡5uÆÄy ºšWz6fÿXó›Þ}žSñlƒ€‰ C£ DŠŠÎñ+ˆBFdÏêf³–éÑ;1(¢ Sâd ÉxÁÞ^¢F?àøÀæ@ Z&Ë(Â¬Ñ æDFG»tÎÙMbo9-³cÚ%úÙ6€ü[2& H:?EÎŽ0û–qZ/´§0ìW> rо¬Ö½ yb‰ 34ZKób³‡u Ñ…)q2Œ@ððm‰]#ø&ÒŒ{Œ]ò¸~ßzgA¢‰Ý—dùóBnÊGÖè××—srßßß _¨D”¾È}ÿù§G‹Î»Ì7üê˜ÅøNh®vZµìY±gÛ¶—G±ý =ô„H\ZƵi!^î DJ­N¯Cš*æ ]üpTA­êÜû..qôzæÌÏßîíÔºÅî½_³ÿ+]cúà7:ã>\YP‘jž U†*cΑÚðÁ¬°kC$d ÿZ˜ùQ®ú"ÇÄú‹tz^Ð>ó{h‰`²È½u±Ù†G¸@Kœóù=<—5ꌛøâ´º@ˆÄ…Û0e€)W&Sc Œ &²o˜°0HÞÌëœ͌߂ˆÄ…¡Ñ;bÒ 60´6¼ yTÀ¬kß¶ < f€)¾N;^ðb¹*cý€ãßÌR€(ñÉ"›]5©„H\Í0HäQ­ýº]}¡Ï˜Ø;eÆ :<-O.q]¦‰tíïÂ5Q'Åomà õCaht~ÍVyÝÓö‚kCvÄ U£jCøªÉÐù)ÂÐh‘"Ê^ð¡ç’õÔrÿÊÞçî¾ä€(ñ‘‡mLªþÑiØ‘á•8ц¡Ñ "‡ôÝôj¹Äø“/Ú$Ǩ–‡Nó 8„1!DâÂÐ(:›líÁái™|xKP’Bj`h4Ã@‘.ð×~‰ë¯?;-óé%®ÇT‘•ÆÔB$.Ã{„‰%¼!:ûƒD*lCñz0öØÆ„¡H-fîœÕwßb,q2Üžv´}¹§àRcƽ&ò ˆîm(ÆÉÙ†Û04šÁ¢ÈP‚hƒÎDZæ¾ï"»OŸâv‘óY ²>ö¨+rÕÚF€¸e‘¸0k4Ãh‘Õ+l©î&1êî"Ï,K…¢ñwƒ×Ú&ıÒ.y߯e´ÈÌ [Å+ˆš3fH‹9‘!(ò…õnæÄíK¼dŸŠà1îËÛ/ðÍÐh†"c-N¡ÜE6™Ëšý€…«h®í°Z> cvŠ<Q‘Fbïû`‰kqYèüŽä—ÿéO8%È\y `Û¤aõmUüŽ)Y‚•zlÛ®àNmî õHJA¯Ç¸oŽ7v+7æH¨_@dÅ4‰äœ(K\‹A"Õ'q6蜿Æh‰—‡Fƒ=}YrÌY¹1¯ýÊ'£E*zA˜˜N_$~†´1ô–WË’ØÀ8‘Ç™»±e’¬*ò9^j ®ãN}Án–¯µMÄÆ£„̇Y£F‰¼xÁÌ¢£ùóm*«¬µSЇxt‰«’ÙP]b´Á˜óר-qf*Â¬Ñ s¼ »Øù˜bö}o^ÄcZ?à¹%® „HiÕ9ùî ŒÉÐèPËö“W®òž®Àê­–¯µm‡ÎØ!¤®5šAS¤ëŽ™ möl…§5²Ö¶‰j™[tÔ„È Ÿºìêô HÂÐh5‘ƒSc´÷K2pò¬IFdOl@¥Á}_÷Æ´Az­Q†I;aht …^÷¥V8ñÙ÷ÝÍÜxGhIž Ÿ" fPYæ½À`K„ð¥óøQƒämûù×LÞÑ?£ÄÇ3Zä1›åø×s-S ‘¸04š¡Wä¬É‚=:Cý€!¥óˆW!×ê ©¾º[ãûÜÜR0Qâ9 DâÂÐèH§Ìóy[ŽÎ¢£KVßîë´pQ² N¨ÏÐ.rîÚÉ=ÆìUZÜüÅDšš8qójYF×l–™84¦œP?†F3@xAñu.é HÑåb^ÐT?`¹€tEWTP¹Ä9N¨ C£Úô…C9™š¬¡E…îd.ª@VÁ¬Ñ u"Us“©#W®6æöÆ}¬=CÃG_¢ŸûˆlN!îá³ÎÖsÉ¢ ÷)qÒ C£*D.Mi4æÜ~@P¤µ~€ ’‹ ™B'E’•óÞ S ¢ÄuΩ·lÃnÖX½,± “eY¹1¯…̈,E" xA]cJ`¹O‰¯¦Tdù+QÜѽE~}+c.å*’ÎO†F3yAÝiz÷¿‰1 ð@‘þŠ 'ê^‰.| 1!fö¡íu&SKqW 3àÆpÑÀÔ 1y ÌÍy,Ë9p7‰:'Õ`L]ÓSªÞÑExßbî+Ò‰K|>ñ` ‰LR¢Sk]Óf Œ !†F3„E<±`ˤúótN›ý#bÒ± ‘}™SE9½ñš`Ęi(’04ZÏ/3³¾U”µeÌrÄ™'¸¦ÌE@ÙµY€®5šá,rf_°&{>`ÌUk­Å,q“hŠ9I£Dçò‰¤ %ÎéŠ04ša™¬¤Ê˜%ý€à•¸‚±C"“®³PçÚÛ1dÌ8\kt( cØ ¶PÖˆ¾ªsaÉ™¨tÚ†ÆX€ffx‰4ïÃÆì[m2ŸÎWiÓI–,,™©Z¢a`oeÚº_)\{0IͰ»y óÕÖT}cšçž"ÆÅ3¼Ïî?r—½¥1W!†FsLßYð@mf=!qkÊÔœ¥ñwŒ#04šÄ€Ä™õQ¥±èh|²¶wéÈ´úŽX«´Ù¦aQØ¥°´DŽ~ÍJè\>ÞW²ðê…@ˆÄ…¡Ñ3“)5¨RZÞH¶Þ4G‚ŒñéƒÖ$ùz\©µˆô¢£µiÃá̦’-3E†FCXJ1³¾«ÀÓ{P™‰­u&žBºà„ú Ÿ^ЄȂ6+¥óÝؤ®”Ôò#ˆðމ³ØG˜væÏ˜-q‘¸¬Ü˜×b¹^ú‚E†(^«qFÚO›ÕÑ8DiþbØTõbä*0u”]<qÕÓ‡i®"¹²Œ"+7æ5‡¥ˆ¨2{WHó<°×ƒhwîLçÖ[þ+Krt~Š0kôÍ1nvi£m‰Œ3Ugwº¼e D6â\AÚð•TÏ4¦µ´a;J@ˆÄ…Y£oâ#“…èÉe0ƒ›;a\ªqyJLºËëe ¦ [ÐB$.̵Ž7³þ<‡¬îÙx¥Ì´¼Wöç5lþ éë¬Zlã0k4ƒ-‘ñ\‰„ÎkP¥áŽö}ÈÄ [%î¡óJÔ—nSûJdÖ˜>IÍ!R²:û³ ß?2žóÙÆ}­K}eÈ”&)Ÿ³3kÂaDF‘¸04J*ؤ1Âi°ù#-x>·¹@Yˆ5˜5šB¤Ôꬽ' ÍŸýF¥ÄW²—®ú9*i+YÔaPÒ‘¸04šÁ–È˸ Ìt0M“ý~ƒ-cF€YÅGzjO«vë­/}\Ól¶”)11 DâÂÐ( ?˲”¥š?©i?×ôªÏ•ð?óaV"þJæ³Î¼Žlëc° Éí`h4„H‰étÑ«w¯±º[æÎúþ‘;IC¤ ˜öEþ”àgùÖŸHDŠÝáçaþ]ò{~dÞ˜B‘„¡Ñ,"¥Mgy§ðrXIWOeÚÆ|PDj¶ŒÙšpy/D‘¨ þê²N¯5 [ÓB$.ՎЭÊ•î™LVÔ>º®@ºÔXžÔlówâÓ ó•¡dÜ7äkÔùž’Õ`%ËsÇŽ ~?/PýþþÖºyˆÎ¾E‘. ‹Œ5ÇÊ>®âΖÑ"I+B*œôj E&b¤î}$½²hö¦sêZlæˆ^y‚È’v;vÌõ{E/`„•c„ï†ÖDÆùÞ­[ Ý)YXy»4‚[Þ º!"?‡Þ'ö«ôÝYIä©d?kÂO)\Ɖ?Ïå~~¹Ìµn„”Äj‚ÊûØJ¼ž¯¯/ç´¾¿¿ƒ[ÅŽ)ùí=`Öè-pÍâ¾û±ÈãËè#äçJÛ»Ìb5?ÃT.•ÕÏiePt(áøç© »{²HcMpŠXˆq†8ÂÂ7´nùƒ¼Ÿs#zbŒù^Ov̘–ŒŒ,ŸM¤]cúœN#z²J âDà<2µ&1й¼FÄšÙ›-çPäk‡FKûÏŸýçÏ¿ŽÏ®€ù¡öÃñN “÷ŸÑó„š²J=׫}Œ}ØK,fïÃñÑŸÿÉšúÁAo§K‘#T7ºs„BÈZÖŒþ÷Ÿ_K®K!âHr9:3~òË5æzLìûûÑ>ðøpcÓBÈ=(ÉÛˆsýþ~^`ûç×ß«®}ãd\BÑåþÆ,‹§Omy¯¼ðHõ¢ !²üH‘åGBˆq$„Èò#]ºä0ÒÆÊ õ„BÈrè !„<:BB!êv†8'„Èç¤HËç„9âœÌ1†#$„Bq7Gñ†E‘Z@ˆ©„Hâs7GH!„T±rB=!„²ö !„<:BB!†ŽBÈ£¡#$„òhV.ºí/#k9áØé´,òÀø®(ÆKܸ¼‘ãRžn¬e™#<-»nv×ÇØV–¤–“%mÓíAºZHaÿéFi'Ñah4ũگ‚Æã–¼n̽VOã6>> import numpy as np >>> from qt import * >>> from Qwt5 import * >>> from Qwt5.qplt import * >>> application = QApplication([]) >>> x = np.arange(-2*np.pi, 2*np.pi, 0.01) >>> p = Plot( ... Curve(x, np.cos(x), Pen(Magenta, 2), 'cos(x)'), ... Curve(x, np.exp(x), Pen(Red), 'exp(x)', Y2), ... Axis(Y2, Log), ... 'PyQwt using Qwt-%s -- http://qwt.sf.net' % QWT_VERSION_STR) >>> QPixmap.grabWidget(p).save('cli-plot-1.png', 'PNG') True >>> x = x[0:-1:10] >>> p.plot( ... Curve(x, np.cos(x-np.pi/4), Symbol(Circle, Yellow), 'circle'), ... Curve(x, np.cos(x+np.pi/4), Pen(Blue), Symbol(Square, Cyan), 'square')) >>> time.sleep(1) >>> QPixmap.grabWidget(p).save('cli-plot-2.png', 'PNG') True """ import sys import time from qt import * from Qwt5 import * from grace import GraceProcess # QColor aliases Black = Qt.black Blue = Qt.blue Cyan = Qt.cyan DarkBlue = Qt.darkBlue DarkCyan = Qt.darkCyan DarkGray = Qt.darkGray DarkGreen = Qt.darkGreen DarkMagenta = Qt.darkMagenta DarkRed = Qt.darkRed DarkYellow = Qt.darkYellow Gray = Qt.gray Green = Qt.green LightGray = Qt.lightGray Magenta = Qt.magenta Red = Qt.red White = Qt.white Yellow = Qt.yellow # Qt.PenStyle aliases NoLine = Qt.NoPen SolidLine = Qt.SolidLine DashLine = Qt.DashLine DotLine = Qt.DotLine DashDotLine = Qt.DashDotLine DashDotDotLine = Qt.DashDotDotLine # QwtPlot.Axis aliases Y1 = Left = QwtPlot.yLeft Y2 = Right = QwtPlot.yRight X1 = Bottom = QwtPlot.xBottom X2 = Top = QwtPlot.xTop # QwtScaleEngine aliases Lin = QwtLinearScaleEngine Log = QwtLog10ScaleEngine # QwtScaleEngine.Attribute aliases NoAttribute = QwtScaleEngine.NoAttribute IncludeReference = QwtScaleEngine.IncludeReference Symmetric = QwtScaleEngine.Symmetric Floating = QwtScaleEngine.Floating Inverted = QwtScaleEngine.Inverted # QwtSymbol.Style aliases NoSymbol = QwtSymbol.NoSymbol Circle = QwtSymbol.Ellipse Square = QwtSymbol.Rect Diamond = QwtSymbol.Diamond # font Font = QFont('Verdana') class Tracker(QObject): def __init__(self, parent): QObject.__init__(self, parent) parent.setMouseTracking(True) parent.installEventFilter(self) # __init__() def eventFilter(self, _, event): if event.type() == QEvent.MouseMove: self.emit(PYSIGNAL("MouseMoveTracked"), (event.pos(),)) return False # eventFilter() # class Tracker class Plot(QwtPlot): """A command line interpreter friendly layer over `QwtPlot`. The interpretation of the `*rest` parameters is type dependent: - `Axis`: enables the axis. - `Curve`: adds a curve. - `str` or `QString`: sets the title. - `int`: sets a set of mouse events to the zoomer actions. - (`int`, `int`): sets the size. - `QWidget`: sets the parent widget """ def __init__(self, *rest): self.size = (600, 400) # get an optional parent widget parent = None for item in rest: if isinstance(item, QWidget): parent = item self.size = None QwtPlot.__init__(self, parent) # look self.setCanvasBackground(White) self.plotLayout().setAlignCanvasToScales(True) grid = QwtPlotGrid() grid.attach(self) grid.setPen(QPen(Black, 0, DotLine)) legend = QwtLegend() legend.setItemMode(QwtLegend.ClickableItem) self.insertLegend(legend, QwtPlot.RightLegend) # zooming self.zoomers = [] zoomer = QwtPlotZoomer(X1, Y1, QwtPicker.DragSelection, QwtPicker.AlwaysOff, self.canvas()) zoomer.setRubberBandPen(QPen(Black)) self.zoomers.append(zoomer) zoomer = QwtPlotZoomer(X2, Y2, QwtPicker.DragSelection, QwtPicker.AlwaysOff, self.canvas()) zoomer.setRubberBand(QwtPicker.NoRubberBand) self.zoomers.append(zoomer) self.setZoomerMouseEventSet(0) # initialization for item in rest: if isinstance(item, Axis): self.plotAxis(item) elif isinstance(item, Curve): self.plotCurve(item) elif (isinstance(item, str) or isinstance(item, QString)): text = QwtText(item) font = QFont(Font) font.setPointSize(14) font.setBold(True) text.setFont(font) self.setTitle(text) elif isinstance(item, int): self.setZoomerMouseEventSet(item) elif (isinstance(item, tuple) and len(tuple) == 2 and isinstance(item[0], int) and isinstance(item[1], int)): self.size = item elif isinstance(item, QWidget): # accept a parent silently pass else: print "Plot() fails to accept %s." % item if self.size: apply(self.resize, self.size) # connections self.connect(self, SIGNAL("legendClicked(QwtPlotItem*)"), self.toggleVisibility) # finalize self.show() # __init__() def plot(self, *rest): """Plot additional curves and/or axes. The interpretation of the `*rest` parameters is type dependent: - `Axis`: enables the axis. - `Curve`: adds a curve. """ for item in rest: if isinstance(item, Axis): self.plotAxis(item) elif isinstance(item, Curve): self.plotCurve(item) else: print "Plot.plot() fails to accept %s." % item # plot() def plotAxis(self, axis): self.enableAxis(axis.orientation) engine = axis.engine() engine.setAttributes(axis.attributes) self.setAxisScaleEngine(axis.orientation, engine) if isinstance(engine, QwtLog10ScaleEngine): self.setAxisMaxMinor(axis.orientation, 8) self.setAxisTitle(axis.orientation, axis.title) self.clearZoomStack() # plotAxis() def plotCurve(self, curve): c = QwtPlotCurve(curve.name) c.setAxis(curve.xAxis, curve.yAxis) if curve.pen: c.setPen(curve.pen) else: c.setStyle(QwtPlotCurve.NoCurve) if curve.symbol: c.setSymbol(curve.symbol) c.setData(curve.x, curve.y) c.attach(self) self.clearZoomStack() # plotCurve() def clearZoomStack(self): """Force autoscaling and clear the zoom stack """ self.setAxisAutoScale(QwtPlot.yLeft) self.setAxisAutoScale(QwtPlot.yRight) self.setAxisAutoScale(QwtPlot.xBottom) self.setAxisAutoScale(QwtPlot.xTop) self.replot() for zoomer in self.zoomers: zoomer.setZoomBase() # clearZoomStack() def setZoomerMouseEventSet(self, index): """Attach the QwtPlotZoomer actions to a set of mouse events. """ if index == 0: pattern = [ QwtEventPattern.MousePattern(Qt.LeftButton, Qt.NoButton), QwtEventPattern.MousePattern(Qt.MidButton, Qt.NoButton), QwtEventPattern.MousePattern(Qt.RightButton, Qt.NoButton), QwtEventPattern.MousePattern(Qt.LeftButton, Qt.ShiftButton), QwtEventPattern.MousePattern(Qt.MidButton, Qt.ShiftButton), QwtEventPattern.MousePattern(Qt.RightButton, Qt.ShiftButton), ] for zoomer in self.zoomers: zoomer.setMousePattern(pattern) elif index in (1, 2, 3): for zoomer in self.zoomers: zoomer.initMousePattern(index) else: raise ValueError, 'index must be in (0, 1, 2, 3)' self.__mouseEventSet = index # setZoomerMouseEventSet() def getZoomerMouseEventSet(self): return self.__mouseEventSet # getZoomerMouseEventSet() def formatCoordinates(self, x, y): """Format mouse coordinates as real world plot coordinates. """ result = [] todo = ((QwtPlot.xBottom, "x0=%+.6g", x), (QwtPlot.yLeft, "y0=%+.6g", y), (QwtPlot.xTop, "x1=%+.6g", x), (QwtPlot.yRight, "y1=%+.6g", y)) for axis, template, value in todo: if self.axisEnabled(axis): value = self.invTransform(axis, value) result.append(template % value) return result # formatCoordinates() def toggleVisibility(self, plotItem): """Toggle the visibility of a plot item """ plotItem.setVisible(not plotItem.isVisible()) self.replot() # toggleCurve() def gracePlot(self, saveall="", pause=0.2): """Clone the plot into Grace for very high quality hard copy output. Know bug: Grace does not scale the data correctly when Grace cannot cannot keep up with gracePlot. This happens when it takes too long to load Grace in memory (exit the Grace process and try again) or when 'pause' is too short. """ g = GraceProcess(debug = 0) g('subtitle "%s"' % self.title().text()) index = 0 for xAxis, yAxis, graph, xPlace, yPlace in ( (X1, Y1, 'g0', 'normal', 'normal'), (X1, Y2, 'g1', 'normal', 'opposite'), (X2, Y1, 'g2', 'opposite', 'normal'), (X2, Y2, 'g3', 'opposite', 'opposite') ): if not (self.axisEnabled(xAxis) and self.axisEnabled(yAxis)): continue g('%s on; with %s' % (graph, graph)) # x-axes xmin = self.axisScaleDiv(xAxis).lBound() xmax = self.axisScaleDiv(xAxis).hBound() #majStep = minStep = axisScale.majStep() #majStep *= 2 g('world xmin %g; world xmax %g' % (xmin, xmax)) g('xaxis label "%s"; xaxis label char size 1.5' % self.axisTitle(xAxis).text()) g('xaxis label place %s' % xPlace) g('xaxis tick place %s' % xPlace) g('xaxis ticklabel place %s' % xPlace) time.sleep(pause) if isinstance( self.axisScaleEngine(xAxis), QwtLog10ScaleEngine ): g('xaxes scale Logarithmic') g('xaxis tick major 10') g('xaxis tick minor ticks 9') else: #print 'lin x-axis from %s to %s.' % (min, max) g('xaxes scale Normal') #g('xaxis tick major %12.6f; xaxis tick minor %12.6f' # % (majStep, minStep)) # y-axes ymin = self.axisScaleDiv(yAxis).lBound() ymax = self.axisScaleDiv(yAxis).hBound() #majStep = minStep = axisScale.majStep() #majStep *= 2 g('world ymin %g; world ymax %g' % (ymin, ymax)) g('yaxis label "%s"; yaxis label char size 1.5' % self.axisTitle(yAxis).text()) g('yaxis label place %s' % yPlace) g('yaxis tick place %s' % yPlace) g('yaxis ticklabel place %s' % yPlace) time.sleep(pause) if isinstance( self.axisScaleEngine(yAxis), QwtLog10ScaleEngine ): #print 'log y-axis from %s to %s.' % (min, max) g('yaxes scale Logarithmic') g('yaxis tick major 10') g('yaxis tick minor ticks 9') else: #print 'lin y-axis from %s to %s.' % (min, max) g('yaxes scale Normal') #g('yaxis tick major %12.6f; yaxis tick minor %12.6f' % # (majStep, minStep)) # curves for curve in self.itemList(): if not isinstance(curve, QwtPlotCurve): continue if not curve.isVisible(): continue if not (xAxis == curve.xAxis() and yAxis == curve.yAxis()): continue g('s%s legend "%s"' % (index, curve.title().text())) #print "curve.symbol().style()", curve.symbol().style() if curve.symbol().style() > QwtSymbol.NoSymbol: g('s%s symbol 1;' 's%s symbol size 0.4;' 's%s symbol fill pattern 1' % (index, index, index)) #print "curve.style()", curve.style() if curve.style(): g('s%s line linestyle 1' % index) else: g('s%s line linestyle 0' % index) for i in range(curve.dataSize()): g('%s.s%s point %g, %g' % (graph, index, curve.x(i), curve.y(i))) index += 1 # finalize g('redraw') if saveall: time.sleep(pause) g('saveall "%s"' % saveall) time.sleep(pause) g.kill() # gracePlot() # class Plot class Curve: """A command line friendly layer over `QwtPlotCurve`. Parameters: - `x`: sequence of numbers - `y`: sequence of numbers The interpretation of the `*rest` parameters is type dependent: - `Axis`: attaches an axis to the curve. - `Pen`: sets the pen to connect the data points. - `Symbol`: sets the symbol to draw the data points. - `str`, `QString`, or `QwtText`: sets the curve title. """ def __init__(self, x, y, *rest): self.x = x # must be sequence of floats, typecode()? self.y = y # must be sequence of floats self.name = "" self.xAxis = X1 self.yAxis = Y1 self.symbol = None self.pen = None for item in rest: if isinstance(item, QwtPlot.Axis): if item in (X1, X2): self.xAxis = item elif item in (Y1, Y2): self.yAxis = item elif isinstance(item, Pen): self.pen = item elif (isinstance(item, str) or isinstance(item, QString)): self.name = item elif isinstance(item, Symbol): self.symbol = item else: print "Curve fails to accept %s." % item if not self.symbol and not self.pen: self.pen = QPen() # __init__() # class Curve() class Axis: """A command line interpreter friendly class. The interpretation of the `*rest` parameters is type dependent: - `QwtPlot.Axis`: sets the orientation of the axis. - `QwtScaleEngine`: sets the axis type (Lin or Log). - `int` : sets the attributes of the axis. - `string` or `QString`: sets the title of the axis. """ def __init__(self, *rest): self.attributes = NoAttribute self.engine = QwtLinearScaleEngine self.title = QwtText('') font = QFont(Font) font.setPointSize(12) font.setBold(True) self.title.setFont(font) for item in rest: if isinstance(item, QwtPlot.Axis): self.orientation = item elif item in [Lin, Log]: self.engine = item elif isinstance(item, int): self.attributes = item elif (isinstance(item, str) or isinstance(item, QString)): self.title.setText(item) else: print "Axis() fails to accept %s." % item # __init__() # class Axis class Symbol(QwtSymbol): """A command line friendly layer over `QwtSymbol`. The interpretation of the `*rest` parameters is type dependent: - `QColor`: sets the symbol fill color. - `QwtSymbol.Style`: sets symbol style. - `int`: sets the symbol size. """ def __init__(self, *rest): QwtSymbol.__init__(self) self.setSize(5) for item in rest: if isinstance(item, QColor): brush = self.brush() brush.setColor(item) self.setBrush(brush) elif isinstance(item, QwtSymbol.Style): self.setStyle(item) elif isinstance(item, int): self.setSize(item) else: print "Symbol fails to accept %s." % item # __init__() # class Symbol class Pen(QPen): """A command line friendly layer over `QPen`. The interpretation of the `*rest` parameters is type dependent: - `Qt.PenStyle`: sets the pen style. - `QColor` sets the pen color. - `int`: sets the pen width. """ def __init__(self, *rest): QPen.__init__(self) for item in rest: if isinstance(item, Qt.PenStyle): self.setStyle(item.style) elif isinstance(item, QColor): self.setColor(item) elif isinstance(item, int): self.setWidth(item) else: print "Pen fails to accept %s." % item # __init__() # class Pen print_xpm = [ '32 32 12 1', 'a c #ffffff', 'h c #ffff00', 'c c #ffffff', 'f c #dcdcdc', 'b c #c0c0c0', 'j c #a0a0a4', 'e c #808080', 'g c #808000', 'd c #585858', 'i c #00ff00', '# c #000000', '. c None', '................................', '................................', '...........###..................', '..........#abb###...............', '.........#aabbbbb###............', '.........#ddaaabbbbb###.........', '........#ddddddaaabbbbb###......', '.......#deffddddddaaabbbbb###...', '......#deaaabbbddddddaaabbbbb###', '.....#deaaaaaaabbbddddddaaabbbb#', '....#deaaabbbaaaa#ddedddfggaaad#', '...#deaaaaaaaaaa#ddeeeeafgggfdd#', '..#deaaabbbaaaa#ddeeeeabbbbgfdd#', '.#deeefaaaaaaa#ddeeeeabbhhbbadd#', '#aabbbeeefaaa#ddeeeeabbbbbbaddd#', '#bbaaabbbeee#ddeeeeabbiibbadddd#', '#bbbbbaaabbbeeeeeeabbbbbbaddddd#', '#bjbbbbbbaaabbbbeabbbbbbadddddd#', '#bjjjjbbbbbbaaaeabbbbbbaddddddd#', '#bjaaajjjbbbbbbaaabbbbadddddddd#', '#bbbbbaaajjjbbbbbbaaaaddddddddd#', '#bjbbbbbbaaajjjbbbbbbddddddddd#.', '#bjjjjbbbbbbaaajjjbbbdddddddd#..', '#bjaaajjjbbbbbbjaajjbddddddd#...', '#bbbbbaaajjjbbbjbbaabdddddd#....', '###bbbbbbaaajjjjbbbbbddddd#.....', '...###bbbbbbaaajbbbbbdddd#......', '......###bbbbbbjbbbbbddd#.......', '.........###bbbbbbbbbdd#........', '............###bbbbbbd#.........', '...............###bbb#..........', '..................###...........', ] grace_xpm = [ '48 39 6 1', ' c #000000000000', '. c #FFFFFFFFFFFF', 'X c #BEFBBEFBBEFB', 'o c #51445144FFFF', 'O c #FFFF14514103', '+ c #0000AAAA1861', ' ', ' .............................................. ', ' .............................................. ', ' ............... ............. ', ' .............................................. ', ' ................. ............... ', ' .............................................. ', ' ....... ...... ', ' ....... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ...... ', ' ....... XXXXXXXXXXXXXXXXXXXXXXXXXXoXXXX ...... ', ' ..... . XXoooXX XXXXXXXXXXXoooXXXX ...... ', ' .. .... XXXXXXXXXXXXXXXXXXXXXXXXoXooOXX ...... ', ' .. .... XXOOOXX XXXXXXXXXXXXoXOoXXX ...... ', ' .. .... XXXXXXXXXXXXXXXXXXXXXXXoOOXooXX ...... ', ' .. .... XX+++XX XXXXooXXXXOoXXXXoXX ...... ', ' .. .. . XXXXXXXXXXXXXXXoXoXXXOoXXXXXXXX ...... ', ' .. .... XXXXXXXXXXXXXXXoXoXOOooXXXXXXXX ...... ', ' .. .... XXXXXXXXXXXXXXoXXooXXoXXXXXXXXX ...... ', ' .. .... XXXXXXXoXXXXXooXOOoXoXXXXXXXXXX ...... ', ' .. .... XXXXXXooXXXXXoOOXXooXXXXXXXXXXX ...... ', ' .. .. . XXXXXXoXoXXXoOXXXXXXXXXXXXXXXXX ...... ', ' .. .... XXXXXooXoXXOoXXXXXXXXXXXXXXXXXX ...... ', ' .. .... XXXXooXXooOooXXXXXXXXXXXXXXXXXX ...... ', ' .. .... XXXXoXXOOoXoXXXXXXXXXX+++++XXXX ...... ', ' .. .... XXXXoXOXXoXoXXXXXXXXXX+++++XXXX ...... ', ' .. .. . XXXooOXXXXoXXXX+++++XX+++++XXXX ...... ', ' .. .... XXOoXXXXXXXXXXX+++++XX+++++XXXX ...... ', ' .. .... XOoXXXXX+++++XX+++++XX+++++XXXX ...... ', ' .. .... XXoXXXXX+++++XX+++++XX+++++XXXX ...... ', ' ....... XooXXXXX+++++XX+++++XX+++++XXXX ...... ', ' ..... . XXXXXXXX+++++XX+++++XX+++++XXXX ...... ', ' ....... ...... ', ' .............................................. ', ' ........ .... .... .... .... .... .... ....... ', ' .............................................. ', ' .............. ............ ', ' .............................................. ', ' .............................................. ', ' ', ] class IPlot(QMainWindow): """A QMainWindow widget with a Plot widget as central widget. It provides: #. a toolbar for printing and piping into Grace. #. a legend with control to toggle curves between hidden and shown. #. mouse tracking to display the coordinates in the status bar. #. an infinite stack of zoom regions. The interpretation of the `rest` parameters is type dependent: - `Axis`: enables the axis. - `Curve`: adds a curve. - `str` or `QString`: sets the title. - `int`: sets a set of mouse events to the zoomer actions. - (`int`, `int`): sets the size. """ def __init__(self, *rest): QMainWindow.__init__(self) self.__plot = Plot(self, *rest) self.setCentralWidget(self.__plot) toolBar = QToolBar(self) printButton = QToolButton(toolBar) printButton.setText("Print") printButton.setPixmap(QPixmap(print_xpm)) toolBar.addSeparator() graceButton = QToolButton(toolBar) graceButton.setText("Grace") graceButton.setPixmap(QPixmap(grace_xpm)) toolBar.addSeparator() mouseComboBox = QComboBox(toolBar) for name in ('3 buttons (PyQwt)', '1 button', '2 buttons', '3 buttons (Qwt)'): mouseComboBox.insertItem(name) mouseComboBox.setCurrentItem(self.__plot.getZoomerMouseEventSet()) toolBar.addSeparator() self.connect(printButton, SIGNAL('clicked()'), self.printPlot) self.connect(graceButton, SIGNAL('clicked()'), self.__plot.gracePlot) self.connect(mouseComboBox, SIGNAL('activated(int)'), self.__plot.setZoomerMouseEventSet) self.connect(Tracker(self.__plot.canvas()), PYSIGNAL("MouseMoveTracked"), self.showCoordinates) self.statusBar().message("Move the mouse within the plot canvas" " to show the cursor position.") QWhatsThis.add( printButton, 'Print to a printer or an (E)PS file.' ) QWhatsThis.add( graceButton, 'Clone the plot into Grace.\n\n' 'The hardcopy output of Grace is better for\n' 'scientific journals and LaTeX documents.' ) QWhatsThis.add( mouseComboBox, 'Configure the mouse events for the QwtPlotZoomer.\n\n' '3 buttons (PyQwt style):\n' '- left-click & drag to zoom\n' '- middle-click to unzoom all\n' '- right-click to walk down the stack\n' '- shift-right-click to walk up the stack.\n' '1 button:\n' '- click & drag to zoom\n' '- control-click to unzoom all\n' '- alt-click to walk down the stack\n' '- shift-alt-click to walk up the stack.\n' '2 buttons:\n' '- left-click & drag to zoom\n' '- right-click to unzoom all\n' '- alt-left-click to walk down the stack\n' '- alt-shift-left-click to walk up the stack.\n' '3 buttons (Qwt style):\n' '- left-click & drag to zoom\n' '- right-click to unzoom all\n' '- middle-click to walk down the stack\n' '- shift-middle-click to walk up the stack.\n\n' 'If some of those key combinations interfere with\n' 'your Window manager, press the:\n' '- escape-key to unzoom all\n' '- minus-key to walk down the stack\n' '- plus-key to walk up the stack.' ) QWhatsThis.add( self.__plot.legend(), 'Clicking on a legend button toggles\n' 'a curve between hidden and shown.' ) QWhatsThis.add( self.__plot.canvas(), 'Clicking on a legend button toggles a curve\n' 'between hidden and shown.\n\n' 'A QwtPlotZoomer lets you zoom infinitely deep\n' 'by saving the zoom states on a stack. You can:\n' '- select a zoom region\n' '- unzoom all\n' '- walk down the stack\n' '- walk up the stack.\n\n' 'The combo box in the toolbar lets you attach\n' 'different sets of mouse events to those actions.' ) self.resize(700, 500) self.show() # __init__() def plot(self, *rest): self.__plot.plot(*rest) # plot() def printPlot(self): printer = QPrinter(QPrinter.HighResolution) printer.setColorMode(QPrinter.Color) printer.setOutputToFile(True) if printer.setup(): self.__plot.print_(printer) # printPlot() def showCoordinates(self, position): self.statusBar().message(' -- '.join( self.__plot.formatCoordinates(position.x(), position.y()))) # showCoordinates() def __getattr__(self, attr): """Inherit everything from Plot """ if hasattr(self.__plot, attr): return getattr(self.__plot, attr) else: raise AttributeError, ('%s has no attribute named %s' % (self.__class__.__name__, attr)) # __getattr__() # class IPlot # Admire! def testPlot(): if 'np' not in dir(): import anynumpy as np x = np.arange(-2*np.pi, 2*np.pi, 0.01) title = "PyQwt using Qt-%s and Qwt-%s" % (QT_VERSION_STR, QWT_VERSION_STR) p = Plot(Axis(Bottom, "linear x-axis"), Axis(Left, "linear y-axis"), Axis(Right, Log, "logarithmic y-axis"), Curve(x, np.cos(x), Pen(Magenta, 2), "cos(x)"), Curve(x, np.exp(x), Pen(Red), "exp(x)", Right), title, ) x = x[0:-1:10] p.plot( Curve(x, np.cos(x-np.pi/4), Symbol(Circle, Yellow), "circle"), Curve(x, np.cos(x+np.pi/4), Pen(Blue), Symbol(Square, Cyan), "square"), ) return p # testPlot() def testIPlot(): if 'np' not in dir(): import anynumpy as np x = np.arange(-2*np.pi, 2*np.pi, 0.01) title = "PyQwt using Qt-%s and Qwt-%s" % (QT_VERSION_STR, QWT_VERSION_STR) p = IPlot(Axis(Bottom, "linear x-axis"), Axis(Left, "linear y-axis"), Axis(Right, Log, "logarithmic y-axis"), Curve(x, np.cos(x), Pen(Magenta, 2), "cos(x)"), Curve(x, np.exp(x), Pen(Red), "exp(x)", Right), title, ) x = x[0:-1:10] p.plot( Curve(x, np.cos(x-np.pi/4), Symbol(Circle, Yellow), "circle"), Curve(x, np.cos(x+np.pi/4), Pen(Blue), Symbol(Square, Cyan), "square"), ) return p # testIPlot() def standard_map(x, y, kappa, n): if 'np' not in dir(): import anynumpy as np xs = np.zeros(n, np.Float) ys = np.zeros(n, np.Float) for i in range(n): xs[i] = x ys[i] = y xn = y-kappa*np.sin(2.0*np.pi*x) yn = x+y if (xn > 1.0) or (xn < 0.0): x = xn-np.floor(xn) else: x = xn if (yn > 1.0) or (yn < 0.0): y = yn-np.floor(yn) else: y = yn return xs, ys # standard_map() def testStandardMap(): import random x = random.random() y = random.random() kappa = random.random() print "x = %s, y = %s, kappa = %s" % (x, y, kappa) xs, ys = standard_map(x, y, kappa, 1 << 18) title = "PyQwt using Qt-%s and Qwt-%s" % (QT_VERSION_STR, QWT_VERSION_STR) p = IPlot(Curve(xs, ys, Symbol(Circle, Red), "standard_map"), title) return p # testStandardMap() if __name__ == '__main__': a = QApplication(sys.argv) p1, p2, p3 = testPlot(), testIPlot(), testStandardMap() a.setMainWidget(p1) a.exec_loop() # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3lib/Qwt5/grace.py0000444000175000017500000000644511130210270017326 0ustar poxpox#!/usr/bin/env python # # Copyright (C) 2003-2009 Gerard Vermeulen # # This file is part of PyQwt. # # PyQwt is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PyQwt is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # In addition, as a special exception, Gerard Vermeulen gives permission # to link PyQwt dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt in this form, provided that equally powerful # versions of Qt and PyQt have been released under the terms of the GNU # General Public License. # # If PyQwt is dynamically linked with non-free versions of Qt and PyQt, # PyQwt becomes a free plug-in for a non-free program. import subprocess import sys if sys.version_info[:2] < (2, 6): import os import signal class GraceProcess: """Provides a simple interface to a Grace subprocess.""" def __init__ (self, debug = None): self.debug = debug self.p = subprocess.Popen( ["xmgrace", "-nosafe", "-noask", "-dpipe", "0"], stdin=subprocess.PIPE, close_fds=True) self.command("view xmin 0.15") self.command("view xmax 0.85") self.command("view ymin 0.15") self.command("view ymax 0.85") self.flush() # __init__() def command(self, text): if self.debug: print text self.p.stdin.write(text + '\n') self.flush() # command() def flush(self): self.p.stdin.flush() # flush() def wait(self): return self.p.wait() # wait() def kill(self): if sys.version_info[:2] < (2, 6): os.kill(self.p.pid, signal.SIGKILL) else: self.p.kill() # kill() def __call__(self, text): self.command(text) # __call__() # class GraceProcess if __name__ == '__main__': import time g = GraceProcess() g('world xmax 100') g('world ymax 10000') g('xaxis tick major 20') g('xaxis tick minor 10') g('yaxis tick major 2000') g('yaxis tick minor 1000') g('s0 on') g('s0 symbol 1') g('s0 symbol size 0.3') g('s0 symbol fill pattern 1') g('s1 on') g('s1 symbol 1') g('s1 symbol size 0.3') g('s1 symbol fill pattern 1') # Display sample data for i in range(1,101): g('g0.s0 point %d, %d' % (i, i)) g('g0.s1 point %d, %d' % (i, i * i)) # Update the Grace display after every ten steps if i % 10 == 0: g('redraw') # Wait a second, just to simulate some time needed for # calculations. Your real application shouldn't wait. time.sleep(1) # Tell Grace to save the data: g('saveall "sample.agr"') # Close Grace: g.wait() # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt3lib/Qwt5/anynumpy.py0000444000175000017500000000222710651353203020132 0ustar poxpox# import either NumPy, or numarray, or Numeric for name in ('numpy', 'numarray', 'Numeric'): failed = False try: eval(compile('from %s import *' % name, 'eval', 'exec')) if name == 'numpy': from numpy.oldnumeric.compat import * Float = float UInt8 = uint8 except ImportError: failed = True if not failed: break else: import qt # Provoke a runtime error when no QApplication instance exists, since # qt.qApp does not return None when no QApplication instance exists. try: qt.qApp.name() except RuntimeError: a = qt.QApplication([]) qt.QMessageBox.critical( None, 'Numerical Python Extension Required', 'This example requires a Numerical Python Extension, but\n' 'failed to import either NumPy, or numarray, or Numeric.\n' 'NumPy is available at http://sourceforge.net/projects/numpy' ) raise SystemExit, ( 'Failed to import either NumPy, or numarray, or Numeric.\n' 'NumPy is available at http://sourceforge.net/projects/numpy' ) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/pyqwt-5.0.patch0000444000175000017500000000055210771446074016362 0ustar poxpox--- qwt-5.0/src/qwt_global.h.pyqwt Sat Jun 23 13:27:14 2007 +++ qwt-5.0/src/qwt_global.h Sun Mar 23 13:23:28 2008 @@ -19,8 +19,8 @@ // QWT_VERSION is (major << 16) + (minor << 8) + patch. -#define QWT_VERSION 0x050002 -#define QWT_VERSION_STR "5.0.2" +#define QWT_VERSION 0x050003 +#define QWT_VERSION_STR "5.0.3" #if defined(Q_WS_WIN) pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/0000755000175000017500000000000011275562661016125 5ustar poxpoxpyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/MaskedDataDemo.py0000555000175000017500000000611410664235131021273 0ustar poxpox#!/usr/bin/env python import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt try: import numpy as np except ImportError: if not Qt.QCoreApplication.instance(): a = Qt.QApplication([]) Qt.QMessageBox.critical( None, 'NumPy required', 'This example requires NumPy, but failed to import NumPy.\n' 'NumPy is available at http://sourceforge.net/projects/numpy' ) raise SystemExit, ( 'Failed to import NumPy.\n' 'NumPy is available at http://sourceforge.net/projects/numpy' ) class MaskedData(Qwt.QwtArrayData): def __init__(self, x, y, mask): Qwt.QwtArrayData.__init__(self, x, y) self.__mask = np.asarray(mask, bool) # keep a copy of x and y for boundingRect() self.__x = np.asarray(x) self.__y = np.asarray(y) # __init__() def copy(self): return self # copy() def mask(self): return self.__mask # mask() def boundingRect(self): """Return the bounding rectangle of the data, accounting for the mask. """ xmax = self.__x[self.__mask].max() xmin = self.__x[self.__mask].min() ymax = self.__y[self.__mask].max() ymin = self.__y[self.__mask].min() return Qt.QRectF(xmin, ymin, xmax-xmin, ymax-ymin) # boundingRect() # class MaskedData class MaskedCurve(Qwt.QwtPlotCurve): def __init__(self, x, y, mask): Qwt.QwtPlotCurve.__init__(self) self.setData(MaskedData(x, y, mask)) # __init__() def draw(self, painter, xMap, yMap, rect): # When the array indices contains the indices of all valid data points, # a chunks of valid data is indexed by # indices[first], indices[first+1], .., indices[last]. # The first index of a chunk of valid data is calculated by: # 1. indices[i] - indices[i-1] > 1 # 2. indices[0] is always OK # The last index of a chunk of valid data is calculated by: # 1. index[i] - index[i+1] < -1 # 2. index[-1] is always OK indices = np.arange(self.data().size())[self.data().mask()] fs = np.array(indices) fs[1:] -= indices[:-1] fs[0] = 2 fs = indices[fs > 1] ls = np.array(indices) ls[:-1] -= indices[1:] ls[-1] = -2 ls = indices[ls < -1] for first, last in zip(fs, ls): Qwt.QwtPlotCurve.drawFromTo(self, painter, xMap, yMap, first, last) # class MaskedCurve def make(): demo = Qwt.QwtPlot() demo.setTitle('Masked Data Demo') demo.setCanvasBackground(Qt.Qt.white) # num = 501 causes a divide by zero warning 64-bit Gentoo x = np.linspace(-2*np.pi, 2*np.pi, num=501) y = 1/np.sin(x) mask = np.logical_and(y>-3.0, y<3.0) curve = MaskedCurve(x, y, mask) curve.attach(demo) demo.resize(500, 300) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/BarPlotDemo.py0000555000175000017500000002267211207673326020655 0ustar poxpox#!/usr/bin/env python # Contributed by Tomaz Curk in a bug report showing that the stack order of the # curves was dependent on the number of curves. This has been fixed in Qwt. # # BarCurve is an idea of Tomaz Curk. # # Beautified and expanded by Gerard Vermeulen. import random import sys import PyQt4.Qt as Qt import PyQt4.Qwt5 as Qwt class Spy(Qt.QObject): def __init__(self, parent): Qt.QObject.__init__(self, parent) parent.setMouseTracking(True) parent.installEventFilter(self) # __init__() def eventFilter(self, _, event): if event.type() == Qt.QEvent.MouseMove: self.emit(Qt.SIGNAL("MouseMove"), event.pos()) return False # eventFilter() # class Spy class BarCurve(Qwt.QwtPlotCurve): def __init__(self, penColor=Qt.Qt.black, brushColor=Qt.Qt.white): Qwt.QwtPlotCurve.__init__(self) self.penColor = penColor self.brushColor = brushColor # __init__() def drawFromTo(self, painter, xMap, yMap, start, stop): """Draws rectangles with the corners taken from the x- and y-arrays. """ painter.setPen(Qt.QPen(self.penColor, 2)) painter.setBrush(self.brushColor) if stop == -1: stop = self.dataSize() # force 'start' and 'stop' to be even and positive if start & 1: start -= 1 if stop & 1: stop -= 1 start = max(start, 0) stop = max(stop, 0) for i in range(start, stop, 2): px1 = xMap.transform(self.x(i)) py1 = yMap.transform(self.y(i)) px2 = xMap.transform(self.x(i+1)) py2 = yMap.transform(self.y(i+1)) painter.drawRect(px1, py1, (px2 - px1), (py2 - py1)) # drawFromTo() # class BarCurve class BarPlotMainWindow(Qt.QMainWindow): colors = (Qt.Qt.red, Qt.Qt.green, Qt.Qt.blue, Qt.Qt.cyan, Qt.Qt.magenta, Qt.Qt.yellow, ) def __init__(self, parent=None): Qt.QMainWindow.__init__(self, parent) # Initialize a QwPlot central widget self.plot = Qwt.QwtPlot(self) self.plot.setTitle('left-click & drag to zoom') self.plot.setCanvasBackground(Qt.Qt.white) self.plot.plotLayout().setCanvasMargin(0) self.plot.plotLayout().setAlignCanvasToScales(True) self.setCentralWidget(self.plot) grid = Qwt.QwtPlotGrid() pen = Qt.QPen(Qt.Qt.DotLine) pen.setColor(Qt.Qt.black) pen.setWidth(0) grid.setPen(pen) grid.attach(self.plot) self.__initTracking() self.__initZooming() self.__initToolBar() # Finalize self.counter.setValue(10) self.go(self.counter.value()) # __init__() def __initTracking(self): """Initialize tracking """ self.connect(Spy(self.plot.canvas()), Qt.SIGNAL("MouseMove"), self.showCoordinates) self.statusBar().showMessage( 'Mouse movements in the plot canvas are shown in the status bar') # __initTracking() def showCoordinates(self, position): self.statusBar().showMessage( 'x = %+.6g, y = %.6g' % (self.plot.invTransform(Qwt.QwtPlot.xBottom, position.x()), self.plot.invTransform(Qwt.QwtPlot.yLeft, position.y()))) # showCoordinates() def __initZooming(self): """Initialize zooming """ self.zoomer = Qwt.QwtPlotZoomer(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.DragSelection, Qwt.QwtPicker.AlwaysOff, self.plot.canvas()) self.zoomer.setRubberBandPen(Qt.QPen(Qt.Qt.black)) # __initZooming() def setZoomerMousePattern(self, index): """Set the mouse zoomer pattern. """ if index == 0: pattern = [ Qwt.QwtEventPattern.MousePattern(Qt.Qt.LeftButton, Qt.Qt.NoModifier), Qwt.QwtEventPattern.MousePattern(Qt.Qt.MidButton, Qt.Qt.NoModifier), Qwt.QwtEventPattern.MousePattern(Qt.Qt.RightButton, Qt.Qt.NoModifier), Qwt.QwtEventPattern.MousePattern(Qt.Qt.LeftButton, Qt.Qt.ShiftModifier), Qwt.QwtEventPattern.MousePattern(Qt.Qt.MidButton, Qt.Qt.ShiftModifier), Qwt.QwtEventPattern.MousePattern(Qt.Qt.RightButton, Qt.Qt.ShiftModifier), ] self.zoomer.setMousePattern(pattern) elif index in (1, 2, 3): self.zoomer.initMousePattern(index) else: raise ValueError, 'index must be in (0, 1, 2, 3)' # setZoomerMousePattern() def __initToolBar(self): """Initialize the toolbar """ toolBar = Qt.QToolBar(self) self.addToolBar(toolBar) toolBar.addWidget(Qt.QLabel('Bars', toolBar)) self.counter = Qwt.QwtCounter(toolBar) self.counter.setRange(0, 10000, 1) self.counter.setNumButtons(3) toolBar.addWidget(self.counter) toolBar.addSeparator() toolBar.addWidget(Qt.QLabel('Mouse', toolBar)) mouseComboBox = Qt.QComboBox(toolBar) for name in ('3 buttons (PyQwt)', '1 button', '2 buttons', '3 buttons (Qwt)'): mouseComboBox.addItem(name) mouseComboBox.setCurrentIndex(0) toolBar.addWidget(mouseComboBox) toolBar.addSeparator() self.setZoomerMousePattern(0) toolBar.addAction(Qt.QWhatsThis.createAction(toolBar)) self.plot.canvas().setWhatsThis( 'A QwtPlotZoomer lets you zoom infinitely deep ' 'by saving the zoom states on a stack.\n\n' 'You can:\n' '- select a zoom region\n' '- unzoom all\n' '- walk down the stack\n' '- walk up the stack.\n\n' 'The combo box in the toolbar lets you attach ' 'different sets of mouse events to those actions.' ) self.counter.setWhatsThis( 'Select the number of bars' ) mouseComboBox.setWhatsThis( 'Configure the zoomer mouse buttons.\n\n' '3 buttons (PyQwt style):\n' '- left-click & drag to zoom\n' '- middle-click to unzoom all\n' '- right-click to walk down the stack\n' '- shift-right-click to walk up the stack.\n' '1 button:\n' '- click & drag to zoom\n' '- control-click to unzoom all\n' '- alt-click to walk down the stack\n' '- shift-alt-click to walk up the stack.\n' '2 buttons:\n' '- left-click & drag to zoom\n' '- right-click to unzoom all\n' '- alt-left-click to walk down the stack\n' '- alt-shift-left-click to walk up the stack.\n' '3 buttons (Qwt style):\n' '- left-click & drag to zoom\n' '- right-click to unzoom all\n' '- middle-click to walk down the stack\n' '- shift-middle-click to walk up the stack.\n\n' 'If some of those key combinations interfere with ' 'your Window manager, press the:\n' '- escape-key to unzoom all\n' '- minus-key to walk down the stack\n' '- plus-key to walk up the stack.' ) self.connect(self.counter, Qt.SIGNAL('valueChanged(double)'), self.go) self.connect(mouseComboBox, Qt.SIGNAL('activated(int)'), self.setZoomerMousePattern) # __initToolBar() def go(self, value): """Create and plot a sequence of bars taking into account the controls """ n = int(value) for bar in self.plot.itemList(): if isinstance(bar, BarCurve): bar.detach() for i in range(n): bar = BarCurve( self.colors[random.randint(0, len(self.colors)-1)], self.colors[random.randint(0, len(self.colors)-1)], ) bar.attach(self.plot) bar.setData([i, i+1.4], [0.3*i, 5.0+0.3*i]) self.clearZoomStack() # go() def clearZoomStack(self): """Auto scale and clear the zoom stack """ self.plot.setAxisAutoScale(Qwt.QwtPlot.xBottom) self.plot.setAxisAutoScale(Qwt.QwtPlot.yLeft) self.plot.replot() self.zoomer.setZoomBase() # clearZoomStack() # class BarPlotMainWindow def make(): demo = BarPlotMainWindow() demo.resize(500, 500) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': if 'settracemask' in sys.argv: # for debugging, requires: python configure.py --trace ... import sip sip.settracemask(0x3f) main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/PickerDemo.py0000555000175000017500000001051411226037430020506 0ustar poxpox#!/usr/bin/env python # # Contributed by Darren Dale. import sys from PyQt4.Qt import * from PyQt4.Qwt5 import * try: import numpy as np except ImportError: if not QCoreApplication.instance(): a = QApplication([]) QMessageBox.critical( None, 'NumPy required', 'This example requires NumPy, but failed to import NumPy.\n' 'NumPy is available at http://sourceforge.net/projects/numpy' ) raise SystemExit( 'Failed to import NumPy.\n' 'NumPy is available at http://sourceforge.net/projects/numpy' ) class PickerMachine(QwtPickerMachine): def __init__(self, *args): QwtPickerMachine.__init__(self, *args) # __init__() def transition(self, eventPattern, e): commands = [] # handle the mouse events if e.type() == QEvent.MouseButtonPress: if eventPattern.mouseMatch(QwtEventPattern.MouseSelect1, e): if self.state() == 0: commands.append(QwtPickerMachine.Begin) commands.append(QwtPickerMachine.Append) self.setState(1) elif e.type() == QEvent.MouseMove: if self.state != 0: commands.append(Qwt.QwtPickerMachine.Append) elif e.type() == QEvent.MouseButtonRelease: commands.append(QwtPickerMachine.End) self.setState(0) # handling of the kayboard events is left as an excercise return commands # transition() # class PickerMachine() class PlotPicker(QwtPlotPicker): def __init__(self, *args): Qwt.QwtPlotPicker.__init__(self, *args) self.setSelectionFlags(QwtPicker.PolygonSelection) # handle only mouse events coming from the left mouse button self.setMousePattern( [QwtEventPattern.MousePattern(Qt.LeftButton, Qt.NoModifier)]) # __init__() def drawRubberBand(self, painter): if (not self.isActive() or self.rubberBand() == QwtPicker.NoRubberBand or self.rubberBandPen().style() == Qt.NoPen ): return selection = self.selection() if (self.selectionFlags() & QwtPicker.PolygonSelection and self.rubberBand() == QwtPicker.PolygonRubberBand ): painter.drawPolygon(selection) # drawRubberBand() def stateMachine(self, flags): return PickerMachine() # stateMachine() # class PlotPicker def make(): demo = QMainWindow() toolBar = QToolBar(demo) toolBar.addAction(QWhatsThis.createAction(toolBar)) demo.addToolBar(toolBar) plot = QwtPlot(demo) demo.setCentralWidget(plot) plot.setTitle('Subclassing QwtPlotPicker Demo') plot.setCanvasBackground(Qt.white) plot.setWhatsThis( 'Shows how to subclass QwtPlotPicker so that\n' 'a PolygonRubberBand selection responds to\n' 'left mouse button events.' ) demo.resize(400, 400) demo.show() x = np.linspace(-2*np.pi, 2*np.pi, num=501) y = np.sin(x)*5 curve = QwtPlotCurve() curve.setData(x,y) curve.setPen(QPen(Qt.red)) curve.attach(plot) picker = PlotPicker(QwtPlot.xBottom, QwtPlot.yLeft, QwtPicker.PolygonSelection, QwtPlotPicker.PolygonRubberBand, QwtPicker.AlwaysOff, plot.canvas()) picker.setRubberBandPen(QPen(Qt.black, 1)) slot = lambda polygon: QMessageBox.information( None, 'PlotPicker signaled', str(polygon)) if PYQT_VERSION == 0x040500: # works around a bug in PyQt-4.5/sip-4.8 picker.connect(picker, SIGNAL('selected(const QPolygon&)'), slot) else: picker.connect(picker, SIGNAL('selected(const QwtPolygon&)'), slot) QWhatsThis.enterWhatsThisMode() QWhatsThis.showText( demo.mapToGlobal(QPoint(200, 200)), plot.whatsThis(), demo) return demo # make() def main(args): app = QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire if __name__ == '__main__': if 'settracemask' in sys.argv: # for debugging, requires: python configure.py --trace ... import sip sip.settracemask(0x3f) main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/EventFilterDemo.py0000555000175000017500000004324710434023557021536 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/event_filter import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * class ColorBar(Qt.QWidget): def __init__(self, orientation, *args): Qt.QWidget.__init__(self, *args) self.__orientation = orientation self.__light = Qt.QColor(Qt.Qt.white) self.__dark = Qt.QColor(Qt.Qt.black) self.setCursor(Qt.Qt.PointingHandCursor) # __init__() def setOrientation(self, orientation): self.__orientation = orientation self.update() # setOrientation() def orientation(self): return self.__orientation # orientation() def setRange(self, light, dark): self.__light = light self.__dark = dark self.update() # setRange() def setLight(self, color): self.__light = color self.update() # setLight() def setDark(self, color): self.__dark = color self.update() # setDark() def light(self): return self.__light # light() def dark(self): return self.__dark # dark() def mousePressEvent(self, event): if event.button() == Qt.Qt.LeftButton: pm = Qt.QPixmap.grabWidget(self) color = Qt.QColor() color.setRgb(pm.toImage().pixel(event.x(), event.y())) self.emit(Qt.SIGNAL("colorSelected"), color) event.accept() # mousePressEvent() def paintEvent(self, _): painter = Qt.QPainter(self) self.drawColorBar(painter, self.rect()) # paintEvent() def drawColorBar(self, painter, rect): h1, s1, v1, _ = self.__light.getHsv() h2, s2, v2, _ = self.__dark.getHsv() painter.save() painter.setClipRect(rect) painter.setClipping(True) painter.fillRect(rect, Qt.QBrush(self.__dark)) sectionSize = 2 if (self.__orientation == Qt.Qt.Horizontal): numIntervalls = rect.width()/sectionSize else: numIntervalls = rect.height()/sectionSize section = Qt.QRect() for i in range(numIntervalls): if self.__orientation == Qt.Qt.Horizontal: section.setRect(rect.x() + i*sectionSize, rect.y(), sectionSize, rect.heigh()) else: section.setRect(rect.x(), rect.y() + i*sectionSize, rect.width(), sectionSize) ratio = float(i)/float(numIntervalls) color = Qt.QColor() color.setHsv(h1 + int(ratio*(h2-h1) + 0.5), s1 + int(ratio*(s2-s1) + 0.5), v1 + int(ratio*(v2-v1) + 0.5)) painter.fillRect(section, color) painter.restore() # drawColorBar() # class ColorBar class Plot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) self.setTitle("Interactive Plot") self.setCanvasColor(Qt.Qt.darkCyan) grid = Qwt.QwtPlotGrid() grid.attach(self) grid.setMajPen(Qt.QPen(Qt.Qt.white, 0, Qt.Qt.DotLine)) self.setAxisScale(Qwt.QwtPlot.xBottom, 0.0, 100.0) self.setAxisScale(Qwt.QwtPlot.yLeft, 0.0, 100.0) # Avoid jumping when label with 3 digits # appear/disappear when scrolling vertically scaleDraw = self.axisScaleDraw(Qwt.QwtPlot.yLeft) scaleDraw.setMinimumExtent(scaleDraw.extent( Qt.QPen(), self.axisWidget(Qwt.QwtPlot.yLeft).font())) self.plotLayout().setAlignCanvasToScales(True) self.__insertCurve(Qt.Qt.Vertical, Qt.Qt.blue, 30.0) self.__insertCurve(Qt.Qt.Vertical, Qt.Qt.magenta, 70.0) self.__insertCurve(Qt.Qt.Horizontal, Qt.Qt.yellow, 30.0) self.__insertCurve(Qt.Qt.Horizontal, Qt.Qt.white, 70.0) self.replot() scaleWidget = self.axisWidget(Qwt.QwtPlot.yLeft) scaleWidget.setMargin(10) self.__colorBar = ColorBar(Qt.Qt.Vertical, scaleWidget) self.__colorBar.setRange( Qt.QColor(Qt.Qt.red), Qt.QColor(Qt.Qt.darkBlue)) self.__colorBar.setFocusPolicy(Qt.Qt.TabFocus) self.connect(self.__colorBar, Qt.SIGNAL('colorSelected'), self.setCanvasColor) # we need the resize events, to lay out the color bar scaleWidget.installEventFilter(self) self.__wheel = Qwt.QwtWheel(self.canvas()) self.__wheel.setOrientation(Qt.Qt.Vertical) self.__wheel.setRange(-100, 100) self.__wheel.setValue(0.0) self.__wheel.setMass(0.2) self.__wheel.setTotalAngle(4 * 360.0) self.connect(self.__wheel, Qt.SIGNAL('valueChanged(double)'), self.scrollLeftAxis) # we need the resize events, to lay out the wheel self.canvas().installEventFilter(self) scaleWidget.setWhatsThis( 'Selecting a value at the scale will insert a new curve.') self.__colorBar.setWhatsThis( 'Selecting a color will change the background of the plot.') self.__wheel.setWhatsThis( 'With the wheel you can move the visible area.') self.axisWidget(Qwt.QwtPlot.xBottom).setWhatsThis( 'Selecting a value at the scale will insert a new curve.') # __init__() def setCanvasColor(self, color): self.setCanvasBackground(color) self.replot() # setCanvasColor() def scrollLeftAxis(self, value): self.setAxisScale(Qwt.QwtPlot.yLeft, value, value + 100) self.replot() # scrollLeftAxis() def eventFilter(self, object, event): if event.type() == Qt.QEvent.Resize: size = event.size() if object == self.axisWidget(Qwt.QwtPlot.yLeft): margin = 2 x = size.width() - object.margin() + margin w = object.margin() - 2 * margin y = object.startBorderDist() h = (size.height() - object.startBorderDist() - object.endBorderDist()) self.__colorBar.setGeometry(x, y, w, h) elif object == self.canvas(): w, h, margin = 16, 50, 2 r = object.contentsRect(); self.__wheel.setGeometry( r.right() - margin - w, r.center().y() - h / 2, w, h) return Qwt.QwtPlot.eventFilter(self, object, event) # eventFilter() def insertCurve(self, axis, base): if axis == Qwt.QwtPlot.yLeft or axis == Qwt.QwtPlot.yRight: o = Qt.Qt.Horizontal else: o = Qt.Qt.Vertical self.__insertCurve(o, Qt.QColor(Qt.Qt.red), base) self.replot() # insertCurve() def __insertCurve(self, orientation, color, base): curve = Qwt.QwtPlotCurve() curve.attach(self) curve.setPen(Qt.QPen(color)) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, Qt.QBrush(Qt.Qt.gray), Qt.QPen(color), Qt.QSize(8, 8))) fixed = base*ones(10, Float) changing = arange(0, 95.0, 10.0, Float) + 5.0 if orientation == Qt.Qt.Horizontal: curve.setData(changing, fixed) else: curve.setData(fixed, changing) # __insertCurve() # class Plot class CanvasPicker(Qt.QObject): def __init__(self, plot): Qt.QObject.__init__(self, plot) self.__selectedCurve = None self.__selectedPoint = -1 self.__plot = plot canvas = plot.canvas() canvas.installEventFilter(self) # We want the focus, but no focus rect. # The selected point will be highlighted instead. canvas.setFocusPolicy(Qt.Qt.StrongFocus) canvas.setCursor(Qt.Qt.PointingHandCursor) canvas.setFocusIndicator(Qwt.QwtPlotCanvas.ItemFocusIndicator) canvas.setFocus() canvas.setWhatsThis( 'All points can be moved using the left mouse button ' 'or with these keys:\n\n' '- Up: Select next curve\n' '- Down: Select previous curve\n' '- Left, "-": Select next point\n' '- Right, "+": Select previous point\n' '- 7, 8, 9, 4, 6, 1, 2, 3: Move selected point' ) self.__shiftCurveCursor(True) # __init__() def event(self, event): if event.type() == Qt.QEvent.User: self.__showCursor(True) return True return Qt.QObject.event(event) # event() def eventFilter(self, object, event): if event.type() == Qt.QEvent.FocusIn: self.__showCursor(True) if event.type() == Qt.QEvent.FocusOut: self.__showCursor(False) if event.type() == Qt.QEvent.Paint: Qt.QApplication.postEvent( self, Qt.QEvent(Qt.QEvent.User)) elif event.type() == Qt.QEvent.MouseButtonPress: self.__select(event.pos()) return True elif event.type() == Qt.QEvent.MouseMove: self.__move(event.pos()) return True if event.type() == Qt.QEvent.KeyPress: delta = 5 key = event.key() if key == Qt.Qt.Key_Up: self.__shiftCurveCursor(True) return True elif key == Qt.Qt.Key_Down: self.__shiftCurveCursor(False) return True elif key == Qt.Qt.Key_Right or key == Qt.Qt.Key_Plus: if self.__selectedCurve: self.__shiftPointCursor(True) else: self.__shiftCurveCursor(True) return True elif key == Qt.Qt.Key_Left or key == Qt.Qt.Key_Minus: if self.__selectedCurve: self.__shiftPointCursor(False) else: self.__shiftCurveCursor(True) return True if key == Qt.Qt.Key_1: self.__moveBy(-delta, delta) elif key == Qt.Qt.Key_2: self.__moveBy(0, delta) elif key == Qt.Qt.Key_3: self.__moveBy(delta, delta) elif key == Qt.Qt.Key_4: self.__moveBy(-delta, 0) elif key == Qt.Qt.Key_6: self.__moveBy(delta, 0) elif key == Qt.Qt.Key_7: self.__moveBy(-delta, -delta) elif key == Qt.Qt.Key_8: self.__moveBy(0, -delta) elif key == Qt.Qt.Key_9: self.__moveBy(delta, -delta) return Qwt.QwtPlot.eventFilter(self, object, event) # eventFilter() def __select(self, pos): found, distance, point = None, 1e100, -1 for curve in self.__plot.itemList(): if isinstance(curve, Qwt.QwtPlotCurve): i, d = curve.closestPoint(pos) if d < distance: found = curve point = i distance = d self.__showCursor(False) self.__selectedCurve = None self.__selectedPoint = -1 if found and distance < 10: self.__selectedCurve = found self.__selectedPoint = point self.__showCursor(True) # __select() def __moveBy(self, dx, dy): if dx == 0 and dy == 0: return curve = self.__selectedCurve if not curve: return x = self.__plot.transform( curve.xAxis(), curve.x(self.__selectedPoint)) + dx y = self.__plot.transform( curve.yAxis(), curve.y(self.__selectedPoint)) + dy self.__move(Qt.QPoint(x, y)) # __moveBy() def __move(self, pos): curve = self.__selectedCurve if not curve: return xData = zeros(curve.dataSize(), Float) yData = zeros(curve.dataSize(), Float) for i in range(curve.dataSize()): if i == self.__selectedPoint: xData[i] = self.__plot.invTransform(curve.xAxis(), pos.x()) yData[i] = self.__plot.invTransform(curve.yAxis(), pos.y()) else: xData[i] = curve.x(i) yData[i] = curve.y(i) curve.setData(xData, yData) self.__plot.replot() self.__showCursor(True) # __move() def __showCursor(self, showIt): curve = self.__selectedCurve if not curve: return # Use copy constructors to defeat the reference semantics. symbol = Qwt.QwtSymbol(curve.symbol()) newSymbol = Qwt.QwtSymbol(symbol) if showIt: newSymbol.setBrush(symbol.brush().color().dark(150)) doReplot = self.__plot.autoReplot() self.__plot.setAutoReplot(False) curve.setSymbol(newSymbol) curve.draw(self.__selectedPoint, self.__selectedPoint) curve.setSymbol(symbol) self.__plot.setAutoReplot(doReplot) # __showCursor() def __shiftCurveCursor(self, up): curves = [curve for curve in self.__plot.itemList() if isinstance(curve, Qwt.QwtPlotCurve)] if not curves: return if self.__selectedCurve in curves: index = curves.index(self.__selectedCurve) if up: index += 1 else: index -= 1 # keep index within [0, len(curves)) index += len(curves) index %= len(curves) else: index = 0 self.__showCursor(False) self.__selectedPoint = 0 self.__selectedCurve = curves[index] self.__showCursor(True) # __shiftCurveCursor() def __shiftPointCursor(self, up): curve = self.__selectedCurve if not curve: return if up: index = self.__selectedPoint + 1 else: index = self.__selectedPoint - 1 # keep index within [0, curve.dataSize()) index += curve.dataSize() index %= curve.dataSize() if index != self.__selectedPoint: self.__showCursor(False) self.__selectedPoint = index self.__showCursor(True) # __shiftPointCursor() # class CanvasPicker class ScalePicker(Qt.QObject): def __init__(self, plot): Qt.QObject.__init__(self, plot) for i in range(Qwt.QwtPlot.axisCnt): scaleWidget = plot.axisWidget(i) if scaleWidget: scaleWidget.installEventFilter(self) # __init__() def eventFilter(self, object, event): if (event.type() == Qt.QEvent.MouseButtonPress): self.__mouseClicked(object, event.pos()) return True return Qt.QObject.eventFilter(self, object, event) # eventFilter() def __mouseClicked(self, scale, pos): rect = self.__scaleRect(scale) margin = 10 rect.setRect(rect.x() - margin, rect.y() - margin, rect.width() + 2 * margin, rect.height() + 2 * margin) if rect.contains(pos): value = 0.0 axis = -1 sd = scale.scaleDraw() if scale.alignment() == Qwt.QwtScaleDraw.LeftScale: value = sd.map().invTransform(pos.y()) axis = Qwt.QwtPlot.yLeft elif scale.alignment() == Qwt.QwtScaleDraw.RightScale: value = sd.map().invTransform(pos.y()) axis = Qwt.QwtPlot.yRight elif scale.alignment() == Qwt.QwtScaleDraw.BottomScale: value = sd.map().invTransform(pos.x()) axis = Qwt.QwtPlot.xBottom elif scale.alignment() == Qwt.QwtScaleDraw.TopScale: value = sd.map().invTransform(pos.x()) axis = Qwt.QwtPlot.xBottom self.emit(Qt.SIGNAL("clicked"), axis, value) # __mouseClicked() def __scaleRect(self, scale): bld = scale.margin() mjt = scale.scaleDraw().majTickLength() sbd = scale.startBorderDist() ebd = scale.endBorderDist() if scale.alignment() == Qwt.QwtScaleDraw.LeftScale: return Qt.QRect(scale.width() - bld - mjt, sbd, mjt, scale.height() - sbd - ebd) elif scale.alignment() == Qwt.QwtScaleDraw.RightScale: return Qt.QRect(bld, sbd,mjt, scale.height() - sbd - ebd) elif scale.alignment() == Qwt.QwtScaleDraw.BottomScale: return Qt.QRect(sbd, bld, scale.width() - sbd - ebd, mjt) elif scale.alignment() == Qwt.QwtScaleDraw.TopScale: return Qt.QRect(sbd, scale.height() - bld - mjt, scale.width() - sbd - ebd, mjt) else: return Qt.QRect() # __scaleRect # class ScalePicker def make(): demo = Qt.QMainWindow() toolBar = Qt.QToolBar(demo) toolBar.addAction(Qt.QWhatsThis.createAction(toolBar)) demo.addToolBar(toolBar) plot = Plot(demo) demo.setCentralWidget(plot) plot.setWhatsThis( 'An useless plot to demonstrate how to use event filtering.\n\n' 'You can click on the color bar, the scales or move the slider.\n' 'All points can be moved using the mouse or the keyboard.' ) CanvasPicker(plot) scalePicker = ScalePicker(plot) Qt.QObject.connect(scalePicker, Qt.SIGNAL("clicked"), plot.insertCurve) demo.resize(540, 400) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/SliderDemo.py0000555000175000017500000001413111207673326020523 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/sliders import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt class Layout(Qt.QBoxLayout): def __init__(self, orientation, parent=None): Qt.QBoxLayout.__init__(self, Qt.QBoxLayout.LeftToRight, parent) if orientation == Qt.Qt.Vertical: self.setDirection(Qt.QBoxLayout.TopToBottom) self.setSpacing(20) self.setMargin(0) # __init__() # class Layout class Slider(Qt.QWidget): def __init__(self, parent, sliderType): Qt.QWidget.__init__(self, parent) self.slider = self.createSlider(self, sliderType) assert(not self.slider is None) if self.slider.scalePosition() == Qwt.QwtSlider.NoScale: if self.slider.orientation() == Qt.Qt.Horizontal: alignment = Qt.Qt.AlignHCenter | Qt.Qt.AlignTop else: alignment = Qt.Qt.AlignVCenter | Qt.Qt.AlignLeft elif self.slider.scalePosition() == Qwt.QwtSlider.LeftScale: alignment = Qt.Qt.AlignVCenter | Qt.Qt.AlignRight elif self.slider.scalePosition() == Qwt.QwtSlider.RightScale: alignment = Qt.Qt.AlignVCenter | Qt.Qt.AlignLeft elif self.slider.scalePosition() == Qwt.QwtSlider.TopScale: alignment = Qt.Qt.AlignHCenter | Qt.Qt.AlignBottom elif self.slider.scalePosition() == Qwt.QwtSlider.BottomScale: alignment = Qt.Qt.AlignHCenter | Qt.Qt.AlignTop self.label = Qt.QLabel("0", self) self.label.setAlignment(alignment) self.label.setFixedWidth(self.label.fontMetrics().width('10000.9')) self.connect(self.slider, Qt.SIGNAL('valueChanged(double)'), self.setNum) if self.slider.orientation() == Qt.Qt.Horizontal: layout = Qt.QHBoxLayout(self) else: layout = Qt.QVBoxLayout(self) layout.addWidget(self.slider) layout.addWidget(self.label) # __init__ () def createSlider(self, parent, sliderType): if sliderType == 0: slider = Qwt.QwtSlider(parent, Qt.Qt.Horizontal, Qwt.QwtSlider.TopScale, Qwt.QwtSlider.BgTrough) slider.setThumbWidth(10) slider.setRange(-10.0, 10.0, 1.0, 0) # paging disabled return slider if sliderType == 1: slider = Qwt.QwtSlider(parent, Qt.Qt.Horizontal, Qwt.QwtSlider.NoScale, Qwt.QwtSlider.BgBoth) slider.setRange(0.0, 1.0, 0.01, 5) return slider if sliderType == 2: slider = Qwt.QwtSlider(parent, Qt.Qt.Horizontal, Qwt.QwtSlider.BottomScale, Qwt.QwtSlider.BgSlot) slider.setThumbWidth(25) slider.setThumbLength(12) slider.setRange(1000.0, 3000.0, 10.0, 10) return slider if sliderType == 3: slider = Qwt.QwtSlider(parent, Qt.Qt.Vertical, Qwt.QwtSlider.LeftScale, Qwt.QwtSlider.BgSlot) slider.setRange(0.0, 100.0, 1.0, 5) slider.setScaleMaxMinor(5) return slider if sliderType == 4: slider = Qwt.QwtSlider(parent, Qt.Qt.Vertical, Qwt.QwtSlider.NoScale, Qwt.QwtSlider.BgTrough) slider.setRange(0.0,100.0,1.0, 10) return slider if sliderType == 5: slider = Qwt.QwtSlider(parent, Qt.Qt.Vertical, Qwt.QwtSlider.RightScale, Qwt.QwtSlider.BgBoth) slider.setScaleEngine(Qwt.QwtLog10ScaleEngine()) slider.setThumbWidth(20) slider.setBorderWidth(1) slider.setRange(0.0, 4.0, 0.01) slider.setScale(1.0, 1.0e4) slider.setScaleMaxMinor(10) return slider return None # createSlider() def setNum(self, value): if isinstance(self.slider.scaleEngine(), Qwt.QwtLog10ScaleEngine): value = 10.0**value self.label.setText('%s' % value) # setNum() # class(SliderWidget) class SliderDemo(Qt.QWidget): def __init__(self, *args): Qt.QWidget.__init__(self, *args) hSliderLayout = Layout(Qt.Qt.Vertical) for i in (0, 1, 2): hSliderLayout.addWidget(Slider(self, i)) hSliderLayout.addStretch() vSliderLayout = Layout(Qt.Qt.Horizontal) for i in (3, 4, 5): vSliderLayout.addWidget(Slider(self, i)) vTitle = Qt.QLabel("Vertical Sliders", self) vTitle.setFont(Qt.QFont("Helvetica", 14, Qt.QFont.Bold)) vTitle.setAlignment(Qt.Qt.AlignHCenter) layout1 = Layout(Qt.Qt.Vertical) layout1.addWidget(vTitle, 0) layout1.addLayout(vSliderLayout, 10) hTitle = Qt.QLabel("Horizontal Sliders", self) hTitle.setFont(vTitle.font()) hTitle.setAlignment(Qt.Qt.AlignHCenter) layout2 = Layout(Qt.Qt.Vertical) layout2.addWidget(hTitle, 0) layout2.addLayout(hSliderLayout, 10) mainLayout = Layout(Qt.Qt.Horizontal, self) mainLayout.addLayout(layout1) mainLayout.addLayout(layout2, 10) # __init__() # class SliderDemo def make(): demo = SliderDemo() demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': if 'settracemask' in sys.argv: # for debugging, requires: python configure.py --trace ... import sip sip.settracemask(0x3f) main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/BodeDemo.py0000555000175000017500000004073111207673326020157 0ustar poxpox#!/usr/bin/env python # The Python version of Qwt-5.1.1/examples/bode # To get an impression of the expressive power of NumPy, # compare the Python and C++ versions of setDamp() import sys from PyQt4.Qt import * from PyQt4.Qwt5 import * import PyQt4.Qwt5.anynumpy as np print_xpm = ['32 32 12 1', 'a c #ffffff', 'h c #ffff00', 'c c #ffffff', 'f c #dcdcdc', 'b c #c0c0c0', 'j c #a0a0a4', 'e c #808080', 'g c #808000', 'd c #585858', 'i c #00ff00', '# c #000000', '. c None', '................................', '................................', '...........###..................', '..........#abb###...............', '.........#aabbbbb###............', '.........#ddaaabbbbb###.........', '........#ddddddaaabbbbb###......', '.......#deffddddddaaabbbbb###...', '......#deaaabbbddddddaaabbbbb###', '.....#deaaaaaaabbbddddddaaabbbb#', '....#deaaabbbaaaa#ddedddfggaaad#', '...#deaaaaaaaaaa#ddeeeeafgggfdd#', '..#deaaabbbaaaa#ddeeeeabbbbgfdd#', '.#deeefaaaaaaa#ddeeeeabbhhbbadd#', '#aabbbeeefaaa#ddeeeeabbbbbbaddd#', '#bbaaabbbeee#ddeeeeabbiibbadddd#', '#bbbbbaaabbbeeeeeeabbbbbbaddddd#', '#bjbbbbbbaaabbbbeabbbbbbadddddd#', '#bjjjjbbbbbbaaaeabbbbbbaddddddd#', '#bjaaajjjbbbbbbaaabbbbadddddddd#', '#bbbbbaaajjjbbbbbbaaaaddddddddd#', '#bjbbbbbbaaajjjbbbbbbddddddddd#.', '#bjjjjbbbbbbaaajjjbbbdddddddd#..', '#bjaaajjjbbbbbbjaajjbddddddd#...', '#bbbbbaaajjjbbbjbbaabdddddd#....', '###bbbbbbaaajjjjbbbbbddddd#.....', '...###bbbbbbaaajbbbbbdddd#......', '......###bbbbbbjbbbbbddd#.......', '.........###bbbbbbbbbdd#........', '............###bbbbbbd#.........', '...............###bbb#..........', '..................###...........'] zoom_xpm = ['32 32 8 1', '# c #000000', 'b c #c0c0c0', 'a c #ffffff', 'e c #585858', 'd c #a0a0a4', 'c c #0000ff', 'f c #00ffff', '. c None', '..######################........', '.#a#baaaaaaaaaaaaaaaaaa#........', '#aa#baaaaaaaaaaaaaccaca#........', '####baaaaaaaaaaaaaaaaca####.....', '#bbbbaaaaaaaaaaaacccaaa#da#.....', '#aaaaaaaaaaaaaaaacccaca#da#.....', '#aaaaaaaaaaaaaaaaaccaca#da#.....', '#aaaaaaaaaabe###ebaaaaa#da#.....', '#aaaaaaaaa#########aaaa#da#.....', '#aaaaaaaa###dbbbb###aaa#da#.....', '#aaaaaaa###aaaaffb###aa#da#.....', '#aaaaaab##aaccaaafb##ba#da#.....', '#aaaaaae#daaccaccaad#ea#da#.....', '#aaaaaa##aaaaaaccaab##a#da#.....', '#aaaaaa##aacccaaaaab##a#da#.....', '#aaaaaa##aaccccaccab##a#da#.....', '#aaaaaae#daccccaccad#ea#da#.....', '#aaaaaab##aacccaaaa##da#da#.....', '#aaccacd###aaaaaaa###da#da#.....', '#aaaaacad###daaad#####a#da#.....', '#acccaaaad##########da##da#.....', '#acccacaaadde###edd#eda#da#.....', '#aaccacaaaabdddddbdd#eda#a#.....', '#aaaaaaaaaaaaaaaaaadd#eda##.....', '#aaaaaaaaaaaaaaaaaaadd#eda#.....', '#aaaaaaaccacaaaaaaaaadd#eda#....', '#aaaaaaaaaacaaaaaaaaaad##eda#...', '#aaaaaacccaaaaaaaaaaaaa#d#eda#..', '########################dd#eda#.', '...#dddddddddddddddddddddd##eda#', '...#aaaaaaaaaaaaaaaaaaaaaa#.####', '...########################..##.'] class PrintFilter(QwtPlotPrintFilter): def __init__(self): QwtPlotPrintFilter.__init__(self) # __init___() def color(self, c, item): if not (self.options() & QwtPlotPrintFilter.CanvasBackground): if item == QwtPlotPrintFilter.MajorGrid: return Qt.darkGray elif item == QwtPlotPrintFilter.MinorGrid: return Qt.gray if item == QwtPlotPrintFilter.Title: return Qt.red elif item == QwtPlotPrintFilter.AxisScale: return Qt.green elif item == QwtPlotPrintFilter.AxisTitle: return Qt.blue return c # color() def font(self, f, _): result = QFont(f) result.setPointSize(int(f.pointSize()*1.25)) return result # font() # class PrintFilter class BodePlot(QwtPlot): def __init__(self, *args): QwtPlot.__init__(self, *args) self.setTitle('Frequency Response of a 2nd-order System') self.setCanvasBackground(Qt.darkBlue) # legend legend = QwtLegend() legend.setFrameStyle(QFrame.Box | QFrame.Sunken) legend.setItemMode(QwtLegend.ClickableItem) self.insertLegend(legend, QwtPlot.BottomLegend) # grid self.grid = QwtPlotGrid() self.grid.enableXMin(True) self.grid.setMajPen(QPen(Qt.white, 0, Qt.DotLine)) self.grid.setMinPen(QPen(Qt.gray, 0 , Qt.DotLine)) self.grid.attach(self) # axes self.enableAxis(QwtPlot.yRight) self.setAxisTitle(QwtPlot.xBottom, u'\u03c9/\u03c90') self.setAxisTitle(QwtPlot.yLeft, 'Amplitude [dB]') self.setAxisTitle(QwtPlot.yRight, u'Phase [\u00b0]') self.setAxisMaxMajor(QwtPlot.xBottom, 6) self.setAxisMaxMinor(QwtPlot.xBottom, 10) self.setAxisScaleEngine(QwtPlot.xBottom, QwtLog10ScaleEngine()) # curves self.curve1 = QwtPlotCurve('Amplitude') self.curve1.setRenderHint(QwtPlotItem.RenderAntialiased); self.curve1.setPen(QPen(Qt.yellow)) self.curve1.setYAxis(QwtPlot.yLeft) self.curve1.attach(self) self.curve2 = QwtPlotCurve('Phase') self.curve2.setRenderHint(QwtPlotItem.RenderAntialiased); self.curve2.setPen(QPen(Qt.cyan)) self.curve2.setYAxis(QwtPlot.yRight) self.curve2.attach(self) # alias fn = self.fontInfo().family() # marker self.dB3Marker = m = QwtPlotMarker() m.setValue(0.0, 0.0) m.setLineStyle(QwtPlotMarker.VLine) m.setLabelAlignment(Qt.AlignRight | Qt.AlignBottom) m.setLinePen(QPen(Qt.green, 2, Qt.DashDotLine)) text = QwtText('') text.setColor(Qt.green) text.setBackgroundBrush(Qt.red) text.setFont(QFont(fn, 12, QFont.Bold)) m.setLabel(text) m.attach(self) self.peakMarker = m = QwtPlotMarker() m.setLineStyle(QwtPlotMarker.HLine) m.setLabelAlignment(Qt.AlignRight | Qt.AlignBottom) m.setLinePen(QPen(Qt.red, 2, Qt.DashDotLine)) text = QwtText('') text.setColor(Qt.red) text.setBackgroundBrush(QBrush(self.canvasBackground())) text.setFont(QFont(fn, 12, QFont.Bold)) m.setLabel(text) m.setSymbol(QwtSymbol(QwtSymbol.Diamond, QBrush(Qt.yellow), QPen(Qt.green), QSize(7,7))) m.attach(self) # text marker m = QwtPlotMarker() m.setValue(0.1, -20.0) m.setLabelAlignment(Qt.AlignRight | Qt.AlignBottom) text = QwtText( u'[1-(\u03c9/\u03c90)2+2j\u03c9/Q]' '-1' ) text.setFont(QFont(fn, 12, QFont.Bold)) text.setColor(Qt.blue) text.setBackgroundBrush(QBrush(Qt.yellow)) text.setBackgroundPen(QPen(Qt.red, 2)) m.setLabel(text) m.attach(self) self.setDamp(0.01) # __init__() def showData(self, frequency, amplitude, phase): self.curve1.setData(frequency, amplitude) self.curve2.setData(frequency, phase) # showData() def showPeak(self, frequency, amplitude): self.peakMarker.setValue(frequency, amplitude) label = self.peakMarker.label() label.setText('Peak: %4g dB' % amplitude) self.peakMarker.setLabel(label) # showPeak() def show3dB(self, frequency): self.dB3Marker.setValue(frequency, 0.0) label = self.dB3Marker.label() label.setText('-3dB at f = %4g' % frequency) self.dB3Marker.setLabel(label) # show3dB() def setDamp(self, d): self.damping = d # Numerical Python: f, g, a and p are NumPy arrays! f = np.exp(np.log(10.0)*np.arange(-2, 2.02, 0.04)) g = 1.0/(1.0-f*f+2j*self.damping*f) a = 20.0*np.log10(abs(g)) p = 180*np.arctan2(g.imag, g.real)/np.pi # for show3dB i3 = np.argmax(np.where(np.less(a, -3.0), a, -100.0)) f3 = f[i3] - (a[i3]+3.0)*(f[i3]-f[i3-1])/(a[i3]-a[i3-1]) # for showPeak imax = np.argmax(a) self.showPeak(f[imax], a[imax]) self.show3dB(f3) self.showData(f, a, p) self.replot() # setDamp() # class BodePlot class BodeDemo(QMainWindow): def __init__(self, *args): QMainWindow.__init__(self, *args) self.plot = BodePlot(self) self.plot.setMargin(5) self.setContextMenuPolicy(Qt.NoContextMenu) self.zoomers = [] zoomer = QwtPlotZoomer( QwtPlot.xBottom, QwtPlot.yLeft, QwtPicker.DragSelection, QwtPicker.AlwaysOff, self.plot.canvas()) zoomer.setRubberBandPen(QPen(Qt.green)) self.zoomers.append(zoomer) zoomer = QwtPlotZoomer( QwtPlot.xTop, QwtPlot.yRight, QwtPicker.PointSelection | QwtPicker.DragSelection, QwtPicker.AlwaysOff, self.plot.canvas()) zoomer.setRubberBand(QwtPicker.NoRubberBand) self.zoomers.append(zoomer) self.picker = QwtPlotPicker( QwtPlot.xBottom, QwtPlot.yLeft, QwtPicker.PointSelection | QwtPicker.DragSelection, QwtPlotPicker.CrossRubberBand, QwtPicker.AlwaysOn, self.plot.canvas()) self.picker.setRubberBandPen(QPen(Qt.green)) self.picker.setTrackerPen(QPen(Qt.cyan)) self.setCentralWidget(self.plot) toolBar = QToolBar(self) self.addToolBar(toolBar) btnZoom = QToolButton(toolBar) btnZoom.setText("Zoom") btnZoom.setIcon(QIcon(QPixmap(zoom_xpm))) btnZoom.setCheckable(True) btnZoom.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) toolBar.addWidget(btnZoom) btnPrint = QToolButton(toolBar) btnPrint.setText("Print") btnPrint.setIcon(QIcon(QPixmap(print_xpm))) btnPrint.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) toolBar.addWidget(btnPrint) self.connect(btnPrint, SIGNAL('clicked()'), self.print_) if QT_VERSION >= 0X040100: btnPDF = QToolButton(toolBar) btnPDF.setText("PDF") btnPDF.setIcon(QIcon(QPixmap(print_xpm))) btnPDF.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) toolBar.addWidget(btnPDF) self.connect(btnPDF, SIGNAL('clicked()'), self.exportPDF) if QT_VERSION >= 0x040300: btnSVG = QToolButton(toolBar) btnSVG.setText("SVG") btnSVG.setIcon(QIcon(QPixmap(print_xpm))) btnSVG.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) toolBar.addWidget(btnSVG) self.connect(btnSVG, SIGNAL('clicked()'), self.exportSVG) toolBar.addSeparator() dampBox = QWidget(toolBar) dampLayout = QHBoxLayout(dampBox) dampLayout.setSpacing(0) dampLayout.addWidget(QWidget(dampBox), 10) # spacer dampLayout.addWidget(QLabel("Damping Factor", dampBox), 0) dampLayout.addSpacing(10) self.cntDamp = QwtCounter(dampBox) self.cntDamp.setRange(0.01, 5.0, 0.01) self.cntDamp.setValue(0.01) dampLayout.addWidget(self.cntDamp, 10) toolBar.addWidget(dampBox) self.statusBar() self.zoom(False) self.showInfo() self.connect(self.cntDamp, SIGNAL('valueChanged(double)'), self.plot.setDamp) self.connect(btnZoom, SIGNAL('toggled(bool)'), self.zoom) self.connect(self.picker, SIGNAL('moved(const QPoint &)'), self.moved) self.connect(self.picker, SIGNAL('selected(const QaPolygon &)'), self.selected) # __init__() def print_(self): printer = QPrinter(QPrinter.HighResolution) printer.setOutputFileName('bode-example-%s.ps' % qVersion()) printer.setCreator('Bode example') printer.setOrientation(QPrinter.Landscape) printer.setColorMode(QPrinter.Color) docName = self.plot.title().text() if not docName.isEmpty(): docName.replace(QRegExp(QString.fromLatin1('\n')), self.tr(' -- ')) printer.setDocName(docName) dialog = QPrintDialog(printer) if dialog.exec_(): filter = PrintFilter() if (QPrinter.GrayScale == printer.colorMode()): filter.setOptions( QwtPlotPrintFilter.PrintAll & ~QwtPlotPrintFilter.PrintBackground | QwtPlotPrintFilter.PrintFrameWithScales) self.plot.print_(printer, filter) # print_() def exportPDF(self): if QT_VERSION > 0x040100: fileName = QFileDialog.getSaveFileName( self, 'Export File Name', 'bode-example-%s.pdf' % qVersion(), 'PDF Documents (*.pdf)') if not fileName.isEmpty(): printer = QPrinter() printer.setOutputFormat(QPrinter.PdfFormat) printer.setOrientation(QPrinter.Landscape) printer.setOutputFileName(fileName) printer.setCreator('Bode example') self.plot.print_(printer) # exportPDF() def exportSVG(self): if QT_VERSION >= 0x040300: fileName = QFileDialog.getSaveFileName( self, 'Export File Name', 'bode-example-%s.svg' % qVersion(), 'SVG Documents (*.svg)') if not fileName.isEmpty(): generator = QSvgGenerator() generator.setFileName(fileName) generator.setSize(QSize(800, 600)) self.plot.print_(generator) # exportSVG() def zoom(self, on): self.zoomers[0].setEnabled(on) self.zoomers[0].zoom(0) self.zoomers[1].setEnabled(on) self.zoomers[1].zoom(0) if on: self.picker.setRubberBand(Qwt.QwtPicker.NoRubberBand) else: self.picker.setRubberBand(Qwt.QwtPicker.CrossRubberBand) self.showInfo() # zoom() def showInfo(self, text=None): if not text: if self.picker.rubberBand(): text = 'Cursor Pos: Press left mouse button in plot region' else: text = 'Zoom: Press mouse button and drag' self.statusBar().showMessage(text) # showInfo() def moved(self, point): info = "Freq=%g, Ampl=%g, Phase=%g" % ( self.plot.invTransform(Qwt.QwtPlot.xBottom, point.x()), self.plot.invTransform(Qwt.QwtPlot.yLeft, point.y()), self.plot.invTransform(Qwt.QwtPlot.yRight, point.y())) self.showInfo(info) # moved() def selected(self, _): self.showInfo() # selected() # class BodeDemo def make(): demo = BodeDemo() demo.resize(540, 400) demo.show() return demo # make() def main(args): app = QApplication(args) fonts = QFontDatabase() for name in ('Verdana', 'STIXGeneral'): if QString(name) in fonts.families(): app.setFont(QFont(name)) break demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': if 'settracemask' in sys.argv: # for debugging, requires: python configure.py --trace ... import sip sip.settracemask(0x3f) main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/RadioDemo.py0000555000175000017500000002012410512102725020322 0ustar poxpox#!/usr/bin/env python # The Python version of Qwt-5.0.0/examples/radio import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from math import * #-- tunerfrm.cpp --# class TuningThermo(Qt.QWidget): def __init__(self, *args): Qt.QWidget.__init__(self, *args) self.thermo = Qwt.QwtThermo(self) self.thermo.setOrientation(Qt.Qt.Horizontal, Qwt.QwtThermo.NoScale) self.thermo.setRange(0.0, 1.0) self.thermo.setFillColor(Qt.Qt.green) label = Qt.QLabel("Tuning", self) label.setAlignment(Qt.Qt.AlignCenter) layout = Qt.QVBoxLayout(self) layout.setMargin(0) layout.addWidget(self.thermo) layout.addWidget(label) self.setFixedWidth(3*label.sizeHint().width()) # __init__() def setValue(self, value): self.thermo.setValue(value) # setValue() # class TuningThermo class TunerFrame(Qt.QFrame): def __init__(self, *args): Qt.QFrame.__init__(self, *args) self.frequencySlider = Qwt.QwtSlider( self, Qt.Qt.Horizontal, Qwt.QwtSlider.TopScale) self.frequencySlider.setScaleMaxMinor(5) self.frequencySlider.setScaleMaxMajor(12) self.frequencySlider.setThumbLength(80) self.frequencySlider.setBorderWidth(1) self.frequencySlider.setRange(87.5, 108, 0.01, 10) self.tuningThermo = TuningThermo(self) self.frequencyWheel = Qwt.QwtWheel(self) self.frequencyWheel.setMass(0.5) self.frequencyWheel.setRange(87.5, 108, 0.01) self.frequencyWheel.setTotalAngle(3600.0) self.connect(self.frequencyWheel, Qt.SIGNAL("valueChanged(double)"), self.adjustFreq) self.connect(self.frequencySlider, Qt.SIGNAL("valueChanged(double)"), self.adjustFreq) mainLayout = Qt.QVBoxLayout(self) mainLayout.setMargin(10) mainLayout.setSpacing(5) mainLayout.addWidget(self.frequencySlider) hLayout = Qt.QHBoxLayout() hLayout.setMargin(0) hLayout.addWidget(self.tuningThermo, 0) hLayout.addStretch(5) hLayout.addWidget(self.frequencyWheel, 2) mainLayout.addLayout(hLayout) # __init__() def adjustFreq(self, f): factor = 13.0 / (108 - 87.5) x = (f - 87.5) * factor field = (sin(x) * cos(4.0 * x))**2 self.tuningThermo.setValue(field) if self.frequencySlider.value() != f: self.frequencySlider.setValue(f) if self.frequencyWheel.value() != f: self.frequencyWheel.setValue(f) self.emit(Qt.SIGNAL("fieldChanged(double)"), field) # adjustFreq() def setFreq(self, f): self.frequencyWheel.setValue(f) # setFreq() # class TunerFrame #-- ampfrm.cpp --# class Knob(Qt.QWidget): def __init__(self, title, min, max, parent): Qt.QWidget.__init__(self, parent) self.knob = Qwt.QwtKnob(self) self.knob.setRange(min, max, 0, 1) self.knob.setScaleMaxMajor(10) self.knob.setKnobWidth(50) self.label = Qt.QLabel(title, self) self.label.setAlignment(Qt.Qt.AlignTop | Qt.Qt.AlignHCenter) self.setSizePolicy(Qt.QSizePolicy.MinimumExpanding, Qt.QSizePolicy.MinimumExpanding) # __init__() def sizeHint(self): sz1 = self.knob.sizeHint() sz2 = self.label.sizeHint() w = max(sz1.width(), sz2.width()) h = sz1.height() + sz2.height() off = self.knob.scaleDraw().extent(Qt.QPen(), self.knob.font()) off -= 10 # spacing return Qt.QSize(w, h - off) # sizeHint() def value(self): return self.knob.value() # value() def resizeEvent(self, event): sz = event.size() h = self.label.sizeHint().height() self.label.setGeometry(0, sz.height() - h, sz.width(), h) h = self.knob.sizeHint().height() off = self.knob.scaleDraw().extent(Qt.QPen(), self.knob.font()) off -= 10 # spacing self.knob.setGeometry(0, self.label.pos().y() - h + off, sz.width(), h) # resizeEvent() # class Knob class Thermo(Qt.QWidget): def __init__(self, title, parent): Qt.QWidget.__init__(self, parent) self.thermo = Qwt.QwtThermo(self) self.thermo.setPipeWidth(6) self.thermo.setRange(-40, 10) self.thermo.setFillColor(Qt.Qt.green) self.thermo.setAlarmColor(Qt.Qt.red) self.thermo.setAlarmLevel(0.0) self.thermo.setAlarmEnabled(True) label = Qt.QLabel(title, self) label.setAlignment(Qt.Qt.AlignTop | Qt.Qt.AlignLeft) layout = Qt.QVBoxLayout(self) layout.setMargin(0) layout.setSpacing(0) layout.addWidget(self.thermo, 10) layout.addWidget(label) # __init__() def setValue(self, value): self.thermo.setValue(value) # setValue() # class Thermo class AmplifierFrame(Qt.QFrame): def __init__(self, *args): Qt.QFrame.__init__(self, *args) self.phs = 0.0 self.master = 0.0 self.volumeKnob = Knob('Volume', 0.0, 10.0, self) self.balanceKnob = Knob('Balance', -10.0, 10.0, self) self.trebleKnob = Knob('Treble', -10.0, 10.0, self) self.bassKnob = Knob('Bass', -10.0, 10.0, self) self.leftThermo = Thermo('Left [dB]', self) self.rightThermo = Thermo('Right [dB]', self) layout = Qt.QHBoxLayout(self) layout.setSpacing(0) layout.setMargin(10) layout.addWidget(self.volumeKnob) layout.addWidget(self.balanceKnob) layout.addWidget(self.trebleKnob) layout.addWidget(self.bassKnob) layout.addSpacing(20) layout.addStretch(10) layout.addWidget(self.leftThermo) layout.addSpacing(10) layout.addWidget(self.rightThermo) self.startTimer(50) # __init__() def timerEvent(self, event): sig_bass = (1.0 + 0.1*self.bassKnob.value()) * sin(13.0*self.phs) sig_mid_l = sin(17.0*self.phs) sig_mid_r = cos(17.5*self.phs) sig_trbl_l = 0.5*(1.0+0.1*self.trebleKnob.value()) * sin(35.0*self.phs) sig_trbl_r = 0.5*(1.0+0.1*self.trebleKnob.value()) * sin(34.0*self.phs) sig_l = 0.05*self.master*self.volumeKnob.value() * \ (sig_bass+sig_mid_l+sig_trbl_l)**2 sig_r = 0.05*self.master*self.volumeKnob.value() * \ (sig_bass+sig_mid_r+sig_trbl_r)**2 balance = 0.1 * self.balanceKnob.value() if balance > 0: sig_l *= (1.0 - balance) else: sig_r *= (1.0 + balance) if sig_l > 0.01: sig_l = 20.0 * log10(sig_l) else: sig_l = -40.0 if sig_r > 0.01: sig_r = 20.0 * log10(sig_r) else: sig_r = - 40.0 self.leftThermo.setValue(sig_l) self.rightThermo.setValue(sig_r) self.phs += pi / 100 if self.phs > pi: self.phs = 0 # timerEvent() def setMaster(self, value): self.master = value # setMaster() # class AmplifierFrame #-- radio.cpp --# class RadioDemo(Qt.QWidget): def __init__(self, *args): Qt.QWidget.__init__(self, *args) tunerFrame = TunerFrame(self) tunerFrame.setFrameStyle(Qt.QFrame.Panel | Qt.QFrame.Raised) amplifierFrame = AmplifierFrame(self) amplifierFrame.setFrameStyle(Qt.QFrame.Panel | Qt.QFrame.Raised) layout = Qt.QVBoxLayout(self) layout.setMargin(0) layout.setSpacing(0) layout.addWidget(tunerFrame) layout.addWidget(amplifierFrame) self.connect(tunerFrame, Qt.SIGNAL("fieldChanged(double)"), amplifierFrame.setMaster) tunerFrame.setFreq(90.0) # __init__() # class RadioDemo def make(): demo = RadioDemo() demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/DialDemo.py0000555000175000017500000003601111207673326020153 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/dials # for debugging, requires: python configure.py --trace ... if 0: import sip sip.settracemask(0x3f) import math import random import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt def enumList(enum, sentinel): ''' ''' return [enum(i) for i in range(sentinel)] colorGroupList = enumList( Qt.QPalette.ColorGroup, Qt.QPalette.NColorGroups) colorRoleList = enumList( Qt.QPalette.ColorRole, Qt.QPalette.NColorRoles) handList = enumList( Qwt.QwtAnalogClock.Hand, Qwt.QwtAnalogClock.NHands) class CompassGrid(Qt.QFrame): def __init__(self, *args): Qt.QFrame.__init__(self, *args) palette = self.palette() palette.setColor(self.backgroundRole(), Qt.Qt.gray) self.setPalette(palette) layout = Qt.QGridLayout(self) for i in xrange(6): layout.addWidget(self.__createCompass(i), i / 3, i % 3) for i in xrange(layout.columnCount()): layout.setColumnStretch(i, 1) # __init__() def __createCompass(self, pos): palette = Qt.QPalette() for colorRole in colorRoleList: palette.setColor(colorRole, Qt.QColor()) palette.setColor( Qt.QPalette.Base, self.palette().color(self.backgroundRole()).light(120)) palette.setColor( Qt.QPalette.Foreground, palette.color(Qt.QPalette.Base)) compass = Qwt.QwtCompass() compass.setLineWidth(4) if pos < 3: compass.setFrameShadow(Qwt.QwtCompass.Sunken) else: compass.setFrameShadow(Qwt.QwtCompass.Raised) if pos == 0: compass.setMode(Qwt.QwtCompass.RotateScale) rose = Qwt.QwtSimpleCompassRose(16, 2) rose.setWidth(0.15) compass.setRose(rose) elif pos == 1: compass.setLabelMap({0.0: "N", 90.0: "E", 180.0: "S", 270.0: "W"}) rose = Qwt.QwtSimpleCompassRose(4, 1) compass.setRose(rose) compass.setNeedle( Qwt.QwtCompassWindArrow(Qwt.QwtCompassWindArrow.Style2)) compass.setValue(60.0) elif pos == 2: palette.setColor(Qt.QPalette.Base, Qt.Qt.darkBlue) palette.setColor(Qt.QPalette.Foreground, Qt.QColor(Qt.Qt.darkBlue).dark(120)) palette.setColor(Qt.QPalette.Text, Qt.Qt.white) compass.setScaleTicks(1, 1, 3) compass.setScale(36, 5, 0) compass.setNeedle(Qwt.QwtCompassMagnetNeedle( Qwt.QwtCompassMagnetNeedle.ThinStyle)) compass.setValue(220.0) elif pos == 3: palette.setColor(Qt.QPalette.Base, self.palette().color(self.backgroundRole())) palette.setColor(Qt.QPalette.Foreground, Qt.Qt.blue) compass.setLineWidth(0) compass.setScaleOptions(Qwt.QwtDial.ScaleBackbone | Qwt.QwtDial.ScaleTicks | Qwt.QwtDial.ScaleLabel) compass.setScaleTicks(0, 0, 3) compass.setLabelMap({ 0.0: '0', 60.0: '60', 120.0: '120', 180.0: '180', 240.0: '240', 320.0: '320'}) compass.setScale(36, 5, 0) compass.setNeedle(Qwt.QwtDialSimpleNeedle( Qwt.QwtDialSimpleNeedle.Ray, False, Qt.Qt.white)) compass.setOrigin(220.0) compass.setValue(20.0) elif pos == 4: compass.setScaleTicks(0, 0, 3) compass.setNeedle(Qwt.QwtCompassMagnetNeedle( Qwt.QwtCompassMagnetNeedle.TriangleStyle, Qt.Qt.white, Qt.Qt.red)) compass.setValue(220.0) elif pos == 5: palette.setColor(Qt.QPalette.Foreground, Qt.Qt.black) compass.setNeedle(Qwt.QwtDialSimpleNeedle( Qwt.QwtDialSimpleNeedle.Ray, False, Qt.Qt.yellow)) compass.setValue(315.0) newPalette = compass.palette() for colorRole in colorRoleList: if palette.color(colorRole).isValid(): for colorGroup in colorGroupList: newPalette.setColor( colorGroup, colorRole, palette.color(colorRole)) for colorGroup in colorGroupList: light = newPalette.color( colorGroup, Qt.QPalette.Base).light(170) dark = newPalette.color( colorGroup, Qt.QPalette.Base).dark(170) if compass.frameShadow() == Qwt.QwtDial.Raised: mid = newPalette.color( colorGroup, Qt.QPalette.Base).dark(110) else: mid = newPalette.color( colorGroup, Qt.QPalette.Base).light(110) newPalette.setColor(colorGroup, Qt.QPalette.Dark, dark) newPalette.setColor(colorGroup, Qt.QPalette.Mid, mid) newPalette.setColor(colorGroup, Qt.QPalette.Light, light) compass.setPalette(newPalette) return compass # __createCompass() # class CompassGrid class SpeedoMeter(Qwt.QwtDial): def __init__(self, *args): Qwt.QwtDial.__init__(self, *args) self.__label = 'km/h' self.setWrapping(False) self.setReadOnly(True) self.setOrigin(135.0) self.setScaleArc(0.0, 270.0) self.setNeedle(Qwt.QwtDialSimpleNeedle( Qwt.QwtDialSimpleNeedle.Arrow, True, Qt.QColor(Qt.Qt.red), Qt.QColor(Qt.Qt.gray).light(130))) self.setScaleOptions(Qwt.QwtDial.ScaleTicks | Qwt.QwtDial.ScaleLabel) self.setScaleTicks(0, 4, 8) # __init__() def setLabel(self, text): self.__label = text self.update() # setLabel() def label(self): return self.__label # label() def drawScaleContents(self, painter, center, radius): rect = Qt.QRect(0, 0, 2 * radius, 2 * radius - 10) rect.moveCenter(center) painter.setPen(self.palette().color(Qt.QPalette.Text)) painter.drawText( rect, Qt.Qt.AlignBottom | Qt.Qt.AlignHCenter, self.__label) # drawScaleContents # class SpeedoMeter class AttitudeIndicatorNeedle(Qwt.QwtDialNeedle): def __init__(self, color): Qwt.QwtDialNeedle.__init__(self) palette = Qt.QPalette() for colourGroup in colorGroupList: palette.setColor(colourGroup, Qt.QPalette.Text, color) self.setPalette(palette) # __init__() def draw(self, painter, center, length, direction, cg): direction *= math.pi / 180.0 triangleSize = int(round(length * 0.1)) painter.save() p0 = Qt.QPoint(center.x() + 1, center.y() + 1) p1 = Qwt.qwtPolar2Pos(p0, length - 2 * triangleSize - 2, direction) pa = Qt.QPolygon([ Qwt.qwtPolar2Pos(p1, 2 * triangleSize, direction), Qwt.qwtPolar2Pos(p1, triangleSize, direction + math.pi/2), Qwt.qwtPolar2Pos(p1, triangleSize, direction - math.pi/2), ]) color = self.palette().color(cg, Qt.QPalette.Text) painter.setBrush(color) painter.drawPolygon(pa) painter.setPen(Qt.QPen(color, 3)) painter.drawLine( Qwt.qwtPolar2Pos(p0, length - 2, direction + math.pi/2), Qwt.qwtPolar2Pos(p0, length - 2, direction - math.pi/2)) painter.restore() # draw() # class AttitudeIndicatorNeedle class AttitudeIndicator(Qwt.QwtDial): def __init__(self, *args): Qwt.QwtDial.__init__(self, *args) self.__gradient = 0.0 self.setMode(Qwt.QwtDial.RotateScale) self.setWrapping(True) self.setOrigin(270.0) self.setScaleOptions(Qwt.QwtDial.ScaleTicks) self.setScale(0, 0, 30.0) self.setNeedle(AttitudeIndicatorNeedle( self.palette().color(Qt.QPalette.Text))) # __init__() def angle(self): return self.value() # angle() def setAngle(self, angle): self.setValue(angle) # setAngle() def gradient(self): return self.__gradient # gradient() def setGradient(self, gradient): self.__gradient = gradient # setGradient() def keyPressEvent(self, event): if event.key() == Qt.Qt.Key_Plus: self.setGradient(self.gradient() + 0.05) elif event.key() == Qt.Qt.Key_Minus: self.setGradient(self.gradient() - 0.05) else: Qwt.QwtDial.keyPressEvent(self, event) # keyPressEvent() def drawScale(self, painter, center, radius, origin, minArc, maxArc): dir = (360.0 - origin) * math.pi / 180.0 offset = 4 p0 = Qwt.qwtPolar2Pos(center, offset, dir + math.pi) w = self.contentsRect().width() # clip region to swallow 180 - 360 degrees pa = [] pa.append(Qwt.qwtPolar2Pos(p0, w, dir - math.pi/2)) pa.append(Qwt.qwtPolar2Pos(pa[-1], 2 * w, dir + math.pi/2)) pa.append(Qwt.qwtPolar2Pos(pa[-1], w, dir)) pa.append(Qwt.qwtPolar2Pos(pa[-1], 2 * w, dir - math.pi/2)) painter.save() painter.setClipRegion(Qt.QRegion(Qt.QPolygon(pa))) Qwt.QwtDial.drawScale( self, painter, center, radius, origin, minArc, maxArc) painter.restore() # drawScale() def drawScaleContents(self, painter, center, radius): dir = 360 - int(round(self.origin() - self.value())) arc = 90 + int(round(self.gradient() * 90)) skyColor = Qt.QColor(38, 151, 221) painter.save() painter.setBrush(skyColor) painter.drawChord( self.scaleContentsRect(), (dir - arc)*16, 2*arc*16) painter.restore() # drawScaleContents() # class AttitudeIndicator class CockpitGrid(Qt.QFrame): def __init__(self, *args): Qt.QFrame.__init__(self, *args) self.setPalette( self.__colorTheme(Qt.QColor(Qt.Qt.darkGray).dark(150))) layout = Qt.QGridLayout(self) for i in xrange(3): layout.addWidget(self.__createDial(i), 0, i) for i in xrange(layout.columnCount()): layout.setColumnStretch(i, 1) self.__speed_offset = 0.8 self.__angle_offset = 0.05 self.__gradient_offset = 0.005 # __init__() def __colorTheme(self, base): background = base.dark(150) foreground = base.dark(200) mid = base.dark(110) dark = base.dark(170) light = base.light(170) text = foreground.light(800) palette = Qt.QPalette() for colorGroup in colorGroupList: palette.setColor(colorGroup, Qt.QPalette.Base, base) palette.setColor(colorGroup, Qt.QPalette.Background, background) palette.setColor(colorGroup, Qt.QPalette.Mid, mid) palette.setColor(colorGroup, Qt.QPalette.Light, light) palette.setColor(colorGroup, Qt.QPalette.Dark, dark) palette.setColor(colorGroup, Qt.QPalette.Text, text) palette.setColor(colorGroup, Qt.QPalette.Foreground, foreground) return palette # __colorTheme() def __createDial(self, pos): dial = None if pos == 0: self.__clock = Qwt.QwtAnalogClock(self) knobColor = Qt.QColor(Qt.Qt.gray).light(130) for h in handList: handColor = Qt.QColor(Qt.Qt.gray).light(150) width = 8 if h == Qwt.QwtAnalogClock.SecondHand: handColor = Qt.Qt.gray width = 5 hand = Qwt.QwtDialSimpleNeedle( Qwt.QwtDialSimpleNeedle.Arrow, True, handColor, knobColor) hand.setWidth(width) self.__clock.setHand(h, hand) timer = Qt.QTimer(self.__clock) timer.connect(timer, Qt.SIGNAL('timeout()'), self.__clock.setCurrentTime) timer.start(1000) dial = self.__clock elif pos == 1: self.__speedo = SpeedoMeter(self) self.__speedo.setRange(0.0, 240.0) self.__speedo.setScale(-1, 2, 20) timer = Qt.QTimer(self.__speedo) timer.connect(timer, Qt.SIGNAL('timeout()'), self.changeSpeed) timer.start(50) dial = self.__speedo elif pos == 2: self.__ai = AttitudeIndicator(self) gradientTimer = Qt.QTimer(self.__ai) gradientTimer.connect(gradientTimer, Qt.SIGNAL('timeout()'), self.changeGradient) gradientTimer.start(100) angleTimer = Qt.QTimer(self.__ai) angleTimer.connect( angleTimer, Qt.SIGNAL('timeout()'), self.changeAngle) angleTimer.start(100) dial = self.__ai if dial: dial.setReadOnly(True) dial.scaleDraw().setPenWidth(3) dial.setLineWidth(4) dial.setFrameShadow(Qwt.QwtDial.Sunken) return dial # __createDial() def changeSpeed(self): speed = self.__speedo.value() if ((speed < 40.0 and self.__speed_offset < 0.0) or (speed > 200.0 and self.__speed_offset > 0.0)): self.__speed_offset = -self.__speed_offset r = random.randrange(12) if r < 6: self.__speedo.setValue(speed + r*self.__speed_offset) # changeSpeed() def changeAngle(self): angle = self.__ai.angle() if angle > 180.0: angle -= 360.0 if ((angle < -7.0 and self.__angle_offset < 0.0 ) or (angle > 7.0 and self.__angle_offset > 0.0)): self.__angle_offset = -self.__angle_offset self.__ai.setAngle(angle + self.__angle_offset) # changeAngle() def changeGradient(self): gradient = self.__ai.gradient() if ((gradient < -0.05 and self.__gradient_offset < 0.0 ) or (gradient > 0.05 and self.__gradient_offset > 0.0)): self.__gradient_offset = -self.__gradient_offset self.__ai.setGradient(gradient + self.__gradient_offset) # changeGradient() # class CockpitGrid def make(): demo = Qt.QTabWidget() demo.addTab(CompassGrid(), "Compass") demo.addTab(CockpitGrid(), "Cockpit") demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': if 'settracemask' in sys.argv: # for debugging, requires: python configure.py --trace ... import sip sip.settracemask(0x3f) main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/Grab.py0000555000175000017500000000261311020445533017337 0ustar poxpox#!/usr/bin/env python try: import PyQt4.Qwt5.iqt except ImportError: raise SystemExit, 'Grab.py requires the PyQt4.Qwt5.iqt module' from PyQt4.Qt import QPixmap # a list of .py files defining a function make() # make() must initialize, show and return: # a QWidget # or: # a tuple of QWidgets jobs = [ 'BarPlotDemo', 'BodeDemo', 'CPUplot', 'CartesianDemo', 'CliDemo', 'CurveDemo1', 'CurveDemo2', 'CurveDemo3', 'DataDemo', 'DialDemo', 'ErrorBarDemo', 'EventFilterDemo', 'HistogramDemo', 'ImagePlotDemo', 'MapDemo', 'MaskedDataDemo', 'MultiDemo', 'PickerDemo', 'RadioDemo', 'ReallySimpleDemo', 'SimpleDemo', 'SliderDemo', 'SpectrogramDemo', ] def expose(jobs, cache = {}): for job in jobs: result = __import__(job).make() if type(result) == type(()): for i in range(len(result)): cache['%s%s' % (job, i)] = result[i] else: cache[job] = result return cache # expose() def save(cache): for name, widget in cache.items(): pixmap = QPixmap.grabWidget(widget) pixmap.save(name+'.png', 'PNG') # save() def main(): cache = expose(jobs) raw_input("Are all widgets looking HAPPY? ") save(cache) # main() if __name__ == '__main__': main() # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/SimpleDemo.py0000555000175000017500000000453310434023557020533 0ustar poxpox#!/usr/bin/env python # The Python version of Qwt-5.0.0/examples/simple import math import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt class SimpleData(Qwt.QwtData): def __init__(self, function, size): Qwt.QwtData.__init__(self) self.__function = function self.__size = size def copy(self): return self def size(self): return self.__size def x(self, i): return 0.1*i def y(self, i): return self.__function(self.x(i)) # class SimpleData class SimplePlot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) # make a QwtPlot widget self.setTitle('SimpleDemo.py') self.insertLegend(Qwt.QwtLegend(), Qwt.QwtPlot.RightLegend) # a variation on the C++ example self.plotLayout().setAlignCanvasToScales(True) grid = Qwt.QwtPlotGrid() grid.attach(self) grid.setPen(Qt.QPen(Qt.Qt.black, 0, Qt.Qt.DotLine)) # set axis titles self.setAxisTitle(Qwt.QwtPlot.xBottom, 'x -->') self.setAxisTitle(Qwt.QwtPlot.yLeft, 'y -->') # insert a few curves cSin = Qwt.QwtPlotCurve('y = sin(x)') cSin.setPen(Qt.QPen(Qt.Qt.red)) cSin.attach(self) cCos = Qwt.QwtPlotCurve('y = cos(x)') cCos.setPen(Qt.QPen(Qt.Qt.blue)) cCos.attach(self) # initialize the data cSin.setData(SimpleData(math.sin, 100)) cCos.setData(SimpleData(math.cos, 100)) # insert a horizontal marker at y = 0 mY = Qwt.QwtPlotMarker() mY.setLabel(Qwt.QwtText('y = 0')) mY.setLabelAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignTop) mY.setLineStyle(Qwt.QwtPlotMarker.HLine) mY.setYValue(0.0) mY.attach(self) # insert a vertical marker at x = 2 pi mX = Qwt.QwtPlotMarker() mX.setLabel(Qwt.QwtText('x = 2 pi')) mX.setLabelAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignTop) mX.setLineStyle(Qwt.QwtPlotMarker.VLine) mX.setXValue(2*math.pi) mX.attach(self) # replot self.replot() # __init__() # class Plot def make(): demo = SimplePlot() demo.resize(500, 300) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/DataDemo.py0000555000175000017500000000621610726167703020161 0ustar poxpox#!/usr/bin/env python # The Python version of Qwt-5.0.0/examples/data_plot # for debugging, requires: python configure.py --trace ... if False: import sip sip.settracemask(0x3f) import random import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * class DataPlot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) self.setCanvasBackground(Qt.Qt.white) self.alignScales() # Initialize data self.x = arange(0.0, 100.1, 0.5) self.y = zeros(len(self.x), Float) self.z = zeros(len(self.x), Float) self.setTitle("A Moving QwtPlot Demonstration") self.insertLegend(Qwt.QwtLegend(), Qwt.QwtPlot.BottomLegend); self.curveR = Qwt.QwtPlotCurve("Data Moving Right") self.curveR.attach(self) self.curveL = Qwt.QwtPlotCurve("Data Moving Left") self.curveL.attach(self) self.curveL.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, Qt.QBrush(), Qt.QPen(Qt.Qt.yellow), Qt.QSize(7, 7))) self.curveR.setPen(Qt.QPen(Qt.Qt.red)) self.curveL.setPen(Qt.QPen(Qt.Qt.blue)) mY = Qwt.QwtPlotMarker() mY.setLabelAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignTop) mY.setLineStyle(Qwt.QwtPlotMarker.HLine) mY.setYValue(0.0) mY.attach(self) self.setAxisTitle(Qwt.QwtPlot.xBottom, "Time (seconds)") self.setAxisTitle(Qwt.QwtPlot.yLeft, "Values") self.startTimer(50) self.phase = 0.0 # __init__() def alignScales(self): self.canvas().setFrameStyle(Qt.QFrame.Box | Qt.QFrame.Plain) self.canvas().setLineWidth(1) for i in range(Qwt.QwtPlot.axisCnt): scaleWidget = self.axisWidget(i) if scaleWidget: scaleWidget.setMargin(0) scaleDraw = self.axisScaleDraw(i) if scaleDraw: scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Backbone, False) # alignScales() def timerEvent(self, e): if self.phase > pi - 0.0001: self.phase = 0.0 # y moves from left to right: # shift y array right and assign new value y[0] self.y = concatenate((self.y[:1], self.y[:-1]), 1) self.y[0] = sin(self.phase) * (-1.0 + 2.0*random.random()) # z moves from right to left: # Shift z array left and assign new value to z[n-1]. self.z = concatenate((self.z[1:], self.z[:1]), 1) self.z[-1] = 0.8 - (2.0 * self.phase/pi) + 0.4*random.random() self.curveR.setData(self.x, self.y) self.curveL.setData(self.x, self.z) self.replot() self.phase += pi*0.02 # timerEvent() # class DataPlot def make(): demo = DataPlot() demo.resize(500, 300) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/ReallySimpleDemo.py0000555000175000017500000000377511207673326021717 0ustar poxpox#!/usr/bin/env python # The really simple Python version of Qwt-5.0.0/examples/simple import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * class SimplePlot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) # make a QwtPlot widget self.setTitle('ReallySimpleDemo.py') self.insertLegend(Qwt.QwtLegend(), Qwt.QwtPlot.RightLegend) # set axis titles self.setAxisTitle(Qwt.QwtPlot.xBottom, 'x -->') self.setAxisTitle(Qwt.QwtPlot.yLeft, 'y -->') # insert a few curves cSin = Qwt.QwtPlotCurve('y = sin(x)') cSin.setPen(Qt.QPen(Qt.Qt.red)) cSin.attach(self) cCos = Qwt.QwtPlotCurve('y = cos(x)') cCos.setPen(Qt.QPen(Qt.Qt.blue)) cCos.attach(self) # make a Numeric array for the horizontal data x = arange(0.0, 10.0, 0.1) # initialize the data cSin.setData(x, sin(x)) cCos.setData(x, cos(x)) # insert a horizontal marker at y = 0 mY = Qwt.QwtPlotMarker() mY.setLabel(Qwt.QwtText('y = 0')) mY.setLabelAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignTop) mY.setLineStyle(Qwt.QwtPlotMarker.HLine) mY.setYValue(0.0) mY.attach(self) # insert a vertical marker at x = 2 pi mX = Qwt.QwtPlotMarker() mX.setLabel(Qwt.QwtText('x = 2 pi')) mX.setLabelAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignTop) mX.setLineStyle(Qwt.QwtPlotMarker.VLine) mX.setXValue(2*pi) mX.attach(self) # replot self.replot() # __init__() # class Plot def make(): demo = SimplePlot() demo.resize(500, 300) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire if __name__ == '__main__': if 'settracemask' in sys.argv: # for debugging, requires: python configure.py --trace ... import sip sip.settracemask(0x3f) main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/PyFontify.py0000444000175000017500000001071510434023557020420 0ustar poxpox"""Module to analyze Python source code; for syntax coloring tools. Interface: tags = fontify(pytext, searchfrom, searchto) The 'pytext' argument is a string containing Python source code. The (optional) arguments 'searchfrom' and 'searchto' may contain a slice in pytext. The returned value is a list of tuples, formatted like this: [('keyword', 0, 6, None), ('keyword', 11, 17, None), ('comment', 23, 53, None), etc. ] The tuple contents are always like this: (tag, startindex, endindex, sublist) tag is one of 'keyword', 'string', 'comment' or 'identifier' sublist is not used, hence always None. """ # Based on FontText.py by Mitchell S. Chapman, # which was modified by Zachary Roadhouse, # then un-Tk'd by Just van Rossum. # Many thanks for regular expression debugging & authoring are due to: # Tim (the-incredib-ly y'rs) Peters and Cristian Tismer # So, who owns the copyright? ;-) How about this: # Copyright 1996-2001: # Mitchell S. Chapman, # Zachary Roadhouse, # Tim Peters, # Just van Rossum # Changes by Gerard Vermeulen: # - version 0.5 # - use keyword.kwlist # - replace string module by str methods __version__ = "0.5" import keyword import string import re # First a little helper, since I don't like to repeat things. (Tismer speaking) def replace(where, what, with): return with.join(where.split(what)) # Build up a regular expression which will match anything # interesting, including multi-line triple-quoted strings. commentPat = r"#[^\n]*" pat = r"q[^\\q\n]*(\\[\000-\377][^\\q\n]*)*q" quotePat = replace(pat, "q", "'") + "|" + replace(pat, 'q', '"') # Way to go, Tim! pat = r""" qqq [^\\q]* ( ( \\[\000-\377] | q ( \\[\000-\377] | [^\q] | q ( \\[\000-\377] | [^\\q] ) ) ) [^\\q]* )* qqq """ pat = ''.join(pat.split()) # get rid of whitespace tripleQuotePat = replace(pat, "q", "'") + "|" + replace(pat, 'q', '"') # Build up a regular expression which matches all and only # Python keywords. This will let us skip the uninteresting # identifier references. # nonKeyPat identifies characters which may legally precede # a keyword pattern. nonKeyPat = r"(^|[^a-zA-Z0-9_.\"'])" keyPat = nonKeyPat + "(" + string.join(keyword.kwlist, "|") + ")" + nonKeyPat matchPat = commentPat + "|" + keyPat + "|" + tripleQuotePat + "|" + quotePat matchRE = re.compile(matchPat) idKeyPat = "[ \t]*[A-Za-z_][A-Za-z_0-9.]*" # Ident w. leading whitespace. idRE = re.compile(idKeyPat) def fontify(pytext, searchfrom = 0, searchto = None): if searchto is None: searchto = len(pytext) # Cache a few attributes for quicker reference. search = matchRE.search idSearch = idRE.search tags = [] tags_append = tags.append commentTag = 'comment' stringTag = 'string' keywordTag = 'keyword' identifierTag = 'identifier' start = 0 end = searchfrom while 1: m = search(pytext, end) if m is None: break # EXIT LOOP start = m.start() if start >= searchto: break # EXIT LOOP match = m.group(0) end = start + len(match) c = match[0] if c not in "#'\"": # Must have matched a keyword. if start <> searchfrom: # there's still a redundant char before and after it, strip! match = match[1:-1] start = start + 1 else: # this is the first keyword in the text. # Only a space at the end. match = match[:-1] end = end - 1 tags_append((keywordTag, start, end, None)) # If this was a defining keyword, look ahead to the # following identifier. if match in ["def", "class"]: m = idSearch(pytext, end) if m is not None: start = m.start() if start == end: match = m.group(0) end = start + len(match) tags_append((identifierTag, start, end, None)) elif c == "#": tags_append((commentTag, start, end, None)) else: tags_append((stringTag, start, end, None)) return tags def test(path): f = open(path) text = f.read() f.close() tags = fontify(text) for tag, start, end, sublist in tags: print tag, `text[start:end]` pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/MultiDemo.py0000555000175000017500000001223010651157117020366 0ustar poxpox#!/usr/bin/env python # Plot of scipy-, Numeric-, numarray-arrays and lists of Python floats. import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt def drange(start, stop, step): start, stop, step = float(start), float(stop), float(step) size = int(round((stop-start)/step)) result = [start]*size for i in xrange(size): result[i] += i*step return result # drange() def lorentzian(x): return 1.0/(1.0+(x-5.0)**2) # lorentzian() class MultiDemo(Qt.QWidget): def __init__(self, *args): Qt.QWidget.__init__(self, *args) layout = Qt.QGridLayout(self) # try to create a plot for SciPy arrays try: # import does_not_exist import numpy # make a curve and copy the data numpy_curve = Qwt.QwtPlotCurve('y = lorentzian(x)') x = numpy.arange(0.0, 10.0, 0.01) y = lorentzian(x) numpy_curve.setData(x, y) # here, we know we can plot NumPy arrays numpy_plot = Qwt.QwtPlot(self) numpy_plot.setTitle('numpy array') numpy_plot.setCanvasBackground(Qt.Qt.white) numpy_plot.plotLayout().setCanvasMargin(0) numpy_plot.plotLayout().setAlignCanvasToScales(True) # insert a curve and make it red numpy_curve.attach(numpy_plot) numpy_curve.setPen(Qt.QPen(Qt.Qt.red)) layout.addWidget(numpy_plot, 0, 0) numpy_plot.replot() except ImportError, message: print "%s: %s" % (ImportError, message) print "Install NumPy to plot plot NumPy arrays" except TypeError, message: print "%s: %s" % (TypeError, message) print "Rebuild PyQwt to plot NumPy arrays" # try to create a plot for Numeric arrays try: # import does_not_exist import Numeric # make a curve and copy the data numeric_curve = Qwt.QwtPlotCurve('y = lorentzian(x)') x = Numeric.arange(0.0, 10.0, 0.01) y = lorentzian(x) numeric_curve.setData(x, y) # here, we know we can plot Numeric arrays numeric_plot = Qwt.QwtPlot(self) numeric_plot.setTitle('Numeric array') numeric_plot.setCanvasBackground(Qt.Qt.white) numeric_plot.plotLayout().setCanvasMargin(0) numeric_plot.plotLayout().setAlignCanvasToScales(True) # insert a curve and make it red numeric_curve.attach(numeric_plot) numeric_curve.setPen(Qt.QPen(Qt.Qt.red)) layout.addWidget(numeric_plot, 0, 1) numeric_plot.replot() except ImportError, message: print "%s: %s" % (ImportError, message) print "Install Numeric to plot Numeric arrays" except TypeError, message: print "%s: %s" % (TypeError, message) print "Rebuild PyQwt to plot Numeric arrays" # try to create a plot for numarray arrays try: # import does_not_exist import numarray # make a curve and copy the data numarray_curve = Qwt.QwtPlotCurve('y = lorentzian(x)') x = numarray.arange(0.0, 10.0, 0.01) y = lorentzian(x) numarray_curve.setData(x, y) # here, we know we can plot numarray arrays numarray_plot = Qwt.QwtPlot(self) numarray_plot.setTitle('numarray array') numarray_plot.setCanvasBackground(Qt.Qt.white) numarray_plot.plotLayout().setCanvasMargin(0) numarray_plot.plotLayout().setAlignCanvasToScales(True) # insert a curve and make it red numarray_curve.attach(numarray_plot) numarray_curve.setPen(Qt.QPen(Qt.Qt.red)) layout.addWidget(numarray_plot, 1, 0) numarray_plot.replot() except ImportError, message: print "%s: %s" % (ImportError, message) print "Install numarray to plot numarray arrays" except TypeError, message: print "%s: %s" % (TypeError, message) print "Rebuild PyQwt to plot numarray arrays" # create a plot widget for lists of Python floats list_plot = Qwt.QwtPlot(self) list_plot.setTitle('Python list') list_plot.setCanvasBackground(Qt.Qt.white) list_plot.plotLayout().setCanvasMargin(0) list_plot.plotLayout().setAlignCanvasToScales(True) x = drange(0.0, 10.0, 0.01) y = map(lorentzian, x) # insert a curve, make it red and copy the lists list_curve = Qwt.QwtPlotCurve('y = lorentzian(x)') list_curve.attach(list_plot) list_curve.setPen(Qt.QPen(Qt.Qt.red)) list_curve.setData(x, y) layout.addWidget(list_plot, 1, 1) list_plot.replot() # __init__() # class MultiDemo def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() def make(): demo = MultiDemo() demo.resize(400, 600) demo.show() return demo # make() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/ImagePlotDemo.py0000555000175000017500000001511210720074617021157 0ustar poxpox#!/usr/bin/env python import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * # from scipy.pilutil def bytescale(data, cmin=None, cmax=None, high=255, low=0): if ((hasattr(data, 'dtype') and data.dtype.char == UInt8) or (hasattr(data, 'typecode') and data.typecode == UInt8) ): return data high = high - low if cmin is None: cmin = min(ravel(data)) if cmax is None: cmax = max(ravel(data)) scale = high * 1.0 / (cmax-cmin or 1) bytedata = ((data*1.0-cmin)*scale + 0.4999).astype(UInt8) return bytedata + asarray(low).astype(UInt8) # bytescale() def linearX(nx, ny): return repeat(arange(nx, typecode = Float32)[:, NewAxis], ny, -1) # linearX() def linearY(nx, ny): return repeat(arange(ny, typecode = Float32)[NewAxis, :], nx, 0) # linearY() def square(n, min, max): t = arange(min, max, float(max-min)/(n-1)) #return outer(cos(t), sin(t)) return cos(t)*sin(t)[:,NewAxis] # square() class PlotImage(Qwt.QwtPlotItem): def __init__(self, title = Qwt.QwtText()): Qwt.QwtPlotItem.__init__(self) if not isinstance(title, Qwt.QwtText): self.title = Qwt.QwtText(str(title)) else: self.title = title self.setItemAttribute(Qwt.QwtPlotItem.Legend); self.xyzs = None # __init__() def setData(self, xyzs, xRange = None, yRange = None): self.xyzs = xyzs shape = xyzs.shape if not xRange: xRange = (0, shape[0]) if not yRange: yRange = (0, shape[1]) self.xMap = Qwt.QwtScaleMap(0, xyzs.shape[0], *xRange) self.plot().setAxisScale(Qwt.QwtPlot.xBottom, *xRange) self.yMap = Qwt.QwtScaleMap(0, xyzs.shape[1], *yRange) self.plot().setAxisScale(Qwt.QwtPlot.yLeft, *yRange) self.image = Qwt.toQImage(bytescale(self.xyzs)).mirrored(False, True) for i in range(0, 256): self.image.setColor(i, Qt.qRgb(i, 0, 255-i)) # setData() def updateLegend(self, legend): Qwt.QwtPlotItem.updateLegend(self, legend) legend.find(self).setText(self.title) # updateLegend() def draw(self, painter, xMap, yMap, rect): """Paint image zoomed to xMap, yMap Calculate (x1, y1, x2, y2) so that it contains at least 1 pixel, and copy the visible region to scale it to the canvas. """ assert(isinstance(self.plot(), Qwt.QwtPlot)) # calculate y1, y2 # the scanline order (index y) is inverted with respect to the y-axis y1 = y2 = self.image.height() y1 *= (self.yMap.s2() - yMap.s2()) y1 /= (self.yMap.s2() - self.yMap.s1()) y1 = max(0, int(y1-0.5)) y2 *= (self.yMap.s2() - yMap.s1()) y2 /= (self.yMap.s2() - self.yMap.s1()) y2 = min(self.image.height(), int(y2+0.5)) # calculate x1, x2 -- the pixel order (index x) is normal x1 = x2 = self.image.width() x1 *= (xMap.s1() - self.xMap.s1()) x1 /= (self.xMap.s2() - self.xMap.s1()) x1 = max(0, int(x1-0.5)) x2 *= (xMap.s2() - self.xMap.s1()) x2 /= (self.xMap.s2() - self.xMap.s1()) x2 = min(self.image.width(), int(x2+0.5)) # copy image = self.image.copy(x1, y1, x2-x1, y2-y1) # zoom image = image.scaled(xMap.p2()-xMap.p1()+1, yMap.p1()-yMap.p2()+1) # draw painter.drawImage(xMap.p1(), yMap.p2(), image) # drawImage() # class PlotImage class ImagePlot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) # set plot title self.setTitle('ImagePlot: (un)zoom & (un)hide') # set plot layout self.plotLayout().setMargin(0) self.plotLayout().setCanvasMargin(0) self.plotLayout().setAlignCanvasToScales(True) # set legend legend = Qwt.QwtLegend() legend.setItemMode(Qwt.QwtLegend.ClickableItem) self.insertLegend(legend, Qwt.QwtPlot.RightLegend) # set axis titles self.setAxisTitle(Qwt.QwtPlot.xBottom, 'time (s)') self.setAxisTitle(Qwt.QwtPlot.yLeft, 'frequency (Hz)') # calculate 3 NumPy arrays x = arange(-2*pi, 2*pi, 0.01) y = pi*sin(x) z = 4*pi*cos(x)*cos(x)*sin(x) # attach a curve curve = Qwt.QwtPlotCurve('y = pi*sin(x)') curve.attach(self) curve.setPen(Qt.QPen(Qt.Qt.green, 2)) curve.setData(x, y) # attach another curve curve = Qwt.QwtPlotCurve('y = 4*pi*sin(x)*cos(x)**2') curve.attach(self) curve.setPen(Qt.QPen(Qt.Qt.black, 2)) curve.setData(x, z) # attach a grid grid = Qwt.QwtPlotGrid() grid.attach(self) grid.setPen(Qt.QPen(Qt.Qt.black, 0, Qt.Qt.DotLine)) # attach a horizontal marker at y = 0 marker = Qwt.QwtPlotMarker() marker.attach(self) marker.setValue(0.0, 0.0) marker.setLineStyle(Qwt.QwtPlotMarker.HLine) marker.setLabelAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignTop) marker.setLabel(Qwt.QwtText('y = 0')) # attach a vertical marker at x = pi marker = Qwt.QwtPlotMarker() marker.attach(self) marker.setValue(pi, 0.0) marker.setLineStyle(Qwt.QwtPlotMarker.VLine) marker.setLabelAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignBottom) marker.setLabel(Qwt.QwtText('x = pi')) # attach a plot image plotImage = PlotImage('Image') plotImage.attach(self) plotImage.setData( square(512, -2*pi, 2*pi), (-2*pi, 2*pi), (-2*pi, 2*pi)) self.connect(self, Qt.SIGNAL("legendClicked(QwtPlotItem*)"), self.toggleVisibility) # replot self.replot() self.zoomer = Qwt.QwtPlotZoomer(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.DragSelection, Qwt.QwtPicker.AlwaysOff, self.canvas()) self.zoomer.setRubberBandPen(Qt.QPen(Qt.Qt.green)) # __init__() def toggleVisibility(self, plotItem): """Toggle the visibility of a plot item """ plotItem.setVisible(not plotItem.isVisible()) self.replot() # toggleVisibility() # class Qwt.QwtImagePlot def make(): demo = ImagePlot() demo.resize(600, 400) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/CurveDemo2.py0000555000175000017500000001167110505454217020451 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/curvdemo2 import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * Size=15 USize=13 class CurveDemo(Qt.QFrame): def __init__(self, *args): Qt.QFrame.__init__(self, *args) self.setFrameStyle(Qt.QFrame.Box | Qt.QFrame.Raised) self.setLineWidth(2) self.setMidLineWidth(3) p = Qt.QPalette() p.setColor(self.backgroundRole(), Qt.QColor(30, 30, 50)) self.setPalette(p) # make curves and maps self.tuples = [] # curve 1 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.QColor(150, 150, 200), 2)) curve.setCurveType(Qwt.QwtPlotCurve.Xfy) curve.setStyle(Qwt.QwtPlotCurve.Lines) curveFitter = Qwt.QwtSplineCurveFitter() curveFitter.setSplineSize(150) curve.setCurveFitter(curveFitter) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.XCross, Qt.QBrush(), Qt.QPen(Qt.Qt.yellow, 2), Qt.QSize(7, 7))) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -1.5, 1.5), Qwt.QwtScaleMap(0, 100, 0.0, 2*pi))) # curve 2 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.QColor(200, 150, 50), 1, Qt.Qt.DashDotDotLine)) curve.setStyle(Qwt.QwtPlotCurve.Sticks) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, Qt.QBrush(Qt.Qt.blue), Qt.QPen(Qt.Qt.yellow), Qt.QSize(5, 5))) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, 0.0, 2*pi), Qwt.QwtScaleMap(0, 100, -3.0, 1.1))) # curve 3 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.QColor(100, 200, 150))) curve.setStyle(Qwt.QwtPlotCurve.Lines) curve.setCurveAttribute(Qwt.QwtPlotCurve.Fitted) curveFitter = Qwt.QwtSplineCurveFitter() curveFitter.setFitMode(Qwt.QwtSplineCurveFitter.ParametricSpline) curveFitter.setSplineSize(200) curve.setCurveFitter(curveFitter) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -1.1, 3.0), Qwt.QwtScaleMap(0, 100, -1.1, 3.0))) # curve 4 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.red)) curve.setStyle(Qwt.QwtPlotCurve.Lines) curve.setCurveAttribute(Qwt.QwtPlotCurve.Fitted) curveFitter = Qwt.QwtSplineCurveFitter() curveFitter.setSplineSize(200) curve.setCurveFitter(curveFitter) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -5.0, 1.1), Qwt.QwtScaleMap(0, 100, -1.1, 5.0))) # data self.phase = 0.0 self.base = arange(0.0, 2.01*pi, 2*pi/(USize-1)) self.uval = cos(self.base) self.vval = sin(self.base) self.uval[1::2] *= 0.5 self.vval[1::2] *= 0.5 self.newValues() # start timer self.tid = self.startTimer(250) # __init__() def paintEvent(self, event): Qt.QFrame.paintEvent(self,event) painter = Qt.QPainter(self) #painter.setRenderHint(Qt.QPainter.Antialiasing) painter.setClipRect(self.contentsRect()) self.drawContents(painter) # paintEvent() def drawContents(self, painter): r = self.contentsRect() for curve, xMap, yMap in self.tuples: xMap.setPaintInterval(r.left(), r.right()) yMap.setPaintInterval(r.top(), r.bottom()) curve.draw(painter, xMap, yMap, r) # drawContents() def timerEvent(self, event): self.newValues() self.repaint() def newValues(self): phase = self.phase self.xval = arange(0, 2.01*pi, 2*pi/(Size-1)) self.yval = sin(self.xval - phase) self.zval = cos(3*(self.xval + phase)) s = 0.25 * sin(phase) c = sqrt(1.0 - s*s) u = self.uval self.uval = c*self.uval-s*self.vval self.vval = c*self.vval+s*u self.tuples[0][0].setData(self.yval, self.xval) self.tuples[1][0].setData(self.xval, self.zval) self.tuples[2][0].setData(self.yval, self.zval) self.tuples[3][0].setData(self.uval, self.vval) self.phase += 2*pi/100 if self.phase>2*pi: self.phase = 0.0 def make(): demo = CurveDemo() demo.resize(300, 300) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/MapDemo.py0000555000175000017500000001222311207673326020016 0ustar poxpox#!/usr/bin/env python import random import sys import time try: import resource has_resource = 1 except ImportError: has_resource = 0 from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * def standard_map(x, y, kappa): """provide one interate of the inital conditions (x, y) for the standard map with parameter kappa. """ y_new = y-kappa*sin(2.0*pi*x) x_new = x+y_new # bring back to [0,1.0]^2 if( (x_new>1.0) or (x_new<0.0) ): x_new = x_new - floor(x_new) if( (y_new>1.0) or (y_new<0.0) ): y_new = y_new - floor(y_new) return x_new, y_new # standard_map class MapDemo(Qt.QMainWindow): def __init__(self, *args): Qt.QMainWindow.__init__(self, *args) self.plot = Qwt.QwtPlot(self) self.plot.setTitle("A Simple Map Demonstration") self.plot.setCanvasBackground(Qt.Qt.white) self.plot.setAxisTitle(Qwt.QwtPlot.xBottom, "x") self.plot.setAxisTitle(Qwt.QwtPlot.yLeft, "y") self.plot.setAxisScale(Qwt.QwtPlot.xBottom, 0.0, 1.0) self.plot.setAxisScale(Qwt.QwtPlot.yLeft, 0.0, 1.0) self.setCentralWidget(self.plot) # Initialize map data self.count = self.i = 1000 self.xs = zeros(self.count, Float) self.ys = zeros(self.count, Float) self.kappa = 0.2 self.curve = Qwt.QwtPlotCurve("Map") self.curve.attach(self.plot) self.curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, Qt.QBrush(Qt.Qt.red), Qt.QPen(Qt.Qt.blue), Qt.QSize(5, 5))) self.curve.setPen(Qt.QPen(Qt.Qt.cyan)) toolBar = Qt.QToolBar(self) self.addToolBar(toolBar) toolBar.addWidget(Qt.QLabel("Count:", toolBar)) sizeCounter = Qwt.QwtCounter(toolBar) toolBar.addWidget(sizeCounter) toolBar.addSeparator() sizeCounter.setRange(0, 1000000, 100) sizeCounter.setValue(self.count) sizeCounter.setNumButtons(3) self.connect( sizeCounter, Qt.SIGNAL('valueChanged(double)'), self.setCount) toolBar.addWidget(Qt.QLabel("Ticks (ms):", toolBar)) tickCounter = Qwt.QwtCounter(toolBar) toolBar.addWidget(tickCounter) toolBar.addSeparator() # 1 tick = 1 ms, 10 ticks = 10 ms (Linux clock is 100 Hz) self.ticks = 10 tickCounter.setRange(0, 1000, 1) tickCounter.setValue(self.ticks) tickCounter.setNumButtons(3) self.connect( tickCounter, Qt.SIGNAL('valueChanged(double)'), self.setTicks) self.tid = self.startTimer(self.ticks) self.timer_tic = None self.user_tic = None self.system_tic = None self.plot.replot() # __init__() def setCount(self, count): self.count = self.i = count self.xs = zeros(self.count, Float) self.ys = zeros(self.count, Float) self.i = self.count self.killTimer(self.tid) self.tid = self.startTimer(self.ticks) # setCount() def setTicks(self, ticks): self.i = self.count self.ticks = int(ticks) self.killTimer(self.tid) self.tid = self.startTimer(ticks) # setTicks() def resizeEvent(self, event): self.plot.resize(event.size()) self.plot.move(0, 0) # resizeEvent() def moreData(self): if self.i == self.count: self.i = 0 self.x = random.random() self.y = random.random() self.xs[self.i] = self.x self.ys[self.i] = self.y self.i += 1 if has_resource: self.user_toc, self.system_toc = resource.getrusage( resource.RUSAGE_SELF)[:2] if self.user_tic: print "user: %s s;" % (self.user_toc-self.user_tic), self.user_tic = self.user_toc if self.system_tic: print "system: %s s;" % (self.system_toc-self.system_tic), self.system_tic = self.system_toc self.timer_toc = time.time() if self.timer_tic: print "wall: %s s." % (self.timer_toc-self.timer_tic) self.timer_tic = self.timer_toc else: self.x, self.y = standard_map(self.x, self.y, self.kappa) self.xs[self.i] = self.x self.ys[self.i] = self.y self.i += 1 # moreData() def timerEvent(self, e): self.moreData() self.curve.setData(self.xs[:self.i], self.ys[:self.i]) self.plot.replot() # timerEvent() # class MapDemo def make(): demo = MapDemo() demo.resize(600, 600) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': if 'settracemask' in sys.argv: # for debugging, requires: python configure.py --trace ... import sip sip.settracemask(0x3f) main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/SpectrogramDemo.py0000555000175000017500000001144711207673326021576 0ustar poxpox#!/usr/bin/env python # The Python version of Qwt-5.0.0/examples/spectrogram import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt class SpectrogramData(Qwt.QwtRasterData): def __init__(self): Qwt.QwtRasterData.__init__(self, Qt.QRectF(-1.5, -1.5, 3.0, 3.0)) # __init__() def copy(self): return self # copy() def range(self): return Qwt.QwtDoubleInterval(0.0, 10.0); # range() def value(self, x, y): c = 0.842; v1 = x * x + (y-c) * (y+c); v2 = x * (y+c) + x * (y+c); return 1.0 / (v1 * v1 + v2 * v2); # value() # class SpectrogramData() class Plot(Qwt.QwtPlot): def __init__(self, parent = None): Qwt.QwtPlot.__init__(self, parent) self.__spectrogram = Qwt.QwtPlotSpectrogram() colorMap = Qwt.QwtLinearColorMap(Qt.Qt.darkCyan, Qt.Qt.red) colorMap.addColorStop(0.1, Qt.Qt.cyan) colorMap.addColorStop(0.6, Qt.Qt.green) colorMap.addColorStop(0.95, Qt.Qt.yellow) self.__spectrogram.setColorMap(colorMap) self.__spectrogram.setData(SpectrogramData()) self.__spectrogram.attach(self) self.__spectrogram.setContourLevels( [0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5]) rightAxis = self.axisWidget(Qwt.QwtPlot.yRight) rightAxis.setTitle("Intensity") rightAxis.setColorBarEnabled(True) rightAxis.setColorMap(self.__spectrogram.data().range(), self.__spectrogram.colorMap()) self.setAxisScale(Qwt.QwtPlot.yRight, self.__spectrogram.data().range().minValue(), self.__spectrogram.data().range().maxValue()) self.enableAxis(Qwt.QwtPlot.yRight) self.plotLayout().setAlignCanvasToScales(True) self.replot() # LeftButton for the zooming # MidButton for the panning # RightButton: zoom out by 1 # Ctrl+RighButton: zoom out to full size zoomer = Qwt.QwtPlotZoomer(self.canvas()) zoomer.setMousePattern(Qwt.QwtEventPattern.MouseSelect2, Qt.Qt.RightButton, Qt.Qt.ControlModifier) zoomer.setMousePattern(Qwt.QwtEventPattern.MouseSelect3, Qt.Qt.RightButton) zoomer.setRubberBandPen(Qt.Qt.darkBlue) zoomer.setTrackerPen(Qt.Qt.darkBlue) panner = Qwt.QwtPlotPanner(self.canvas()) panner.setAxisEnabled(Qwt.QwtPlot.yRight, False) panner.setMouseButton(Qt.Qt.MidButton) # Avoid jumping when labels with more/less digits # appear/disappear when scrolling vertically fm = Qt.QFontMetrics(self.axisWidget(Qwt.QwtPlot.yLeft).font()) self.axisScaleDraw( Qwt.QwtPlot.yLeft).setMinimumExtent(fm.width("100.00")) # __init__() def showContour(self, on): self.__spectrogram.setDisplayMode( Qwt.QwtPlotSpectrogram.ContourMode, on) self.replot() # showContour() def showSpectrogram(self, on): self.__spectrogram.setDisplayMode(Qwt.QwtPlotSpectrogram.ImageMode, on) if on: pen = Qt.QPen() else: pen = Qt.QPen(Qt.Qt.NoPen) self.__spectrogram.setDefaultContourPen(pen) self.replot(); # showSpectrogram() # class Plot() class MainWindow(Qt.QMainWindow): def __init__(self, parent=None): Qt.QMainWindow.__init__(self, parent) plot = Plot() self.setCentralWidget(plot) toolBar = Qt.QToolBar(self) btnSpectrogram = Qt.QToolButton(toolBar) btnContour = Qt.QToolButton(toolBar) btnSpectrogram.setText("Spectrogram") btnSpectrogram.setCheckable(True) btnSpectrogram.setToolButtonStyle(Qt.Qt.ToolButtonTextUnderIcon) toolBar.addWidget(btnSpectrogram) btnContour.setText("Contour"); btnContour.setCheckable(True) btnContour.setToolButtonStyle(Qt.Qt.ToolButtonTextUnderIcon) toolBar.addWidget(btnContour) self.addToolBar(toolBar) self.connect(btnSpectrogram, Qt.SIGNAL('toggled(bool)'), plot.showSpectrogram) self.connect(btnContour, Qt.SIGNAL('toggled(bool)'), plot.showContour) btnSpectrogram.setChecked(True) btnContour.setChecked(False) # __init__() # MainWindow() def make(): demo = MainWindow() demo.resize(600, 400) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire if __name__ == '__main__': if 'settracemask' in sys.argv: # for debugging, requires: python configure.py --trace ... import sip sip.settracemask(0x3f) main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/CurveDemo3.py0000555000175000017500000001552310505454742020455 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/curvdemo2 # with a ConfigDialog contributed by Hans-Peter Jansen. import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * Size=15 USize=13 class ConfigDiag(Qt.QDialog): def __init__(self, parent = None): Qt.QDialog.__init__(self, parent) formLayout = Qt.QGridLayout() self.setLayout(formLayout) speedLayout = Qt.QHBoxLayout() speedLabel = Qt.QLabel("Timer [s]") speedLayout.addWidget(speedLabel) speedCounter = Qwt.QwtCounter() speedCounter.setRange(0.002, 1.0, 0.001) speedLayout.addWidget(speedCounter) formLayout.addLayout(speedLayout, 0, 0) self.s = speedLayout dismissButton = Qt.QPushButton("Dismiss") formLayout.addWidget(dismissButton, 1, 0) self.speedCounter = speedCounter self.connect(dismissButton, Qt.SIGNAL("clicked()"), self.accept) self.connect(self.speedCounter, Qt.SIGNAL("valueChanged(double)"), self.changeTimerSpeed) # __init__() def setTimerSpeed(self, t): self.speedCounter.setValue(t) # setTimerSpeed() def changeTimerSpeed(self, t): self.emit(Qt.SIGNAL("updateSpeed(double)"), t) # changeTimerSpeed() class CurveDemo(Qt.QFrame): def __init__(self, *args): Qt.QFrame.__init__(self, *args) self.setWindowTitle("Click me to configure me") self.setFrameStyle(Qt.QFrame.Box | Qt.QFrame.Raised) self.setLineWidth(2) self.setMidLineWidth(3) p = Qt.QPalette() p.setColor(self.backgroundRole(), Qt.QColor(30, 30, 50)) self.setPalette(p) # make curves and maps self.tuples = [] # curve 1 curve = Qwt.QwtPlotCurve() curve.setPen( Qt.QPen(Qt.QColor(150, 150, 200), 2)) curve.setCurveType(Qwt.QwtPlotCurve.Xfy) curve.setStyle(Qwt.QwtPlotCurve.Lines) curveFitter = Qwt.QwtSplineCurveFitter() curveFitter.setSplineSize(150) curve.setCurveFitter(curveFitter) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.XCross, Qt.QBrush(), Qt.QPen(Qt.Qt.yellow, 2), Qt.QSize(7, 7))) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -1.5, 1.5), Qwt.QwtScaleMap(0, 100, 0.0, 2*pi))) # curve 2 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.QColor(200, 150, 50), 1, Qt.Qt.DashDotDotLine)) curve.setStyle(Qwt.QwtPlotCurve.Sticks) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, Qt.QBrush(Qt.Qt.blue), Qt.QPen(Qt.Qt.yellow), Qt.QSize(5, 5))) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, 0.0, 2*pi), Qwt.QwtScaleMap(0, 100, -3.0, 1.1))) # curve 3 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.QColor(100, 200, 150))) curve.setStyle(Qwt.QwtPlotCurve.Lines) curve.setCurveAttribute(Qwt.QwtPlotCurve.Fitted) curveFitter = Qwt.QwtSplineCurveFitter() curveFitter.setFitMode(Qwt.QwtSplineCurveFitter.ParametricSpline) curveFitter.setSplineSize(200) curve.setCurveFitter(curveFitter) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -1.1, 3.0), Qwt.QwtScaleMap(0, 100, -1.1, 3.0))) # curve 4 curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.red)) curve.setStyle(Qwt.QwtPlotCurve.Lines) curve.setCurveAttribute(Qwt.QwtPlotCurve.Fitted) curveFitter = Qwt.QwtSplineCurveFitter() curveFitter.setSplineSize(200) curve.setCurveFitter(curveFitter) self.tuples.append((curve, Qwt.QwtScaleMap(0, 100, -5.0, 1.1), Qwt.QwtScaleMap(0, 100, -1.1, 5.0))) # data self.phase = 0.0 self.base = arange(0.0, 2.01*pi, 2*pi/(USize-1)) self.uval = cos(self.base) self.vval = sin(self.base) self.uval[1::2] *= 0.5 self.vval[1::2] *= 0.5 self.newValues() # timer config self.config = ConfigDiag() self.connect(self.config, Qt.SIGNAL('updateSpeed(double)'), self.setTimerSpeed) # start timer self.tid = None self.setTimerSpeed(0.02) self.config.setTimerSpeed(0.02) # __init__() def mousePressEvent(self, e): if not self.config.isVisible(): self.config.show() else: self.config.hide() # mousePressEvent() def setTimerSpeed(self, seconds): if self.tid: self.killTimer(self.tid) self.tid = self.startTimer(int(seconds * 1000.0)) # setTSpeed() def paintEvent(self, event): Qt.QFrame.paintEvent(self,event) painter = Qt.QPainter(self) #painter.setRenderHint(Qt.QPainter.Antialiasing) painter.setClipRect(self.contentsRect()) self.drawContents(painter) # paintEvent() def drawContents(self, painter): r = self.contentsRect() for curve, xMap, yMap in self.tuples: xMap.setPaintInterval(r.left(), r.right()) yMap.setPaintInterval(r.top(), r.bottom()) curve.draw(painter, xMap, yMap, r) # drawContents() def timerEvent(self, event): self.newValues() self.repaint() # timerEvent() def newValues(self): phase = self.phase self.xval = arange(0, 2.01*pi, 2*pi/(Size-1)) self.yval = sin(self.xval - phase) self.zval = cos(3*(self.xval + phase)) s = 0.25 * sin(phase) c = sqrt(1.0 - s*s) u = self.uval self.uval = c*self.uval-s*self.vval self.vval = c*self.vval+s*u self.tuples[0][0].setData(self.yval, self.xval) self.tuples[1][0].setData(self.xval, self.zval) self.tuples[2][0].setData(self.yval, self.zval) self.tuples[3][0].setData(self.uval, self.vval) self.phase += 2*pi/100 if self.phase>2*pi: self.phase = 0.0 # newValues() # class CurveDemo def make(): demo = CurveDemo() demo.resize(300, 300) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/CliDemo.py0000555000175000017500000000054511034403136020000 0ustar poxpox#!/usr/bin/env python from PyQt4.Qt import QApplication from PyQt4.Qwt5.qplt import * def make(): return testPlot(), testIPlot() # make() def main(args): app = QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/CartesianDemo.py0000555000175000017500000000724610720074316021214 0ustar poxpox#!/usr/bin/env python import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * class CartesianAxis(Qwt.QwtPlotItem): """Supports a coordinate system similar to http://en.wikipedia.org/wiki/Image:Cartesian-coordinate-system.svg """ def __init__(self, masterAxis, slaveAxis): """Valid input values for masterAxis and slaveAxis are QwtPlot.yLeft, QwtPlot.yRight, QwtPlot.xBottom, and QwtPlot.xTop. When masterAxis is an x-axis, slaveAxis must be an y-axis; and vice versa. """ Qwt.QwtPlotItem.__init__(self) self.__axis = masterAxis if masterAxis in (Qwt.QwtPlot.yLeft, Qwt.QwtPlot.yRight): self.setAxis(slaveAxis, masterAxis) else: self.setAxis(masterAxis, slaveAxis) self.scaleDraw = Qwt.QwtScaleDraw() self.scaleDraw.setAlignment((Qwt.QwtScaleDraw.LeftScale, Qwt.QwtScaleDraw.RightScale, Qwt.QwtScaleDraw.BottomScale, Qwt.QwtScaleDraw.TopScale)[masterAxis]) # __init__() def draw(self, painter, xMap, yMap, rect): """Draw an axis on the plot canvas """ if self.__axis in (Qwt.QwtPlot.yLeft, Qwt.QwtPlot.yRight): self.scaleDraw.move(round(xMap.xTransform(0.0)), yMap.p2()) self.scaleDraw.setLength(yMap.p1()-yMap.p2()) elif self.__axis in (Qwt.QwtPlot.xBottom, Qwt.QwtPlot.xTop): self.scaleDraw.move(xMap.p1(), round(yMap.xTransform(0.0))) self.scaleDraw.setLength(xMap.p2()-xMap.p1()) self.scaleDraw.setScaleDiv(self.plot().axisScaleDiv(self.__axis)) self.scaleDraw.draw(painter, self.plot().palette()) # draw() # class CartesianAxis class CartesianPlot(Qwt.QwtPlot): """Creates a coordinate system similar system http://en.wikipedia.org/wiki/Image:Cartesian-coordinate-system.svg """ def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) self.setTitle('Cartesian Coordinate System Demo') # create a plot with a white canvas self.setCanvasBackground(Qt.Qt.white) # set plot layout self.plotLayout().setMargin(0) self.plotLayout().setCanvasMargin(0) self.plotLayout().setAlignCanvasToScales(True) # attach a grid grid = Qwt.QwtPlotGrid() grid.attach(self) grid.setPen(Qt.QPen(Qt.Qt.black, 0, Qt.Qt.DotLine)) # attach a x-axis xaxis = CartesianAxis(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft) xaxis.attach(self) self.enableAxis(Qwt.QwtPlot.xBottom, False) # attach a y-axis yaxis = CartesianAxis(Qwt.QwtPlot.yLeft, Qwt.QwtPlot.xBottom) yaxis.attach(self) self.enableAxis(Qwt.QwtPlot.yLeft, False) # calculate 3 NumPy arrays x = arange(-2*pi, 2*pi, 0.01) y = pi*sin(x) z = 4*pi*cos(x)*cos(x)*sin(x) # attach a curve curve = Qwt.QwtPlotCurve('y = pi*sin(x)') curve.attach(self) curve.setPen(Qt.QPen(Qt.Qt.green, 2)) curve.setData(x, y) # attach another curve curve = Qwt.QwtPlotCurve('y = 4*pi*sin(x)*cos(x)**2') curve.attach(self) curve.setPen(Qt.QPen(Qt.Qt.black, 2)) curve.setData(x, z) self.replot() # __init__() # class CartesianPlot def make(): demo = CartesianPlot() demo.resize(400, 300) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/HistogramDemo.py0000555000175000017500000001640110646203153021231 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-5.0/examples/histogram import random import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt class HistogramItem(Qwt.QwtPlotItem): Auto = 0 Xfy = 1 def __init__(self, *args): Qwt.QwtPlotItem.__init__(self, *args) self.__attributes = HistogramItem.Auto self.__data = Qwt.QwtIntervalData() self.__color = Qt.QColor() self.__reference = 0.0 self.setItemAttribute(Qwt.QwtPlotItem.AutoScale, True) self.setItemAttribute(Qwt.QwtPlotItem.Legend, True) self.setZ(20.0) # __init__() def setData(self, data): self.__data = data self.itemChanged() # setData() def data(self): return self.__data # data() def setColor(self, color): if self.__color != color: self.__color = color self.itemChanged() # setColor() def color(self): return self.__color # color() def boundingRect(self): result = self.__data.boundingRect() if not result.isvalid(): return result if self.testHistogramAttribute(HistogramItem.Xfy): result = Qwt.QwtDoubleRect(result.y(), result.x(), result.height(), result.width()) if result.left() > self.baseline(): result.setLeft(self.baseline()) elif result.right() < self.baseline(): result.setRight(self.baseline()) else: if result.bottom() < self.baseline(): result.setBottom(self.baseline()) elif result.top() > self.baseline(): result.setTop(self.baseline()) return result # boundingRect() def rtti(self): return Qwt.QwtPlotItem.PlotHistogram # rtti() def draw(self, painter, xMap, yMap, rect): iData = self.data() painter.setPen(self.color()) x0 = xMap.transform(self.baseline()) y0 = yMap.transform(self.baseline()) for i in range(iData.size()): if self.testHistogramAttribute(HistogramItem.Xfy): x2 = xMap.transform(iData.value(i)) if x2 == x0: continue y1 = yMap.transform(iData.interval(i).minValue()) y2 = yMap.transform(iData.interval(i).maxValue()) if y1 > y2: y1, y2 = y2, y1 if i < iData.size()-2: yy1 = yMap.transform(iData.interval(i+1).minValue()) yy2 = yMap.transform(iData.interval(i+1).maxValue()) if y2 == min(yy1, yy2): xx2 = xMap.transform(iData.interval(i+1).minValue()) if xx2 != x0 and ((xx2 < x0 and x2 < x0) or (xx2 > x0 and x2 > x0)): # One pixel distance between neighboured bars y2 += 1 self.drawBar( painter, Qt.Qt.Horizontal, Qt.QRect(x0, y1, x2-x0, y2-y1)) else: y2 = yMap.transform(iData.value(i)) if y2 == y0: continue x1 = xMap.transform(iData.interval(i).minValue()) x2 = xMap.transform(iData.interval(i).maxValue()) if x1 > x2: x1, x2 = x2, x1 if i < iData.size()-2: xx1 = xMap.transform(iData.interval(i+1).minValue()) xx2 = xMap.transform(iData.interval(i+1).maxValue()) x2 = min(xx1, xx2) yy2 = yMap.transform(iData.value(i+1)) if x2 == min(xx1, xx2): if yy2 != 0 and (( yy2 < y0 and y2 < y0) or (yy2 > y0 and y2 > y0)): # One pixel distance between neighboured bars x2 -= 1 self.drawBar( painter, Qt.Qt.Vertical, Qt.QRect(x1, y0, x2-x1, y2-y0)) # draw() def setBaseline(self, reference): if self.baseline() != reference: self.__reference = reference self.itemChanged() # setBaseLine() def baseline(self,): return self.__reference # baseline() def setHistogramAttribute(self, attribute, on = True): if self.testHistogramAttribute(attribute): return if on: self.__attributes |= attribute else: self.__attributes &= ~attribute self.itemChanged() # setHistogramAttribute() def testHistogramAttribute(self, attribute): return bool(self.__attributes & attribute) # testHistogramAttribute() def drawBar(self, painter, orientation, rect): painter.save() color = painter.pen().color() r = rect.normalized() factor = 125; light = color.light(factor) dark = color.dark(factor) painter.setBrush(color) painter.setPen(Qt.Qt.NoPen) Qwt.QwtPainter.drawRect(painter, r.x()+1, r.y()+1, r.width()-2, r.height()-2) painter.setBrush(Qt.Qt.NoBrush) painter.setPen(Qt.QPen(light, 2)) Qwt.QwtPainter.drawLine( painter, r.left()+1, r.top()+2, r.right()+1, r.top()+2) painter.setPen(Qt.QPen(dark, 2)) Qwt.QwtPainter.drawLine( painter, r.left()+1, r.bottom(), r.right()+1, r.bottom()) painter.setPen(Qt.QPen(light, 1)) Qwt.QwtPainter.drawLine( painter, r.left(), r.top() + 1, r.left(), r.bottom()) Qwt.QwtPainter.drawLine( painter, r.left()+1, r.top()+2, r.left()+1, r.bottom()-1) painter.setPen(Qt.QPen(dark, 1)) Qwt.QwtPainter.drawLine( painter, r.right()+1, r.top()+1, r.right()+1, r.bottom()) Qwt.QwtPainter.drawLine( painter, r.right(), r.top()+2, r.right(), r.bottom()-1) painter.restore() # drawBar() # class HistogramItem def make(): demo = Qwt.QwtPlot() demo.setCanvasBackground(Qt.Qt.white) demo.setTitle("Histogram") grid = Qwt.QwtPlotGrid() grid.enableXMin(True) grid.enableYMin(True) grid.setMajPen(Qt.QPen(Qt.Qt.black, 0, Qt.Qt.DotLine)); grid.setMinPen(Qt.QPen(Qt.Qt.gray, 0 , Qt.Qt.DotLine)); grid.attach(demo) histogram = HistogramItem() histogram.setColor(Qt.Qt.darkCyan) numValues = 20 intervals = [] values = Qwt.QwtArrayDouble(numValues) pos = 0.0 for i in range(numValues): width = 5 + random.randint(0, 4) value = random.randint(0, 99) intervals.append(Qwt.QwtDoubleInterval(pos, pos+width)); values[i] = value pos += width histogram.setData(Qwt.QwtIntervalData(intervals, values)) histogram.attach(demo) demo.setAxisScale(Qwt.QwtPlot.yLeft, 0.0, 100.0) demo.setAxisScale(Qwt.QwtPlot.xBottom, 0.0, pos) demo.replot() demo.resize(600, 400) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/CPUplot.py0000555000175000017500000003215610434023557020025 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/cpuplot import os import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * #-- cpustat.cpp --# class CpuStat: User = 0 Nice = 1 System = 2 Idle = 3 counter = 0 dummyValues = ( ( 103726, 0, 23484, 819556 ), ( 103783, 0, 23489, 819604 ), ( 103798, 0, 23490, 819688 ), ( 103820, 0, 23490, 819766 ), ( 103840, 0, 23493, 819843 ), ( 103875, 0, 23499, 819902 ), ( 103917, 0, 23504, 819955 ), ( 103950, 0, 23508, 820018 ), ( 103987, 0, 23510, 820079 ), ( 104020, 0, 23513, 820143 ), ( 104058, 0, 23514, 820204 ), ( 104099, 0, 23520, 820257 ), ( 104121, 0, 23525, 820330 ), ( 104159, 0, 23530, 820387 ), ( 104176, 0, 23534, 820466 ), ( 104215, 0, 23538, 820523 ), ( 104245, 0, 23541, 820590 ), ( 104267, 0, 23545, 820664 ), ( 104311, 0, 23555, 820710 ), ( 104355, 0, 23565, 820756 ), ( 104367, 0, 23567, 820842 ), ( 104383, 0, 23572, 820921 ), ( 104396, 0, 23577, 821003 ), ( 104413, 0, 23579, 821084 ), ( 104446, 0, 23588, 821142 ), ( 104521, 0, 23594, 821161 ), ( 104611, 0, 23604, 821161 ), ( 104708, 0, 23607, 821161 ), ( 104804, 0, 23611, 821161 ), ( 104895, 0, 23620, 821161 ), ( 104993, 0, 23622, 821161 ), ( 105089, 0, 23626, 821161 ), ( 105185, 0, 23630, 821161 ), ( 105281, 0, 23634, 821161 ), ( 105379, 0, 23636, 821161 ), ( 105472, 0, 23643, 821161 ), ( 105569, 0, 23646, 821161 ), ( 105666, 0, 23649, 821161 ), ( 105763, 0, 23652, 821161 ), ( 105828, 0, 23661, 821187 ), ( 105904, 0, 23666, 821206 ), ( 105999, 0, 23671, 821206 ), ( 106094, 0, 23676, 821206 ), ( 106184, 0, 23686, 821206 ), ( 106273, 0, 23692, 821211 ), ( 106306, 0, 23700, 821270 ), ( 106341, 0, 23703, 821332 ), ( 106392, 0, 23709, 821375 ), ( 106423, 0, 23715, 821438 ), ( 106472, 0, 23721, 821483 ), ( 106531, 0, 23727, 821517 ), ( 106562, 0, 23732, 821582 ), ( 106597, 0, 23736, 821643 ), ( 106633, 0, 23737, 821706 ), ( 106666, 0, 23742, 821768 ), ( 106697, 0, 23744, 821835 ), ( 106730, 0, 23748, 821898 ), ( 106765, 0, 23751, 821960 ), ( 106799, 0, 23754, 822023 ), ( 106831, 0, 23758, 822087 ), ( 106862, 0, 23761, 822153 ), ( 106899, 0, 23763, 822214 ), ( 106932, 0, 23766, 822278 ), ( 106965, 0, 23768, 822343 ), ( 107009, 0, 23771, 822396 ), ( 107040, 0, 23775, 822461 ), ( 107092, 0, 23780, 822504 ), ( 107143, 0, 23787, 822546 ), ( 107200, 0, 23795, 822581 ), ( 107250, 0, 23803, 822623 ), ( 107277, 0, 23810, 822689 ), ( 107286, 0, 23810, 822780 ), ( 107313, 0, 23817, 822846 ), ( 107325, 0, 23818, 822933 ), ( 107332, 0, 23818, 823026 ), ( 107344, 0, 23821, 823111 ), ( 107357, 0, 23821, 823198 ), ( 107368, 0, 23823, 823284 ), ( 107375, 0, 23824, 823377 ), ( 107386, 0, 23825, 823465 ), ( 107396, 0, 23826, 823554 ), ( 107422, 0, 23830, 823624 ), ( 107434, 0, 23831, 823711 ), ( 107456, 0, 23835, 823785 ), ( 107468, 0, 23838, 823870 ), ( 107487, 0, 23840, 823949 ), ( 107515, 0, 23843, 824018 ), ( 107528, 0, 23846, 824102 ), ( 107535, 0, 23851, 824190 ), ( 107548, 0, 23853, 824275 ), ( 107562, 0, 23857, 824357 ), ( 107656, 0, 23863, 824357 ), ( 107751, 0, 23868, 824357 ), ( 107849, 0, 23870, 824357 ), ( 107944, 0, 23875, 824357 ), ( 108043, 0, 23876, 824357 ), ( 108137, 0, 23882, 824357 ), ( 108230, 0, 23889, 824357 ), ( 108317, 0, 23902, 824357 ), ( 108412, 0, 23907, 824357 ), ( 108511, 0, 23908, 824357 ), ( 108608, 0, 23911, 824357 ), ( 108704, 0, 23915, 824357 ), ( 108801, 0, 23918, 824357 ), ( 108891, 0, 23928, 824357 ), ( 108987, 0, 23932, 824357 ), ( 109072, 0, 23943, 824361 ), ( 109079, 0, 23943, 824454 ), ( 109086, 0, 23944, 824546 ), ( 109098, 0, 23950, 824628 ), ( 109108, 0, 23955, 824713 ), ( 109115, 0, 23957, 824804 ), ( 109122, 0, 23958, 824896 ), ( 109132, 0, 23959, 824985 ), ( 109142, 0, 23961, 825073 ), ( 109146, 0, 23962, 825168 ), ( 109153, 0, 23964, 825259 ), ( 109162, 0, 23966, 825348 ), ( 109168, 0, 23969, 825439 ), ( 109176, 0, 23971, 825529 ), ( 109185, 0, 23974, 825617 ), ( 109193, 0, 23977, 825706 ), ( 109198, 0, 23978, 825800 ), ( 109206, 0, 23978, 825892 ), ( 109212, 0, 23981, 825983 ), ( 109219, 0, 23981, 826076 ), ( 109225, 0, 23981, 826170 ), ( 109232, 0, 23984, 826260 ), ( 109242, 0, 23984, 826350 ), ( 109255, 0, 23986, 826435 ), ( 109268, 0, 23987, 826521 ), ( 109283, 0, 23990, 826603 ), ( 109288, 0, 23991, 826697 ), ( 109295, 0, 23993, 826788 ), ( 109308, 0, 23994, 826874 ), ( 109322, 0, 24009, 826945 ), ( 109328, 0, 24011, 827037 ), ( 109338, 0, 24012, 827126 ), ( 109347, 0, 24012, 827217 ), ( 109354, 0, 24017, 827305 ), ( 109367, 0, 24017, 827392 ), ( 109371, 0, 24019, 827486 ), ) def __init__(self): self.procValues = self.__lookup() # __init__() def statistic(self): values = self.__lookup() userDelta = 0.0 for i in [CpuStat.User, CpuStat.Nice]: userDelta += (values[i] - self.procValues[i]) systemDelta = values[CpuStat.System] - self.procValues[CpuStat.System] totalDelta = 0.0 for i in range(len(self.procValues)): totalDelta += (values[i] - self.procValues[i]) self.procValues = values return 100.0*userDelta/totalDelta, 100.0*systemDelta/totalDelta # statistics() def upTime(self): result = Qt.QTime() for item in self.procValues: result = result.addSecs(item/100) return result # upTime() def __lookup(self): if os.path.exists("/proc/stat"): for line in open("/proc/stat"): words = line.split() if words[0] == "cpu" and len(words) >= 5: return map(float, words[1:]) else: result = CpuStat.dummyValues[CpuStat.counter] CpuStat.counter += 1 CpuStat.counter %= len(CpuStat.dummyValues) return result # __lookup # class CpuStat #-- cpupiemarker.cpp --# class CpuPieMarker(Qwt.QwtPlotMarker): def __init__(self, *args): Qwt.QwtPlotMarker.__init__(self, *args) self.setZ(1000.0) self.setRenderHint(Qwt.QwtPlotItem.RenderAntialiased, True) # __init__() def rtti(self): return Qwt.QwtPlotItem.Rtti_PlotUserItem # rtti() def draw(self, painter, xMap, yMap, rect): margin = 5 pieRect = Qt.QRect() pieRect.setX(rect.x() + margin) pieRect.setY(rect.y() + margin) pieRect.setHeight(yMap.transform(80.0)) pieRect.setWidth(pieRect.height()) angle = 3*5760/4 for key in ["User", "System", "Idle"]: curve = self.plot().cpuPlotCurve(key) if curve.dataSize(): value = int(5760*curve.y(0)/100.0) painter.save() painter.setBrush(Qt.QBrush(curve.pen().color(), Qt.Qt.SolidPattern)) painter.drawPie(pieRect, -angle, -value) painter.restore() angle += value # draw() # class CpuPieMarker #-- cpuplot.cpp --# class TimeScaleDraw(Qwt.QwtScaleDraw): def __init__(self, baseTime, *args): Qwt.QwtScaleDraw.__init__(self, *args) self.baseTime = baseTime # __init__() def label(self, value): upTime = self.baseTime.addSecs(int(value)) return Qwt.QwtText(upTime.toString()) # label() # class TimeScaleDraw class Background(Qwt.QwtPlotItem): def __init__(self): Qwt.QwtPlotItem.__init__(self) self.setZ(0.0) # __init__() def rtti(self): return Qwt.QwtPlotItem.Rtti_PlotUserItem # rtti() def draw(self, painter, xMap, yMap, rect): c = Qt.QColor(Qt.Qt.white) r = Qt.QRect(rect) for i in range(100, 0, -10): r.setBottom(yMap.transform(i - 10)) r.setTop(yMap.transform(i)) painter.fillRect(r, c) c = c.dark(110) # draw() # class Background class CpuCurve(Qwt.QwtPlotCurve): def __init__(self, *args): Qwt.QwtPlotCurve.__init__(self, *args) self.setRenderHint(Qwt.QwtPlotItem.RenderAntialiased) # __init__() def setColor(self, color): c = Qt.QColor(color) c.setAlpha(150) self.setPen(c) self.setBrush(c) # setColor() # class CpuCurve HISTORY = 60 class CpuPlot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) self.curves = {} self.data = {} self.timeData = 1.0 * arange(HISTORY-1, -1, -1) self.cpuStat = CpuStat() self.setAutoReplot(False) self.plotLayout().setAlignCanvasToScales(True) legend = Qwt.QwtLegend() legend.setItemMode(Qwt.QwtLegend.CheckableItem) self.insertLegend(legend, Qwt.QwtPlot.RightLegend) self.setAxisTitle(Qwt.QwtPlot.xBottom, "System Uptime [h:m:s]") self.setAxisScaleDraw( Qwt.QwtPlot.xBottom, TimeScaleDraw(self.cpuStat.upTime())) self.setAxisScale(Qwt.QwtPlot.xBottom, 0, HISTORY) self.setAxisLabelRotation(Qwt.QwtPlot.xBottom, -50.0) self.setAxisLabelAlignment( Qwt.QwtPlot.xBottom, Qt.Qt.AlignLeft | Qt.Qt.AlignBottom) self.setAxisTitle(Qwt.QwtPlot.yLeft, "Cpu Usage [%]") self.setAxisScale(Qwt.QwtPlot.yLeft, 0, 100) background = Background() background.attach(self) pie = CpuPieMarker() pie.attach(self) curve = CpuCurve('System') curve.setColor(Qt.Qt.red) curve.attach(self) self.curves['System'] = curve self.data['System'] = zeros(HISTORY, Float) curve = CpuCurve('User') curve.setColor(Qt.Qt.blue) curve.setZ(curve.z() - 1.0) curve.attach(self) self.curves['User'] = curve self.data['User'] = zeros(HISTORY, Float) curve = CpuCurve('Total') curve.setColor(Qt.Qt.black) curve.setZ(curve.z() - 2.0) curve.attach(self) self.curves['Total'] = curve self.data['Total'] = zeros(HISTORY, Float) curve = CpuCurve('Idle') curve.setColor(Qt.Qt.darkCyan) curve.setZ(curve.z() - 3.0) curve.attach(self) self.curves['Idle'] = curve self.data['Idle'] = zeros(HISTORY, Float) self.showCurve(self.curves['System'], True) self.showCurve(self.curves['User'], True) self.showCurve(self.curves['Total'], False) self.showCurve(self.curves['Idle'], False) self.startTimer(1000) self.connect(self, Qt.SIGNAL('legendChecked(QwtPlotItem*, bool)'), self.showCurve) self.replot() # __init__() def timerEvent(self, e): for data in self.data.itervalues(): data[1:] = data[0:-1] self.data["User"][0], self.data["System"][0] = self.cpuStat.statistic() self.data["Total"][0] = self.data["User"][0] + self.data["System"][0] self.data["Idle"][0] = 100.0 - self.data["Total"][0] self.timeData += 1.0 self.setAxisScale( Qwt.QwtPlot.xBottom, self.timeData[-1], self.timeData[0]) for key in self.curves.keys(): self.curves[key].setData(self.timeData, self.data[key]) self.replot() # timerEvent() def showCurve(self, item, on): item.setVisible(on) widget = self.legend().find(item) if isinstance(widget, Qwt.QwtLegendItem): widget.setChecked(on) self.replot() # showCurve() def cpuPlotCurve(self, key): return self.curves[key] # cpuPlotCurve() # class CpuPlot def make(): demo = Qt.QWidget() demo.setWindowTitle('Cpu Plot') plot = CpuPlot(demo) plot.setTitle("History") plot.setMargin(5) label = Qt.QLabel("Press the legend to en/disable a curve", demo) layout = Qt.QVBoxLayout(demo) layout.addWidget(plot) layout.addWidget(label) demo.resize(600, 400) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/py2html.py0000555000175000017500000000277510434023557020102 0ustar poxpox#!/usr/bin/env python # This is a trimmed down version of Marc-Andre Lemburg's py2html.py. # The original code can be found at http://starship.python.net/~lemburg/. # # Borrow (or steal?) PyFontify.py from reportlab.lib. import PyFontify import sys pattern=""" %(source)s
%(target)s
""" formats = { 'comment': "%s", 'identifier': "%s", 'keyword': "%s", 'string': "%s" } def escape_html(text): t = (('&','&'), ('<','<'), ('>','>')) for x,y in t: text = y.join(text.split(x)) return text def py2html(source): f = open(source) text = f.read() f.close() tags = PyFontify.fontify(text) done = 0 chunks = [] for tag, start, end, sublist in tags: chunks.append(escape_html(text[done:start])) chunks.append(formats[tag] % escape_html(text[start:end])) done = end chunks.append(escape_html(text[done:])) dict = { 'source' : source, 'target' : ''.join(chunks) } f = open(source + '.html', 'w') f.write(pattern % dict) f.close() if __name__ == '__main__': if len(sys.argv) == 1: print "Usage: ./py2html.py files" print "\tfiles is a list of Python source files." sys.exit(1) for file in sys.argv[1:]: py2html(file) pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/ErrorBarDemo.py0000555000175000017500000002432311207673326021023 0ustar poxpox#!/usr/bin/env python import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * class ErrorBarPlotCurve(Qwt.QwtPlotCurve): def __init__(self, x = [], y = [], dx = None, dy = None, curvePen = Qt.QPen(Qt.Qt.NoPen), curveStyle = Qwt.QwtPlotCurve.Lines, curveSymbol = Qwt.QwtSymbol(), errorPen = Qt.QPen(Qt.Qt.NoPen), errorCap = 0, errorOnTop = False, ): """A curve of x versus y data with error bars in dx and dy. Horizontal error bars are plotted if dx is not None. Vertical error bars are plotted if dy is not None. x and y must be sequences with a shape (N,) and dx and dy must be sequences (if not None) with a shape (), (N,), or (2, N): - if dx or dy has a shape () or (N,), the error bars are given by (x-dx, x+dx) or (y-dy, y+dy), - if dx or dy has a shape (2, N), the error bars are given by (x-dx[0], x+dx[1]) or (y-dy[0], y+dy[1]). curvePen is the pen used to plot the curve curveStyle is the style used to plot the curve curveSymbol is the symbol used to plot the symbols errorPen is the pen used to plot the error bars errorCap is the size of the error bar caps errorOnTop is a boolean: - if True, plot the error bars on top of the curve, - if False, plot the curve on top of the error bars. """ Qwt.QwtPlotCurve.__init__(self) self.setData(x, y, dx, dy) self.setPen(curvePen) self.setStyle(curveStyle) self.setSymbol(curveSymbol) self.errorPen = errorPen self.errorCap = errorCap self.errorOnTop = errorOnTop # __init__() def setData(self, x, y, dx = None, dy = None): """Set x versus y data with error bars in dx and dy. Horizontal error bars are plotted if dx is not None. Vertical error bars are plotted if dy is not None. x and y must be sequences with a shape (N,) and dx and dy must be sequences (if not None) with a shape (), (N,), or (2, N): - if dx or dy has a shape () or (N,), the error bars are given by (x-dx, x+dx) or (y-dy, y+dy), - if dx or dy has a shape (2, N), the error bars are given by (x-dx[0], x+dx[1]) or (y-dy[0], y+dy[1]). """ self.__x = asarray(x, Float) if len(self.__x.shape) != 1: raise RuntimeError, 'len(asarray(x).shape) != 1' self.__y = asarray(y, Float) if len(self.__y.shape) != 1: raise RuntimeError, 'len(asarray(y).shape) != 1' if len(self.__x) != len(self.__y): raise RuntimeError, 'len(asarray(x)) != len(asarray(y))' if dx is None: self.__dx = None else: self.__dx = asarray(dx, Float) if len(self.__dx.shape) not in [0, 1, 2]: raise RuntimeError, 'len(asarray(dx).shape) not in [0, 1, 2]' if dy is None: self.__dy = dy else: self.__dy = asarray(dy, Float) if len(self.__dy.shape) not in [0, 1, 2]: raise RuntimeError, 'len(asarray(dy).shape) not in [0, 1, 2]' Qwt.QwtPlotCurve.setData(self, self.__x, self.__y) # setData() def boundingRect(self): """Return the bounding rectangle of the data, error bars included. """ if self.__dx is None: xmin = min(self.__x) xmax = max(self.__x) elif len(self.__dx.shape) in [0, 1]: xmin = min(self.__x - self.__dx) xmax = max(self.__x + self.__dx) else: xmin = min(self.__x - self.__dx[0]) xmax = max(self.__x + self.__dx[1]) if self.__dy is None: ymin = min(self.__y) ymax = max(self.__y) elif len(self.__dy.shape) in [0, 1]: ymin = min(self.__y - self.__dy) ymax = max(self.__y + self.__dy) else: ymin = min(self.__y - self.__dy[0]) ymax = max(self.__y + self.__dy[1]) return Qt.QRectF(xmin, ymin, xmax-xmin, ymax-ymin) # boundingRect() def drawFromTo(self, painter, xMap, yMap, first, last = -1): """Draw an interval of the curve, including the error bars painter is the QPainter used to draw the curve xMap is the Qwt.QwtDiMap used to map x-values to pixels yMap is the Qwt.QwtDiMap used to map y-values to pixels first is the index of the first data point to draw last is the index of the last data point to draw. If last < 0, last is transformed to index the last data point """ if last < 0: last = self.dataSize() - 1 if self.errorOnTop: Qwt.QwtPlotCurve.drawFromTo(self, painter, xMap, yMap, first, last) # draw the error bars painter.save() painter.setPen(self.errorPen) # draw the error bars with caps in the x direction if self.__dx is not None: # draw the bars if len(self.__dx.shape) in [0, 1]: xmin = (self.__x - self.__dx) xmax = (self.__x + self.__dx) else: xmin = (self.__x - self.__dx[0]) xmax = (self.__x + self.__dx[1]) y = self.__y n, i = len(y), 0 lines = [] while i < n: yi = yMap.transform(y[i]) lines.append(Qt.QLine(xMap.transform(xmin[i]), yi, xMap.transform(xmax[i]), yi)) i += 1 painter.drawLines(lines) if self.errorCap > 0: # draw the caps cap = self.errorCap/2 n, i, = len(y), 0 lines = [] while i < n: yi = yMap.transform(y[i]) lines.append( Qt.QLine(xMap.transform(xmin[i]), yi - cap, xMap.transform(xmin[i]), yi + cap)) lines.append( Qt.QLine(xMap.transform(xmax[i]), yi - cap, xMap.transform(xmax[i]), yi + cap)) i += 1 painter.drawLines(lines) # draw the error bars with caps in the y direction if self.__dy is not None: # draw the bars if len(self.__dy.shape) in [0, 1]: ymin = (self.__y - self.__dy) ymax = (self.__y + self.__dy) else: ymin = (self.__y - self.__dy[0]) ymax = (self.__y + self.__dy[1]) x = self.__x n, i, = len(x), 0 lines = [] while i < n: xi = xMap.transform(x[i]) lines.append( Qt.QLine(xi, yMap.transform(ymin[i]), xi, yMap.transform(ymax[i]))) i += 1 painter.drawLines(lines) # draw the caps if self.errorCap > 0: cap = self.errorCap/2 n, i, j = len(x), 0, 0 lines = [] while i < n: xi = xMap.transform(x[i]) lines.append( Qt.QLine(xi - cap, yMap.transform(ymin[i]), xi + cap, yMap.transform(ymin[i]))) lines.append( Qt.QLine(xi - cap, yMap.transform(ymax[i]), xi + cap, yMap.transform(ymax[i]))) i += 1 painter.drawLines(lines) painter.restore() if not self.errorOnTop: Qwt.QwtPlotCurve.drawFromTo(self, painter, xMap, yMap, first, last) # drawFromTo() # class ErrorBarPlotCurve def make(): # create a plot with a white canvas demo = Qwt.QwtPlot(Qwt.QwtText("Errorbar Demonstation")) demo.setCanvasBackground(Qt.Qt.white) demo.plotLayout().setAlignCanvasToScales(True) grid = Qwt.QwtPlotGrid() grid.attach(demo) grid.setPen(Qt.QPen(Qt.Qt.black, 0, Qt.Qt.DotLine)) # calculate data and errors for a curve with error bars x = arange(0, 10.1, 0.5, Float) y = sin(x) dy = 0.2 * abs(y) # dy = (0.15 * abs(y), 0.25 * abs(y)) # uncomment for asymmetric error bars dx = 0.2 # all error bars the same size errorOnTop = False # uncomment to draw the curve on top of the error bars # errorOnTop = True # uncomment to draw the error bars on top of the curve curve = ErrorBarPlotCurve( x = x, y = y, dx = dx, dy = dy, curvePen = Qt.QPen(Qt.Qt.black, 2), curveSymbol = Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, Qt.QBrush(Qt.Qt.red), Qt.QPen(Qt.Qt.black, 2), Qt.QSize(9, 9)), errorPen = Qt.QPen(Qt.Qt.blue, 2), errorCap = 10, errorOnTop = errorOnTop, ) curve.attach(demo) demo.resize(400, 300) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() zoomer = Qwt.QwtPlotZoomer(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.DragSelection, Qwt.QwtPicker.AlwaysOff, demo.canvas()) zoomer.setRubberBandPen(Qt.QPen(Qt.Qt.green)) picker = Qwt.QwtPlotPicker(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.NoSelection, Qwt.QwtPlotPicker.CrossRubberBand, Qwt.QwtPicker.AlwaysOn, demo.canvas()) picker.setTrackerPen(Qt.QPen(Qt.Qt.red)) sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': if 'settracemask' in sys.argv: # for debugging, requires: python configure.py --trace ... import sip sip.settracemask(0x3f) main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/qt4examples/CurveDemo1.py0000555000175000017500000001147010505454217020445 0ustar poxpox#!/usr/bin/env python # The Python version of qwt-*/examples/curvedemo1/curvdemo1 import sys from PyQt4 import Qt import PyQt4.Qwt5 as Qwt from PyQt4.Qwt5.anynumpy import * class CurveDemo(Qt.QFrame): def __init__(self, *args): Qt.QFrame.__init__(self, *args) self.xMap = Qwt.QwtScaleMap() self.xMap.setScaleInterval(-0.5, 10.5) self.yMap = Qwt.QwtScaleMap() self.yMap.setScaleInterval(-1.1, 1.1) # frame style self.setFrameStyle(Qt.QFrame.Box | Qt.QFrame.Raised) self.setLineWidth(2) self.setMidLineWidth(3) # calculate values self.x = arange(0, 10.0, 10.0/27) self.y = sin(self.x)*cos(2*self.x) # make curves with different styles self.curves = [] self.titles = [] # curve 0 self.titles.append('Style: Lines/Fitted, Symbol: Cross') curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.darkGreen)) curve.setStyle(Qwt.QwtPlotCurve.Lines) curve.setCurveAttribute(Qwt.QwtPlotCurve.Fitted) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Cross, Qt.QBrush(), Qt.QPen(Qt.Qt.black), Qt.QSize(5, 5))) self.curves.append(curve) # curve 1 self.titles.append('Style: Sticks, Symbol: Ellipse') curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.red)) curve.setStyle(Qwt.QwtPlotCurve.Sticks) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse, Qt.QBrush(Qt.Qt.yellow), Qt.QPen(Qt.Qt.blue), Qt.QSize(5, 5))) self.curves.append(curve) # curve 2 self.titles.append('Style: Lines, Symbol: None') curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.darkBlue)) curve.setStyle(Qwt.QwtPlotCurve.Lines) self.curves.append(curve) # curve 3 self.titles.append('Style: Lines, Symbol: None, Antialiased') curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.darkBlue)) curve.setStyle(Qwt.QwtPlotCurve.Lines) curve.setRenderHint(Qwt.QwtPlotItem.RenderAntialiased) self.curves.append(curve) # curve 4 self.titles.append('Style: Steps, Symbol: None') curve = Qwt.QwtPlotCurve() curve.setPen(Qt.QPen(Qt.Qt.darkCyan)) curve.setStyle(Qwt.QwtPlotCurve.Steps) self.curves.append(curve) # curve 5 self.titles.append('Style: NoCurve, Symbol: XCross') curve = Qwt.QwtPlotCurve() curve.setStyle(Qwt.QwtPlotCurve.NoCurve) curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.XCross, Qt.QBrush(), Qt.QPen(Qt.Qt.darkMagenta), Qt.QSize(5, 5))) self.curves.append(curve) # attach data, using Numeric for curve in self.curves: curve.setData(self.x, self.y) # __init__() def shiftDown(self, rect, offset): rect.translate(0, offset) # shiftDown() def paintEvent(self, event): Qt.QFrame.paintEvent(self, event) painter = Qt.QPainter(self) painter.setClipRect(self.contentsRect()) self.drawContents(painter) # paintEvent() def drawContents(self, painter): # draw curves r = self.contentsRect() dy = r.height()/len(self.curves) r.setHeight(dy) for curve in self.curves: self.xMap.setPaintInterval(r.left(), r.right()) self.yMap.setPaintInterval(r.top(), r.bottom()) engine = painter.device().paintEngine() if engine.hasFeature(Qt.QPaintEngine.Antialiasing): painter.setRenderHint( Qt.QPainter.Antialiasing, curve.testRenderHint(Qwt.QwtPlotItem.RenderAntialiased)) curve.draw(painter, self.xMap, self.yMap, r) self.shiftDown(r, dy) # draw titles r = self.contentsRect() r.setHeight(dy) painter.setFont(Qt.QFont('Helvetica', 8)) painter.setPen(Qt.Qt.black) for title in self.titles: painter.drawText( 0, r.top(), r.width(), painter.fontMetrics().height(), Qt.Qt.AlignTop | Qt.Qt.AlignHCenter, title) self.shiftDown(r, dy) # drawContents() # class CurveDemo def make(): demo = CurveDemo() demo.resize(300, 600) demo.show() return demo # make() def main(args): app = Qt.QApplication(args) demo = make() sys.exit(app.exec_()) # main() # Admire! if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** pyqwt5-5.2.1~cvs20091107+dfsg/COPYING.PyQwt0000444000175000017500000000234210411526316015757 0ustar poxpox PyQwt LICENSE Version 3, March 2006 PyQwt is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PyQwt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PyQwt; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. In addition, as a special exception, Gerard Vermeulen gives permission to link PyQwt dynamically with non-free versions of Qt and PyQt, and to distribute PyQwt in this form, provided that equally powerful versions of Qt and PyQt have been released under the terms of the GNU General Public License. If PyQwt is dynamically linked with non-free versions of Qt and PyQt, PyQwt becomes a free plug-in for a non-free program. ------------------------------------------------------------------------------- pyqwt5-5.2.1~cvs20091107+dfsg/CHANGES-5.0.10000444000175000017500000000227410651727017015306 0ustar poxpoxNew features: - supports the N-D array interface specification: NumPy can be used with somewhat reduced functionality when PyQwt has been built without support for NumPy. See: http://numpy.scipy.org/array_interface.shtml. - works with Qt-4.3.0 in combination with SIP-4.7 and PyQt-4.3. - the iqt module also supports an interactive Python session without the help of the GNU readline module. - one of the QwtPlotPicker::TrackerText() C++ member functions has been renamed to QwtPlotPicker.TrackerTextF() in Python for disambiguation. - the HistogramDemo.py example. - when anynumpy.py fails to import any numerical Python extension, it pops up a message box showing where to get NumPy. - the latex sources for the documentation (a Debian requirement). Bug fixes: - plugs a memory leak in toQImage(anArray). - builts against an system Qwt library without the QwtSVGItem CONFIG option. - builts with Python-2.5 and MSVS-2005 - fixed the mouse movement tracking in the BarPlotDemo.py example. - fixed crashing of MultiDemo.py when a numerical Python extension has been installed but PyQwt has not been built with support for that extension. - includes revision 173 of the Qwt subversion bugfix branch.