pax_global_header00006660000000000000000000000064133466401100014510gustar00rootroot0000000000000052 comment=b921024c08b43362195a394553d79f15728cc569 PyQwt3D-pyqwt3d-0.1.8/000077500000000000000000000000001334664011000144025ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/ANNOUNCEMENT-0.1.1.TXT000066400000000000000000000021471334664011000173340ustar00rootroot00000000000000What is PyQwt3D? - it is a set of Python bindings for the QwtPlot3D C++ class library which extends the Qt framework with widgets for 3D data visualization. PyQwt3D inherits the snappy feel from QwtPlot3D. The examples at http://pyqwt.sourceforge.net/pyqwt3d-examples.html show how easy it is to make a 3D plot and how to save a 3D plot to an image or an (E)PS/PDF file. - it requires and extends PyQt, a set of Python bindings for Qt. - it supports the use of PyQt, Qt, Qwt, the Numerical Python extensions (any combination of NumPy, numarray, and numarray) and optionally SciPy in a GUI Python application or in an interactive Python session. - it runs on POSIX, MacOS/X and Windows platforms (practically any platform supported by Qt and Python). Changes: - support for NumPy, see http://numeric.scipy.org - support for SIP-4.3.x - build fixes for MacOS/X The home page of PyQwt3D is http://pyqwt.sourceforge.net. PyQwt3D-0.1.1 requires: 1. Python-2.4.x or -2.3. 2. PyQt-3.15.x or -3.14.x. 3. SIP-4.3.x or -4.2.1. 4. Qt-3.3.x, -3.2.x, or -3.1.x. 5. QwtPlot3D-0.2.6. Have fun -- Gerard Vermeulen PyQwt3D-pyqwt3d-0.1.8/ANNOUNCEMENT-0.1.2.TXT000066400000000000000000000026111334664011000173310ustar00rootroot00000000000000What is PyQwt3D? - it is a set of Python bindings for the QwtPlot3D C++ class library which extends the Qt framework with widgets for 3D data visualization. PyQwt3D inherits the snappy feel from QwtPlot3D. The examples at http://pyqwt.sourceforge.net/pyqwt3d-examples.html show how easy it is to make a 3D plot and how to save a 3D plot to an image or an (E)PS/PDF file. - it requires and extends PyQt, a set of Python bindings for Qt. - it supports the use of PyQt, Qt, Qwt, the Numerical Python extensions (any combination of NumPy, numarray, and numarray) and optionally 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). New features: - support for Python-2.5 (requires PyQt and SIP snapshots or the future PyQt-3.17, PyQt-4.1 and SIP-4.5) - support for Qt-4.2.x and -4.1.x - support for NumPy-1.0, see http://numpy.scipy.org - PyQwt3D.OpenGL gives access to a small subset of the OpenGL API - EnrichmentDemo.py example demonstrates PyQwt3D.OpenGL The home page of PyQwt3D is http://pyqwt.sourceforge.net. PyQwt3D-0.1.2 requires: 1. Python-2.5.x,-2.4.x, or -2.3. 2. PyQt-4.0.x, or -3.16.x (or the future PyQt-4.1 or PyQt-3.17) 3. SIP-4.4.x (or the future SIP-4.5) 4. Qt-4.2.x, Qt-4.1.x, Qt-3.3.x, or -3.2.x. 5. QwtPlot3D-0.2.6. Have fun -- Gerard Vermeulen PyQwt3D-pyqwt3d-0.1.8/ANNOUNCEMENT-0.1.3.TXT000066400000000000000000000025531334664011000173370ustar00rootroot00000000000000What is PyQwt3D? - it is a set of Python bindings for the QwtPlot3D C++ class library which extends the Qt framework with widgets for 3D data visualization. PyQwt3D inherits the snappy feel from QwtPlot3D. The examples at http://pyqwt.sourceforge.net/pyqwt3d-examples.html show how easy it is to make a 3D plot and how to save a 3D plot to an image or an (E)PS/PDF file. - it requires and extends PyQt, a set of Python bindings for Qt. - it supports the use of PyQt, Qt, QwtPlot3D, the Numerical Python extensions (any combination of NumPy, numarray, and numarray) and optionally 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). The home page of PyQwt3D is http://pyqwt.sourceforge.net. New features in PyQwt3D-0.1.2: - support for Python-2.5. - support for Qt-4.2.x and -4.1.x - support for NumPy-1.0, see http://numpy.scipy.org - PyQwt3D.OpenGL gives access to a small subset of the OpenGL API - EnrichmentDemo.py example demonstrates PyQwt3D.OpenGL Bug fix in PyQwt3D-0.1.3: - enabled support for SIP-4.5. PyQwt3D-0.1.3 supports: 1. Python-2.5.x,-2.4.x, or -2.3.x. 2. PyQt-4.1 and -4.0.x, or -3.17 and -3.16.x. 3. SIP-4.5.x, or -4.4.x. 4. Qt-4.2.x, Qt-4.1.x, Qt-3.3.x, or -3.2.x. 5. QwtPlot3D-0.2.6. Have fun -- Gerard Vermeulen PyQwt3D-pyqwt3d-0.1.8/ANNOUNCEMENT-0.1.4.TXT000066400000000000000000000020331334664011000173310ustar00rootroot00000000000000What is PyQwt3D? - it is a set of Python bindings for the QwtPlot3D C++ class library which extends the Qt framework with widgets for 3D data visualization. PyQwt3D inherits the snappy feel from QwtPlot3D. The examples at http://pyqwt.sourceforge.net/pyqwt3d-examples.html show how easy it is to make a 3D plot and how to save a 3D plot to an image or an (E)PS/PDF file. - it requires and extends PyQt, a set of Python bindings for Qt. - it supports the use of PyQt, Qt, QwtPlot3D, and 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). The home page of PyQwt3D is http://pyqwt.sourceforge.net. New features in PyQwt3D-0.1.4: - enabled support for SIP-4.6 - an NSIS Windows installer PyQwt3D-0.1.4 supports: 1. Python-2.5.x, -2.4.x, or -2.3.x. 2. PyQt-4.2 and -4.1.x, or -3.17.x. 3. SIP-4.6, or -4.5.x. 4. Qt-4.2.x, Qt-4.1.x, Qt-3.3.x, or -3.2.x. 5. QwtPlot3D-0.2.6. Enjoy -- Gerard Vermeulen PyQwt3D-pyqwt3d-0.1.8/ANNOUNCEMENT-0.1.5.TXT000066400000000000000000000026161334664011000173410ustar00rootroot00000000000000What is PyQwt3D ( http://pyqwt3d.sourceforge.net) ? - it is a set of Python bindings for the QwtPlot3D C++ class library which extends the Qt framework with widgets for 3D data visualization. PyQwt3D inherits the snappy feel from QwtPlot3D. The examples at http://pyqwt.sourceforge.net/pyqwt3d-examples.html show how easy it is to make a 3D plot and how to save a 3D plot to an image or an (E)PS/PDF/PGF/SVG file. - it requires and extends PyQt, a set of Python bindings for Qt. - it supports the use of PyQt, Qt, QwtPlot3D, and 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). The home page of PyQwt3D is http://pyqwt.sourceforge.net. New features and bugfixes in PyQwt3D-0.1.5: - Added support for QwtPlot3D-0.2.7 - Added support for SIP-4.7, PyQt-4.3 and PyQt-3.17.3. - Added support for SVG and PGF vector output. - Added Qwt3D.save() to facilitate saving plots to a file. - Added Qwt3D.plot() to facilitate function plotting with nicely scaled axes. - Fixed the type of the result of IO.outputHandler(format). - Fixed saving to pixmap formats in qt4examples/Grab.py. PyQwt3D-0.1.5 supports: 1. Python-2.5, or -2.4. 2. PyQt-4.3, -4.2, -4.1, or -3.17. 3. SIP-4.7, -4.6, or -4.5. 4. Qt-4.3, -4.2, Qt-3.3, or -3.2. 5. QwtPlot3D-0.2.7. Enjoy -- Gerard Vermeulen PyQwt3D-pyqwt3d-0.1.8/ANNOUNCEMENT-0.1.6.TXT000066400000000000000000000024061334664011000173370ustar00rootroot00000000000000What is PyQwt3D ( http://pyqwt3d.sourceforge.net) ? - it is a set of Python bindings for the QwtPlot3D C++ class library which extends the Qt framework with widgets for 3D data visualization. PyQwt3D inherits the snappy feel from QwtPlot3D. The examples at http://pyqwt.sourceforge.net/pyqwt3d-examples.html show how easy it is to make a 3D plot and how to save a 3D plot to an image or an (E)PS/PDF/PGF/SVG file. - it requires and extends PyQt, a set of Python bindings for Qt. - it supports the use of PyQt, Qt, QwtPlot3D, and 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 is licensed under the GPL with an exception to allow dynamic linking with non-free releases of Qt and PyQt. The home page of PyQwt3D is http://pyqwt.sourceforge.net. PyQwt3D-0.1.6 is a bug fix release: - Improved text display on screen and in pixmaps with Qt-4 and X (requires the use of the patched QwtPlot3D-0.2.7 library included in PyQwt3D). PyQwt3D-0.1.6 supports: 1. Python-2.5, or -2.4. 2. PyQt-4.3, -4.2, -4.1, or -3.17. 3. SIP-4.7, -4.6, or -4.5. 4. Qt-4.3, -4.2, Qt-3.3, or -3.2. 5. QwtPlot3D-0.2.7. Enjoy -- Gerard Vermeulen PyQwt3D-pyqwt3d-0.1.8/ANNOUNCEMENT-0.1.7.TXT000066400000000000000000000023121334664011000173340ustar00rootroot00000000000000What is PyQwt3D ( http://pyqwt.sourceforge.net ) ? - it is a set of Python bindings for the QwtPlot3D C++ class library which extends the Qt framework with widgets for 3D data visualization. PyQwt3D inherits the snappy feel from QwtPlot3D. The examples at http://pyqwt.sourceforge.net/pyqwt3d-examples.html show how easy it is to make a 3D plot and how to save a 3D plot to an image or an (E)PS/PDF/PGF/SVG file. - it requires and extends PyQt, a set of Python bindings for Qt. - it supports the use of PyQt, Qt, QwtPlot3D, and 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 is licensed under the GPL with an exception to allow dynamic linking with non-free releases of Qt and PyQt. PyQwt3D-0.1.7 is a bug fix release: - Improved text display on screen and in pixmaps with Qt-4 and X (requires the use of the patched QwtPlot3D-0.2.7 library included in PyQwt3D). PyQwt3D-0.1.7 supports: 1. Python-2.5, or -2.4. 2. PyQt-4.3, -4.2, -4.1, or -3.17. 3. SIP-4.7, -4.6, or -4.5. 4. Qt-4.3, -4.2, Qt-3.3, or -3.2. 5. QwtPlot3D-0.2.7. Enjoy -- Gerard Vermeulen PyQwt3D-pyqwt3d-0.1.8/ANNOUNCEMENT-0.1.8.TXT000066400000000000000000000023221334664011000173360ustar00rootroot00000000000000What is PyQwt3D ( https://github.com/GauiStori/PyQwt3D )? - It is a fork of the original project http://pyqwt.sourceforge.net that is updated to work with Qt5 and Python3 - it is a set of Python bindings for the QwtPlot3D C++ class library which extends the Qt framework with widgets for 3D data visualization. PyQwt3D inherits the snappy feel from QwtPlot3D. The examples at http://pyqwt.sourceforge.net/pyqwt3d-examples.html show how easy it is to make a 3D plot and how to save a 3D plot to an image or an (E)PS/PDF/PGF/SVG file. - it requires and extends PyQt, a set of Python bindings for Qt. - it supports the use of PyQt, Qt, QwtPlot3D, and 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 is licensed under the GPL with an exception to allow dynamic linking with non-free releases of Qt and PyQt. PyQwt3D-0.1.8 supports: 1. Python-2.5, or -2.4. -3 2. PyQt-4.3, -4.2, -4.1, or -3.17. 3. SIP-4.12, 4.7, -4.6, or -4.5. 4. Qt-4.3, -4.2, Qt-3.3, or -3.2. 5. Qt-5 6. QwtPlot3D-0.2.7. This version is only tested on Linux (Debian). Enjoy -- Gudjon I. Gudjonsson PyQwt3D-pyqwt3d-0.1.8/ANNOUNCEMENT-0.1.TXT000066400000000000000000000021031334664011000171650ustar00rootroot00000000000000What is PyQwt3D? - it is a set of Python bindings for the QwtPlot3D C++ class library which extends the Qt framework with widgets for 3D data visualization. PyQwt3D inherits the snappy feel from QwtPlot3D. The examples at http://pyqwt.sourceforge.net/pyqwt3d-examples.html show how easy it is to make a 3D plot and how to save a 3D plot to an image or an (E)PS/PDF file. - it requires and extends PyQt, a set of Python bindings for Qt. - it supports the use of PyQt, Qt, Qwt, the Numerical Python extensions (either Numeric, or numarray or both) and optionally SciPy in a GUI Python application or in an interactive Python session. - it runs on POSIX, MacOS/X and Windows platforms (practically any platform supported by Qt and Python). The home page of PyQwt3D is http://pyqwt.sourceforge.net. PyQwt3D-0.1 supports: 1. Python-2.4 downto -2.3. 2. PyQt-3.14 downto -3.12. 3. SIP-4.2 downto -4.0, but SIP-4.2 is recommended. PyQwt3D does *not* support SIP-3.x (I tried, but failed). 4. Qt-3.3.4 downto -2.3.0. 5. QwtPlot3D-0.2.4-beta. Have fun -- Gerard Vermeulen PyQwt3D-pyqwt3d-0.1.8/COPYING000066400000000000000000000431221334664011000154370ustar00rootroot00000000000000 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. PyQwt3D-pyqwt3d-0.1.8/COPYING.PyQwt3D000066400000000000000000000023661334664011000167160ustar00rootroot00000000000000 PyQwt3D LICENSE Version 1, Septembre 2006 PyQwt3D 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. PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, PyQwt3D becomes a free plug-in for a non-free program. ------------------------------------------------------------------------------- PyQwt3D-pyqwt3d-0.1.8/ChangeLog000066400000000000000000001114651334664011000161640ustar00rootroot000000000000002018-09-14 06:56 Gudjon * Add ANNOUNCEMENT-0.1.8.TXT * Updated to python3 and Qt5. Tested on Linux (Debian) 2008-11-03 07:23 gvermeul * qt4examples/EnrichmentDemo.py: Add scaffolding. 2008-11-02 10:15 gvermeul * configure/configure.py: Update copyright dates. 2008-11-02 09:57 gvermeul * ChangeLog, configure/configure.py, sip/FILL, sip/OpenGL_Qt3_Module.sip, sip/OpenGL_Qt4_Module.sip, sip/OpenGL_mod.sip, sip/Qwt3D_Qt3_Module.sip, sip/Qwt3D_Qt4_Module.sip, sip/STD_VECTOR_BASE, sip/STD_VECTOR_USER, sip/features.sip, sip/qwt3d_autoscaler.sip, sip/qwt3d_axis.sip, sip/qwt3d_axisvector.sip, sip/qwt3d_cell.sip, sip/qwt3d_cellfield.sip, sip/qwt3d_color.sip, sip/qwt3d_colorlegend.sip, sip/qwt3d_colorvector.sip, sip/qwt3d_coordsys.sip, sip/qwt3d_doublevector.sip, sip/qwt3d_drawable.sip, sip/qwt3d_enrichment.sip, sip/qwt3d_enrichment_std.sip, sip/qwt3d_freevectorfield.sip, sip/qwt3d_function.sip, sip/qwt3d_gridmapping.sip, sip/qwt3d_io.sip, sip/qwt3d_io_gl2ps.sip, sip/qwt3d_io_reader.sip, sip/qwt3d_label.sip, sip/qwt3d_mapping.sip, sip/qwt3d_openglhelper.sip, sip/qwt3d_parametricsurface.sip, sip/qwt3d_plot.sip, sip/qwt3d_portability.sip, sip/qwt3d_scale.sip, sip/qwt3d_surfaceplot.sip, sip/qwt3d_triplefield.sip, sip/qwt3d_types.sip, sip/qwt3dmod.sip: Make PyQwt3D compile with the snapshots leading to SIP-4.8 by replacing size_type with size_t. Update copyright dates. 2008-10-26 15:52 gvermeul * configure/: PyQwt3D.nsi.in, configure.py, go-mingw.bat: Fix some build problems on Windows. 2007-08-08 11:31 gvermeul * ANNOUNCEMENT-0.1.7.TXT, ChangeLog, setup.py: Prepare PyQwt3D-0.1.7. 2007-08-08 06:40 gvermeul * ChangeLog: Releasing PyQwt3D-0.1.6. 2007-08-07 22:59 gvermeul * ChangeLog, Doc/pyqwt3d/copyright.tex: Fix copyright date. 2007-08-07 22:12 gvermeul * NEWS, ChangeLog: Prepare PyQwt-0.1.6. 2007-08-07 22:09 gvermeul * ANNOUNCEMENT-0.1.6.TXT: Point out the necessity of the include patched QwtPlot3D library to improve the text display. 2007-08-07 22:05 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Document go-mingw.bat. 2007-08-07 21:47 gvermeul * ANNOUNCEMENT-0.1.6.TXT, ChangeLog, Doc/pyqwt3d/pyqwt3d.tex, configure/PyQwt3D.nsi.in: Prepare PyQwt3D-0.1.6. 2007-08-07 21:05 gvermeul * qt4examples/EnrichmentDemo.py: Replace string "Courier" with variable 'family'. 2007-08-07 20:56 gvermeul * qt4examples/: AutoSwitch.py, EnrichmentDemo.py, ParametricSurfaceDemo.py, SimplePlot.py, TestNumPy.py: Fix typo, and look if colored text is working. 2007-08-07 20:28 gvermeul * pyqwt3d-0.2.7.patch: Made it work on Mac OS X with Qt-4. It still looks bad on Mac OS X with Qt-3. 2007-08-07 19:15 gvermeul * pyqwt3d-0.2.7.patch: Try to improve the text display with Qt-4 on Linux. 2007-08-07 19:13 gvermeul * qt4examples/: AutoSwitch.py, EnrichmentDemo.py, ParametricSurfaceDemo.py, SimplePlot.py, TestNumPy.py: Add font twiddling code (we stick to courrier, but Verdana or the default application code are also easy to test). 2007-08-07 18:28 gvermeul * qt4examples/SimplePlot.py: Try to select the Verdana font falling back on the application font. 2007-08-07 18:28 gvermeul * setup.py: Prepare PyQwt-0.1.6. 2007-08-07 11:19 gvermeul * ChangeLog, Doc/pyqwt3d/pyqwt3d.tex: PyQwt3D-0.1.5 has been released. 2007-08-07 10:13 gvermeul * ChangeLog: Released as PyQwt3D-0.1.5 with Windows fixes. 2007-08-07 10:11 gvermeul * configure/go-mingw.bat: Add go-mingw.bat. 2007-08-07 10:10 gvermeul * configure/PyQwt3D.nsi.in: Remove its own PyQt4/Qwt3D directory instead of PyQt4/Qwt5. Bump version. Add more documentation. 2007-08-07 08:09 gvermeul * ChangeLog, MANIFEST.in: Oops, included QwtPlot3D-0.2.6 instead of QwtPlot3D-0.2.7. Released as PyQwt3D-0.1.5. 2007-08-07 07:41 gvermeul * ANNOUNCEMENT-0.1.5.TXT: Fixed requirements and minor editing. 2007-08-07 07:22 gvermeul * ChangeLog, MANIFEST.in, NEWS: PyQwt3D-0.1.5 released. 2007-08-06 09:03 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Fix the requirements concerning SIP and PyQt. 2007-08-06 08:48 gvermeul * qt3lib/Qwt3D/ezplot.py, qt4lib/PyQt4/Qwt3D/ezplot.py: Enable antialiasing. 2007-08-05 12:19 gvermeul * examples/Grab.py, qt3lib/Qwt3D/__init__.py, qt4examples/Grab.py, qt4lib/PyQt4/Qwt3D/__init__.py: Moved searching for Plot3D children from __init__.save() to the Grab.py example. 2007-08-04 14:06 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Documented the configuration for SVG and PGF vector output file formats. 2007-08-04 14:05 gvermeul * configure/configure.py: Documented the HAVE_LIBPNG define. 2007-08-03 20:01 gvermeul * MANIFEST.in, NEWS: A first stab at a NEWS file. 2007-08-03 19:46 gvermeul * CHANGES-0.1.4.TXT: Merge CHANGES-0.1.4.TXT into a NEWS file. 2007-08-02 08:54 gvermeul * .cvsignore: Ignore libpng. 2007-08-02 08:47 gvermeul * ANNOUNCEMENT-0.1.5.TXT: A first stab at ANNOUNCEMENT-0.1.5.TXT. 2007-08-02 08:29 gvermeul * Doc/pyqwt3d/pyqwt3d.tex, qt3lib/Qwt3D/ezplot.py, qt4lib/PyQt4/Qwt3D/ezplot.py: Simplified the axis scaling in plot() and update the documentation. 2007-08-01 21:05 gvermeul * GNUmakefile: Add a target to get libpng. Fix typo. 2007-08-01 20:32 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Link to the new SIP-4.7, PyQt-4.3, and PyQt-3.17.3. 2007-08-01 16:52 gvermeul * GNUmakefile: Fix QWT3DOPTIONS for Mac OS X. 2007-08-01 10:55 gvermeul * Doc/pyqwt3d/pyqwt3d.tex, qt3lib/Qwt3D/__init__.py, qt3lib/Qwt3D/ezplot.py, qt4lib/PyQt4/Qwt3D/__init__.py, qt4lib/PyQt4/Qwt3D/ezplot.py: A first stab at ezplot. 2007-08-01 09:52 gvermeul * configure/configure.py: Add copyright notice. 2007-07-31 08:22 gvermeul * sip/qwt3d_axis.sip: Back out of the transfer of ownership fix in setScale(), because I do not really know how to fix it. 2007-07-30 20:33 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Prepare release 0.1.5. Document the save() function. 2007-07-30 18:12 gvermeul * sip/qwt3d_axis.sip: Fix ownership. 2007-07-30 17:28 gvermeul * GNUmakefile: Fix typo (-j). 2007-07-29 19:46 gvermeul * pyqwt3d-0.2.7.patch: Add SVG_GZ to setFormat(). 2007-07-29 19:03 gvermeul * qt3lib/Qwt3D/__init__.py, qt4lib/PyQt4/Qwt3D/__init__.py: A first stab at a save() function. 2007-07-29 19:01 gvermeul * examples/EnrichmentDemo.py, examples/Grab.py, examples/SimplePlot.py, qt4examples/EnrichmentDemo.py, qt4examples/Grab.py, qt4examples/SimplePlot.py: Use the new save() function. Minor editing. 2007-07-29 19:00 gvermeul * examples/.cvsignore: Ignore .eps, .ps and .svg files. 2007-07-29 16:39 gvermeul * GNUmakefile: Generate a QwtPlot3D source tree with documentation. Cleanup. 2007-07-29 16:38 gvermeul * pyqwt3d-0.2.7.patch: SVG and PGF output work. 2007-07-29 16:03 gvermeul * sip/qwt3d_io.sip: Remove the /Abstract/ annotation. Add ConvertToSubClassCode. 2007-07-29 13:43 gvermeul * .cvsignore: Ignore qwtplot3d-doc and qwtplot3d-doc.zip. 2007-07-29 13:40 gvermeul * MANIFEST.in: Prune .eps, .ps .svg files. 2007-07-29 12:48 gvermeul * MANIFEST.in, configure/configure.py, qt3lib/Qwt3D/__init__.py, qt4lib/PyQt4/Qwt3D/__init__.py: Copy (instead of generate) the __init__.py files. 2007-07-29 12:38 gvermeul * configure/: go3.bat, go4.bat: Upgrade to QwtPlot3D-0.2.7. 2007-07-29 04:35 gvermeul * sip/OpenGL_Qt3_Module.sip, sip/OpenGL_Qt4_Module.sip, sip/OpenGL_mod.sip, sip/Qwt3D_Qt3_Module.sip, sip/Qwt3D_Qt4_Module.sip, sip/features.sip, sip/qwt3d_autoscaler.sip, sip/qwt3d_axis.sip, sip/qwt3d_axisvector.sip, sip/qwt3d_cell.sip, sip/qwt3d_cellfield.sip, sip/qwt3d_color.sip, sip/qwt3d_colorlegend.sip, sip/qwt3d_colorvector.sip, sip/qwt3d_coordsys.sip, sip/qwt3d_doublevector.sip, sip/qwt3d_drawable.sip, sip/qwt3d_enrichment.sip, sip/qwt3d_enrichment_std.sip, sip/qwt3d_freevectorfield.sip, sip/qwt3d_function.sip, sip/qwt3d_gridmapping.sip, sip/qwt3d_io.sip, sip/qwt3d_io_gl2ps.sip, sip/qwt3d_io_reader.sip, sip/qwt3d_label.sip, sip/qwt3d_mapping.sip, sip/qwt3d_openglhelper.sip, sip/qwt3d_parametricsurface.sip, sip/qwt3d_plot.sip, sip/qwt3d_portability.sip, sip/qwt3d_scale.sip, sip/qwt3d_surfaceplot.sip, sip/qwt3d_triplefield.sip, sip/qwt3d_types.sip, sip/qwt3dmod.sip, numpy/qwt3d_numarray.cpp, numpy/qwt3d_numarray.h, numpy/qwt3d_numeric.cpp, numpy/qwt3d_numeric.h, numpy/qwt3d_numpy.cpp, numpy/qwt3d_numpy.h, numpy/qwt3d_python.cpp, numpy/qwt3d_python.h: Bump copyright year. 2007-07-28 15:50 gvermeul * MANIFEST.in, PyQwt3D.spec, setup.py: Prepare PyQwt3D-0.1.5 and remove PyQwt3D.spec. 2007-07-28 15:47 gvermeul * qt4examples/.cvsignore: Ignore .eps, .ps, and .svg files. 2007-07-28 15:45 gvermeul * configure/configure.py: Support SIP-4.7. 2007-07-28 15:43 gvermeul * sip/: .cvsignore, types.sip: Remove types.sip since it is automagically generated. 2007-07-28 15:41 gvermeul * sip/qwt3d_mapping.sip: Switch to QwtPlot3D-0.2.7. 2007-07-28 15:40 gvermeul * .cvsignore, GNUmakefile, gendiff, pyqwt3d-0.2.7.patch, unbieber.py: Switch to qwtplot3d-0.2.7 and tools to patch it and to remove its the \r's and \t's. 2007-07-25 20:51 gvermeul * Doc/Makefile: Use Python-2.5.1 to generate the documentation. 2007-04-28 16:30 gvermeul * GNUmakefile: Distclean '.#*' files. Build and clean before making a distribution. 2007-04-15 15:30 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Prepare PyQwt3D-0.1.4. 2007-04-15 15:29 gvermeul * ANNOUNCEMENT-0.1.4.TXT, CHANGES-0.1.4.TXT, MANIFEST.in, Doc/pyqwt3d/pyqwt3d.tex: Prepare PyQwt-0.1.4. 2007-04-12 15:00 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Fix typo. 2007-04-12 14:50 gvermeul * configure/PyQwt3D.nsi.in: Windows tweaks. 2007-04-12 14:12 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Prepare PyQwt3D-0.1.4 with an NSIS Windows installer. 2007-04-12 14:10 gvermeul * sip/: qwt3d_drawable.sip, qwt3d_function.sip, qwt3d_parametricsurface.sip, types.sip: Drop support for SIP-4.4.x and zap the workarounds SIP-4.4.x bugs. ---------------------------------------------------------------------- 2007-04-11 15:14 gvermeul * configure/configure.py: Require at least SIP-4.5, PyQt-3.17 or PyQt-4.1. Kill a pychecker warning. Minor editing. 2007-04-09 14:17 gvermeul * setup.py: Prepare release 0.1.4. 2007-04-09 08:17 gvermeul * MANIFEST.in, configure/.cvsignore, configure/PyQwt3D.nsi.in, configure/configure.py: A first stab at a Nullsoft Scriptable Install System script. 2006-11-05 08:46 gvermeul * Doc/Makefile: Fixes for Mac OS X. 2006-11-05 08:04 gvermeul * ANNOUNCEMENT-0.1.3.TXT, setup.py, Doc/pyqwt3d/pyqwt3d.tex, configure/configure.py: Prepare release 0.1.3. 2006-10-29 18:25 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Prepare release 0.1.2. ---------------------------------------------------------------------- 2006-10-29 09:54 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Prepare release 0.1.2. 2006-10-29 09:02 gvermeul * ANNOUNCEMENT-0.1.2.TXT, setup.py: Prepare release 0.1.2. 2006-10-29 08:59 gvermeul * ANNOUNCEMENT-0.1.2.TXT, README, Doc/pyqwt3d/pyqwt3d.tex: Prepare release 0.1.2. ---------------------------------------------------------------------- 2006-10-09 23:58 gvermeul * configure/configure.py: Make PyQwt3D build on MacOSX with Qt-4.2.0. 2006-10-09 23:37 gvermeul * .cvsignore, GNUmakefile, sip/OpenGL_mod.sip: Fixes for Mac OSX. PyQwt3D does not yet build with Qt-4.2.0, because the AGL framework is missing from the Makefiles. 2006-10-08 07:08 gvermeul * GNUmakefile: Remove dead code. 2006-10-01 20:31 gvermeul * configure/configure.py, sip/types.sip: size_t is an unsigned integer type. 2006-10-01 20:21 gvermeul * ANNOUNCEMENT-0.1.2.TXT, PyQwt3D.spec, THANKS, setup.py, Doc/pyqwt3d/pyqwt3d.tex: Prepare release 0.1.2. 2006-10-01 12:32 gvermeul * examples/PyFontify.py, qt4examples/PyFontify.py: Snarf PyFontify.py from PyQwt5. 2006-10-01 12:27 gvermeul * examples/EnrichmentDemo.py, qt4examples/EnrichmentDemo.py: Add a save() method, so that the example can be used by Grab.py. 2006-10-01 12:18 gvermeul * examples/EnrichmentDemo.py: Make the example reflect its C++ counterpart. 2006-10-01 12:04 gvermeul * qt4examples/EnrichmentDemo.py: Finish the example. 2006-10-01 12:01 gvermeul * sip/: qwt3d_color.sip, types.sip: Fix transfer of ownership. 2006-10-01 08:55 gvermeul * qt4examples/EnrichmentDemo.py: A step in making this demo resemble its C++ equivalent. 2006-10-01 08:18 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Document the functions of Qwt3D. Document go3.bat and go4.bat. Document the policy on exporting protected C++ data members. 2006-10-01 07:38 gvermeul * configure/: go.bat, go3.bat, go4.bat: Renambe go.bat to go3.bat and add go4.bat. 2006-09-30 10:33 gvermeul * sip/OpenGL_mod.sip: Fix typo. 2006-09-30 10:31 gvermeul * sip/OpenGL_mod.sip: Fix for Win32. 2006-09-25 23:00 gvermeul * Doc/: Makefile, pyqwt3d/pyqwt3d.tex: Adapt to mkhowto of Python-2.5 in the new build environment. 2006-09-23 17:30 gvermeul * Doc/Makefile: Invoke Python explicitly (safer when having more than one Python). 2006-09-23 17:12 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Document the compatibility of PyQwt3D with Python-2.5 and SIP/PyQt snapshots. 2006-09-23 11:48 gvermeul * configure/.cvsignore: Ignore size_t_check.cpp. 2006-09-23 11:46 gvermeul * sip/: OpenGL_mod.sip, STD_VECTOR_BASE, STD_VECTOR_USER, qwt3d_axisvector.sip, qwt3d_cell.sip, qwt3d_cellfield.sip, qwt3d_colorvector.sip, qwt3d_doublevector.sip, qwt3d_freevectorfield.sip, qwt3d_triplefield.sip, qwt3dmod.sip, types.sip: Make PyQwt3D compile with Python-2.5 on Gentoo x86-64. 2006-09-16 13:23 gvermeul * configure/configure.py, sip/Qwt3D_Qt3_Module.sip, sip/Qwt3D_Qt4_Module.sip, sip/types.sip: Overhaul typedefs: - configure.py generates sip/types.sip - fix the OpenGL typedefs in the Qwt3D modules. 2006-09-16 12:54 gvermeul * MANIFEST.in: Prune the build files for the OpenGL module. 2006-09-16 11:02 gvermeul * GNUmakefile, configure/.cvsignore, configure/configure.py, examples/EnrichmentDemo.py, qt4examples/EnrichmentDemo.py, sip/OpenGL_Qt3_Module.sip, sip/OpenGL_Qt4_Module.sip, sip/OpenGL_mod.sip, sip/qwt3d_opengl.sip, sip/qwt3dmod.sip: Move the OpenGL interface to a separate module. 2006-09-16 10:10 gvermeul * COPYING.PyQwt3D, MANIFEST.in, Doc/pyqwt3d/copyright.tex, sip/Qwt3D_Qt3_Module.sip, sip/Qwt3D_Qt4_Module.sip, sip/STD_VECTOR_BASE, sip/STD_VECTOR_USER, sip/features.sip, sip/qwt3d_autoscaler.sip, sip/qwt3d_axis.sip, sip/qwt3d_axisvector.sip, sip/qwt3d_cell.sip, sip/qwt3d_cellfield.sip, sip/qwt3d_color.sip, sip/qwt3d_colorlegend.sip, sip/qwt3d_colorvector.sip, sip/qwt3d_coordsys.sip, sip/qwt3d_doublevector.sip, sip/qwt3d_drawable.sip, sip/qwt3d_enrichment.sip, sip/qwt3d_enrichment_std.sip, sip/qwt3d_freevectorfield.sip, sip/qwt3d_function.sip, sip/qwt3d_gridmapping.sip, sip/qwt3d_io.sip, sip/qwt3d_io_gl2ps.sip, sip/qwt3d_io_reader.sip, sip/qwt3d_label.sip, sip/qwt3d_mapping.sip, sip/qwt3d_opengl.sip, sip/qwt3d_openglhelper.sip, sip/qwt3d_parametricsurface.sip, sip/qwt3d_plot.sip, sip/qwt3d_portability.sip, sip/qwt3d_scale.sip, sip/qwt3d_surfaceplot.sip, sip/qwt3d_triplefield.sip, sip/qwt3d_types.sip, sip/qwt3dmod.sip: Give permission to link PyQwt3D dynamically with non-free versions of Qt and PyQt as long as Qt and PyQt are also released under the GPL. 2006-09-16 10:08 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Prepare release 0.1.2. 2006-09-16 09:38 gvermeul * examples/EnrichmentDemo.py, examples/Grab.py, examples/TestNumPy.py, qt4examples/EnrichmentDemo.py, qt4examples/Grab.py, qt4examples/TestNumPy.py, qt4examples/TestNumarray.py, qt4examples/TestNumeric.py: Add the EnrichmentDemo.py example (still to be finished). Fix the other examples as far as needed. 2006-09-16 09:02 gvermeul * MANIFEST.in, include.pyqwt3d.patch, configure/configure.py, include/.cvsignore, include/qwt3d_enrichment.h, qt4examples/AutoSwitch.py, qt4examples/PyFontify.py, qt4examples/SimplePlot.py, qt4examples/py2html.py, sip/qwt3d_enrichment.sip: Add a fake header to make a protected data member accessible to Python. 2006-09-15 21:34 gvermeul * GNUmakefile, configure/configure.py: Fix distclean target. Remove MSVC indicator. 2006-09-15 19:26 gvermeul * MANIFEST.in: Adapt directory pruning. 2006-09-15 08:34 gvermeul * MANIFEST.in, qt4examples/.cvsignore, qt4examples/ParametricSurfaceDemo.py: Start adding examples for Qt-4. 2006-09-15 08:07 gvermeul * sip/: qwt3d_drawable.sip, qwt3d_function.sip, qwt3d_parametricsurface.sip: Work around a SIP-4.4.x regression by defining private copy constructors. ---------------------------------------------------------------------- 2006-09-15 07:07 gvermeul * GNUmakefile, configure/.cvsignore, configure/configure.py, sip/Qwt3D_Qt3_Module.sip, sip/Qwt3D_Qt4_Module.sip, sip/features.sip, sip/qwt3d_plot.sip, sip/qwt3d_portability.sip, sip/qwt3d_surfaceplot.sip, sip/qwt3dmod.sip, sip/types.sip: Make PyQwt3D build for Qt-3 and Qt-4 with SIP-4.4.5. The examples do not yet run because of problems with virtual functions. 2006-09-14 07:45 gvermeul * sip/qwt3d_autoscaler.sip: Fix %TypeHeaderCode for SIP-4.4.5. 2006-09-14 07:40 gvermeul * GNUmakefile, MANIFEST.in, Makefile: Rename Makefile to GNUmakefile. ---------------------------------------------------------------------- 2006-09-14 07:37 gvermeul * sip/: qwt3d_plot.sip, qwt3d_portability.sip, qwt3dmod.sip: Add MouseState and KeyboardState for Qt-4. ---------------------------------------------------------------------- 2006-09-14 07:36 gvermeul * setup.py: Generate snapshots instead of releases. 2006-09-14 07:09 gvermeul * configure/configure.py, sip/qwt3d_autoscaler.sip, sip/qwt3d_drawable.sip, sip/qwt3d_function.sip, sip/qwt3d_opengl.sip, sip/qwt3d_parametricsurface.sip, sip/qwt3d_plot.sip, sip/qwt3d_surfaceplot.sip, sip/qwt3dmod.sip, sip/types.sip: Initial attempt to make PyQwt3D compile with SIP-4.4.5 and PyQt-4.0.1. 2006-09-14 07:02 gvermeul * Doc/Makefile: Use mkhowto from Python-2.4.3. 2006-02-21 19:26 gvermeul * sip/: qwt3d_autoscaler.sip, qwt3d_enrichment.sip, qwt3d_scale.sip: Add missing /Factory/ annotations. 2006-02-18 11:33 gvermeul * MANIFEST.in, configure/go.bat, sip/qwt3dmod.sip: Prepare release 0.1.1 2006-02-18 10:39 gvermeul * ANNOUNCEMENT-0.1.1.TXT, COPYING, MANIFEST.in, Makefile, PyQwt3D.spec, README, setup.py: Prepare release 0.1.1. 2006-02-18 10:38 gvermeul * Doc/pyqwt3d/: copyright.tex, pyqwt3d.tex: Update the documentation. 2006-02-18 08:31 gvermeul * configure/configure.py: Remove support for old SIP versions. Add support for NumPy. 2006-02-18 08:27 gvermeul * COPYING.PyQwt3D: Remove the exception from the license. 2006-02-18 08:24 gvermeul * numpy/: qwt3d_numarray.cpp, qwt3d_numarray.h, qwt3d_numeric.cpp, qwt3d_numeric.h, qwt3d_numpy.cpp, qwt3d_numpy.h, qwt3d_python.cpp, qwt3d_python.h: Add support for NumPy. Remove the special exception from the license. 2006-02-18 08:18 gvermeul * sip/: FILL, STD_VECTOR_BASE, STD_VECTOR_USER, features.sip, qwt3d_autoscaler.sip, qwt3d_axis.sip, qwt3d_axisvector.sip, qwt3d_cell.sip, qwt3d_cellfield.sip, qwt3d_color.sip, qwt3d_colorlegend.sip, qwt3d_colorvector.sip, qwt3d_coordsys.sip, qwt3d_doublevector.sip, qwt3d_drawable.sip, qwt3d_enrichment.sip, qwt3d_enrichment_std.sip, qwt3d_freevectorfield.sip, qwt3d_function.sip, qwt3d_gridmapping.sip, qwt3d_io.sip, qwt3d_io_gl2ps.sip, qwt3d_io_reader.sip, qwt3d_label.sip, qwt3d_mapping.sip, qwt3d_openglhelper.sip, qwt3d_parametricsurface.sip, qwt3d_plot.sip, qwt3d_scale.sip, qwt3d_surfaceplot.sip, qwt3d_triplefield.sip, qwt3d_types.sip, qwt3dmod.sip: Remove support for old SIP versions. Change license to plain GPL. 2006-02-18 07:53 gvermeul * sip/copying.sip: Remove copying.sip. 2006-02-18 07:43 gvermeul * configure/: fix-nc-moc.py, nc-go.bat: Remove support for old SIP versions. 2006-02-18 07:37 gvermeul * sip/timelines.sip: Remove support for old SIP versions. 2006-02-18 06:17 gvermeul * examples/: TestNumPy.py, TestNumarray.py, TestNumeric.py: Remove support for older SIP versions. Add support for NumPy. 2006-02-18 05:23 gvermeul * Doc/: Makefile, nospam.py, sourceforge.py: Use mkhowto & friends from Python source tree. 2006-02-18 05:13 gvermeul * .cvsignore: Exclude 3rd party sources. 2006-01-12 06:18 gvermeul * setup.py, configure/configure.py: Prepare a bug fix release. 2005-03-15 08:38 gvermeul * configure/configure.py: Fix typo in the license. 2005-03-15 08:14 gvermeul * configure/configure.py: Adapt the explicit scope resolution of POINTS for Windows to SIP-4.2.1. 2005-02-27 10:16 gvermeul * Makefile: Add forgotten 'symlinks' dependencies. Add parallel build to the 'all' target for multiprocessor systems. 2005-02-27 09:37 gvermeul * ANNOUNCEMENT-0.1.TXT, Doc/pyqwt3d/pyqwt3d.tex: Narrow down the prerequisites. 2005-02-27 09:36 gvermeul * .cvsignore: Ignore LOG.* files. 2005-02-27 09:20 gvermeul * configure/configure.py: Improve a comment and fix a typo. 2005-02-27 03:58 gvermeul * ANNOUNCEMENT-0.1.TXT, examples/AutoSwitch.py, examples/ParametricSurfaceDemo.py, examples/SimplePlot.py, examples/TestNumarray.py, examples/TestNumeric.py: A few more final(?) touches. 2005-02-26 17:23 gvermeul * configure/configure.py: Forgot to rename SIP_4_0 and SIP_4_1 to SIP_4_0_0 and SIP_4_1_0. 2005-02-26 16:57 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Prepare the release of PyQwt3D-0.1. 2005-02-26 16:31 gvermeul * ANNOUNCEMENT-0.1.TXT: Emphasize the output facilities. 2005-02-26 12:57 gvermeul * configure/configure.py, sip/qwt3d_io_gl2ps.sip, sip/qwt3d_io_reader.sip, sip/qwt3d_mapping.sip, sip/qwt3d_openglhelper.sip, sip/timelines.sip: Work around the SIP-4.2 failure to handle const * GLubyte gl_error(). Rename the SIP timelines, so that they take 3 digits instead of 2. 2005-02-26 03:54 gvermeul * ANNOUNCEMENT-0.1.TXT: Add a link to the examples. 2005-02-26 03:25 gvermeul * README: Do not duplicate information which can be found in Doc/html/pyqwt3d. 2005-02-26 03:13 gvermeul * examples/Grab.py: Grab the output of TestNumeric too. 2005-02-26 03:11 gvermeul * MANIFEST.in: Do not distribute examples/*.{html,pdf, png}. 2005-02-25 06:26 gvermeul * examples/Grab.py: A tool to grab the widgets 2005-02-25 06:23 gvermeul * examples/: Makefile, PyFontify.py, py2html.py: Tools to create fontified HTML 2005-02-25 06:21 gvermeul * examples/: AutoSwitch.py, TestNumarray.py, TestNumeric.py: Code cleanup. 2005-02-25 06:18 gvermeul * examples/ParametricSurfaceDemo.py: Code cleanup. 2005-02-25 06:15 gvermeul * examples/SimplePlot.py: Code clean-up. 2005-02-25 06:01 gvermeul * examples/.cvsignore: Ignore .html, .pdf, .png, and .pyc files. 2005-02-24 08:38 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Add build instruction for QtWin230-NonCommercial.exe. 2005-02-24 08:36 gvermeul * ANNOUNCEMENT-0.1.TXT: Prepare the release of PyQwt3D-0.1. 2005-02-23 08:12 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Prepare the release of PyQwt3D-0.1 2005-02-20 06:16 gvermeul * Makefile: Add support for ccache. Add tips to log the output of make (for debugging). 2005-02-20 05:25 gvermeul * configure/configure.py: Improve the help for the --timeline option. 2005-02-20 05:08 gvermeul * sip/qwt3d_openglhelper.sip: Comment out gl_error(), since it breaks SIP-4.2. 2005-02-20 03:57 gvermeul * numpy/: qwt3d_numarray.cpp, qwt3d_numarray.h, qwt3d_numeric.cpp, qwt3d_numeric.h, qwt3d_python.cpp, qwt3d_python.h: Update copyright dates 2005-02-19 08:41 gvermeul * sip/qwt3d_plot.sip: Try to fix a Windows problem by using sipMapStringToClass. 2005-01-23 15:19 gvermeul * examples/ParametricSurfaceDemo.py: Shows how the Python slot __call__ interfaces to the C++ operator()(). 2005-01-23 15:06 gvermeul * configure/configure.py: Adapted the __init__.py generation to the upcoming release of SIP-4.2. 2005-01-23 14:09 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Completed the class reference documentation. 2005-01-23 08:25 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Update for the future release of SIP-4.2. A few tweaks in the class reference. 2005-01-23 07:32 gvermeul * Doc/pyqwt3d/copyright.tex: Update copyright date. 2005-01-23 06:58 gvermeul * sip/: FILL, STD_VECTOR_BASE, STD_VECTOR_USER, features.sip, qwt3d_autoscaler.sip, qwt3d_axis.sip, qwt3d_axisvector.sip, qwt3d_cell.sip, qwt3d_cellfield.sip, qwt3d_colorlegend.sip, qwt3d_colorvector.sip, qwt3d_coordsys.sip, qwt3d_doublevector.sip, qwt3d_drawable.sip, qwt3d_enrichment.sip, qwt3d_enrichment_std.sip, qwt3d_freevectorfield.sip, qwt3d_gridmapping.sip, qwt3d_label.sip, qwt3d_openglhelper.sip, qwt3d_plot.sip, qwt3d_scale.sip, qwt3d_surfaceplot.sip, qwt3d_triplefield.sip, qwt3d_types.sip: Update copyright dates. 2005-01-23 06:54 gvermeul * configure/configure.py: Differentiate between SIP versions with a timeline instead of features. 2005-01-23 06:50 gvermeul * sip/: timelines.sip, qwt3d_io_reader.sip, qwt3d_mapping.sip, qwt3dmod.sip: Differentiate between SIP versions with a timeline instead of features. 2005-01-23 06:44 gvermeul * sip/qwt3d_io_gl2ps.sip: Differentiate between SIP versions with a timeline instead of features. 2004-12-10 04:06 gvermeul * configure/configure.py: Add option groups. Also install the .sip files specific to SIP-4.0.x, -4.1.x or -4.2.x. 2004-12-09 21:50 gvermeul * sip/qwt3d_color.sip: Make qwt3d_color.sip also SIP specific 2004-12-09 20:52 gvermeul * configure/configure.py: Fix typo 2004-12-09 08:05 gvermeul * MANIFEST.in: Create separate directories for SIP-4.0.x, -4.1.x and -4.2.x for difficult .sip files. 2004-12-09 07:45 gvermeul * configure/configure.py: Create separate directories for SIP-4.0.x, -4.1.x and -4.2.x for difficult .sip files. 2004-12-09 07:45 gvermeul * sip/: qwt3d_function.sip, qwt3d_io.sip, qwt3d_mapping.sip, qwt3d_parametricsurface.sip: Move difficult .sip files to separate directories. 2004-12-08 21:57 gvermeul * configure/configure.py: Generate a different __init__.py file for SIP-4.2.x than for SIP-4.1.x and SIP-4.0.x. 2004-12-08 07:56 gvermeul * sip/qwt3d_io.sip: Enable the 'virtual bool operator()(..) = 0' for SIP-4.2.x. 2004-12-08 07:42 gvermeul * sip/: qwt3d_io_gl2ps.sip, qwt3d_io.sip: Add initial support for the snapshots leading to SIP-4.2.x. 2004-12-08 07:22 gvermeul * sip/: qwt3d_color.sip, qwt3d_function.sip, qwt3d_parametricsurface.sip: Add support for the snapshots leading to SIP-4.2.x. Drop support for SIP-3.11.x. 2004-12-08 07:18 gvermeul * configure/configure.py, sip/features.sip: Add support for the snapshots leading to SIP-4.2.x. Drop support for SIP-3.11.x. 2004-12-02 18:33 gvermeul * configure/nc-go.bat: Add comments. 2004-12-02 18:01 gvermeul * configure/nc-go.bat: Batch file for QtWin230-NC to work around MSVC and/or tmake quirks. 2004-12-01 08:30 gvermeul * Doc/pyqwt3d/.cvsignore: Ignore configure.help. 2004-12-01 08:29 gvermeul * Doc/pyqwt3d/configure.help: Remove configure.help, because it is automatically generated. 2004-12-01 08:25 gvermeul * Doc/Makefile: Make pyqwt3d/configure.help depend on ../configure/configure.py. 2004-12-01 08:19 gvermeul * MANIFEST.in: Kill warning messages. 2004-12-01 08:17 gvermeul * MANIFEST.in: Add the important files of the zlib-1.2.1 library to the source distribution. 2004-12-01 08:01 gvermeul * Makefile: Use the -Z option in the 'static' target. 2004-12-01 07:59 gvermeul * configure/configure.py: Add the possibility to compile and link the sources of zlib statically into the PyQwt3D module. 2004-12-01 07:50 gvermeul * .cvsignore: Ignore zlib-1.2.1. 2004-11-30 22:41 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Update the status on MSVC-6.0 2004-11-30 20:38 gvermeul * MANIFEST.in: Do not distribute backup and CVS files. 2004-11-30 20:21 gvermeul * configure/fix-nc-moc.py: Patch the output of moc included with QtWin230-NonCommercial.exe. 2004-11-30 08:06 gvermeul * MANIFEST.in, Makefile: Add qwtplot3d-0.2.4-beta-patched. 2004-11-30 07:40 gvermeul * .cvsignore: Ignore qwtplot3d-0.2.4-beta-patched. 2004-11-29 02:07 gvermeul * configure/configure.py: Minor editing. 2004-11-29 01:50 gvermeul * configure/configure.py: Reorganize to copy and generate all files into the temporary build directory. Rename lazy_copy_sip_output_file() to lazy_copy_file(). 2004-11-28 11:19 gvermeul * sip/qwt3d_plot.sip: Disable the %ConvertToSubClassCode section in Plot3D for MSVC on Windows, because importing Qwt3D on that platform with the %ConvertToSubClassCode section enabled leaves the Python interpreter in a weird state: it crashes when using an undefined name instead of raising a NameError. 2004-11-28 01:36 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Note the MSVC-6.0 problem. 2004-11-27 09:04 gvermeul * configure/configure.py: Factor out the fixing of the SIP build file 2004-11-25 17:39 gvermeul * Makefile: Add install target 2004-11-24 07:07 gvermeul * examples/: TestNumarray.py, TestNumeric.py: Enable tracing of the SIP generated bindings 2004-11-24 06:34 gvermeul * Makefile, Doc/pyqwt3d/configure.help, configure/configure.py: Facilitate debugging and tracing 2004-11-23 22:17 gvermeul * configure/configure.py: More streamlining 2004-11-23 20:56 gvermeul * sip/qwt3d_surfaceplot.sip: Introduce PYQWT3D_DEBUG to rationalize debugging. 2004-11-23 20:21 gvermeul * sip/qwt3d_function.sip: Document the limits of SIP with respect to an 'abstract virtual operator()'. 2004-11-23 08:31 gvermeul * configure/configure.py: Make PyQwt3D working with SIP-3.11.x 2004-11-23 07:32 gvermeul * configure/configure.py: Fix error in configuration for SIP-3.11.x 2004-11-23 07:24 gvermeul * Doc/pyqwt3d/: StdVectorExample.txt, pyqwt3d.tex: Started the module reference 2004-11-23 06:39 gvermeul * README: Fix typo and formatting 2004-11-22 18:31 gvermeul * configure/configure.py: The count() method of a list takes 1 argument 2004-11-22 08:25 gvermeul * Doc/pyqwt3d/configure.help, configure/configure.py: Fix typo 2004-11-22 08:20 gvermeul * Doc/pyqwt3d/: configure.help, pyqwt3d.tex: Fix a few typos and imprecisions 2004-11-22 08:17 gvermeul * configure/configure.py: Add concatenation of SIP generated source files to speed up compilation. Generalize: #Windows fix: resolve the scope of POINTS in enumValues[]. 2004-11-22 08:12 gvermeul * PyQwt3D.spec: Concatenate SIP generated source code and take advantage of multiple processors to reduce the build time. 2004-11-20 12:17 gvermeul * Doc/pyqwt3d/pyqwt3d.tex: Fix typos 2004-11-20 12:11 gvermeul * Doc/pyqwt3d/configure.help, Doc/pyqwt3d/pyqwt3d.tex, configure/configure.py, configure/go.bat: Improve the installation tools and the documentation 2004-11-20 08:36 gvermeul * PyQwt3D.spec: Add the documentation 2004-11-20 08:27 gvermeul * MANIFEST.in: Provide all tools to regenerate the documentation 2004-11-20 08:13 gvermeul * Makefile: Update documentation before a source distribution 2004-11-20 08:07 gvermeul * MANIFEST.in: Zap unnecessary files 2004-11-20 07:55 gvermeul * Doc/html/icons/: blank.png, contents.png, index.png, modules.png, next.png, previous.png, pyfav.png, up.png: Fill documentation directory 2004-11-20 07:51 gvermeul * Doc/html/: .cvsignore, about.dat, style.css: Fill documentation directory 2004-11-20 07:48 gvermeul * Doc/pyqwt3d/: configure.help, copyright.tex, pyqwt3d.tex: Fill documentation directory 2004-11-20 07:43 gvermeul * Doc/: .cvsignore, Makefile: Fill documentation directory 2004-11-20 07:42 gvermeul * MANIFEST.in: Add documentation to source distribution 2004-11-20 02:52 gvermeul * MANIFEST.in, Makefile: Make "make dist" more developer friendly 2004-11-20 02:35 gvermeul * MANIFEST.in, THANKS: Add THANKS 2004-11-20 02:27 gvermeul * configure/: configure.py, go.bat: Do more refactoring. Make sure that __init__.py exists, if it has been deleted (Jay O'Connor). Hardwire as much options as possible for Windows. 2004-11-19 08:19 gvermeul * configure/: configure.py, go.bat: Code cleanup and addition of the -x option 2004-11-19 08:18 gvermeul * configure/.cvsignore: Ignore *.pyc 2004-11-19 08:17 gvermeul * numpy/: qwt3d_numarray.cpp, qwt3d_numeric.cpp: Remove debugging code 2004-11-19 06:24 gvermeul * sip/: FILL, qwt3d_axisvector.sip, qwt3d_cell.sip, qwt3d_cellfield.sip, qwt3d_colorvector.sip, qwt3d_doublevector.sip, qwt3d_freevectorfield.sip, qwt3d_triplefield.sip: Zap some "using namespace std;" 2004-11-18 21:56 gvermeul * Makefile, configure/configure.py: Add an option to compile and link QwtPlot3D statically into PyQwt3D 2004-11-18 21:54 gvermeul * sip/qwt3d_types.sip: Let configure.py patch POINTS to Qwt3D::Points 2004-11-18 15:32 gvermeul * configure/go.bat: An example of "python configure.py [options]" on Windows 2004-11-18 15:30 gvermeul * sip/features.sip, sip/qwt3d_color.sip, sip/qwt3d_parametricsurface.sip, sip/qwt3d_surfaceplot.sip, sip/qwt3d_types.sip, configure/configure.py: Work around limitations of MSVC-6.0 2004-11-18 08:02 gvermeul * configure/configure.py: Path separator fixes for Windows 2004-11-17 22:09 gvermeul * configure/configure.py, sip/features.sip, sip/qwt3d_color.sip, sip/qwt3d_function.sip, sip/qwt3d_parametricsurface.sip: First step towards compatibility with SIP-3.11.x 2004-11-17 07:22 gvermeul * Makefile: Use of 'python configure.py' imports the correct 'pyqtconfig'. 2004-11-17 06:57 gvermeul * sip/: features.sip, qwt3d_io.sip, qwt3d_io_gl2ps.sip, qwt3d_io_reader.sip: Rename SIP identification features 2004-11-16 19:58 gvermeul * README: PyQwt3D works with numarray on SuSE-9.1. 2004-11-16 08:11 gvermeul * sip/features.sip, sip/qwt3d_io.sip, sip/qwt3d_io_gl2ps.sip, sip/qwt3d_io_reader.sip, configure/configure.py: Build fixes for SIP-4.0 2004-11-15 07:31 gvermeul * configure/configure.py: Fix typo. 2004-11-14 13:03 gvermeul * README: Complete README 2004-11-14 11:47 gvermeul * configure/configure.py: Fleshed out the Makefile options 2004-11-14 08:07 gvermeul * configure/.cvsignore: Ignore build directories 2004-11-14 07:58 gvermeul * .cvsignore, COPYING.PyQwt3D, MANIFEST.in, Makefile, PyQwt3D.spec, README, TODO, setup.cfg, setup.py, COPYING, sip/FILL, sip/qwt3d_gridmapping.sip, sip/qwt3d_io_reader.sip, sip/qwt3d_enrichment_std.sip, sip/qwt3d_surfaceplot.sip, sip/qwt3d_axis.sip, sip/qwt3d_coordsys.sip, sip/qwt3d_doublevector.sip, sip/qwt3d_drawable.sip, sip/qwt3d_freevectorfield.sip, sip/qwt3d_io.sip, sip/qwt3d_parametricsurface.sip, sip/qwt3dmod.sip, sip/copying.sip, sip/qwt3d_color.sip, sip/qwt3d_colorlegend.sip, sip/qwt3d_enrichment.sip, sip/qwt3d_mapping.sip, sip/qwt3d_openglhelper.sip, sip/qwt3d_triplefield.sip, sip/types.sip, sip/features.sip, sip/qwt3d_autoscaler.sip, sip/qwt3d_cell.sip, sip/qwt3d_colorvector.sip, sip/qwt3d_io_gl2ps.sip, sip/qwt3d_label.sip, sip/qwt3d_plot.sip, numpy/qwt3d_numarray.h, numpy/qwt3d_python.cpp, sip/STD_VECTOR_BASE, sip/STD_VECTOR_USER, sip/qwt3d_axisvector.sip, sip/qwt3d_cellfield.sip, sip/qwt3d_function.sip, sip/qwt3d_scale.sip, sip/qwt3d_types.sip, numpy/qwt3d_numarray.cpp, numpy/qwt3d_numeric.cpp, numpy/qwt3d_numeric.h, numpy/qwt3d_python.h, configure/configure.py, examples/AutoSwitch.py, examples/SimplePlot.py, examples/TestNumarray.py, examples/TestNumeric.py: Initial import. 2004-11-14 07:58 gvermeul * .cvsignore, COPYING.PyQwt3D, MANIFEST.in, Makefile, PyQwt3D.spec, README, TODO, setup.cfg, setup.py, COPYING, sip/FILL, sip/qwt3d_gridmapping.sip, sip/qwt3d_io_reader.sip, sip/qwt3d_enrichment_std.sip, sip/qwt3d_surfaceplot.sip, sip/qwt3d_axis.sip, sip/qwt3d_coordsys.sip, sip/qwt3d_doublevector.sip, sip/qwt3d_drawable.sip, sip/qwt3d_freevectorfield.sip, sip/qwt3d_io.sip, sip/qwt3d_parametricsurface.sip, sip/qwt3dmod.sip, sip/copying.sip, sip/qwt3d_color.sip, sip/qwt3d_colorlegend.sip, sip/qwt3d_enrichment.sip, sip/qwt3d_mapping.sip, sip/qwt3d_openglhelper.sip, sip/qwt3d_triplefield.sip, sip/types.sip, sip/features.sip, sip/qwt3d_autoscaler.sip, sip/qwt3d_cell.sip, sip/qwt3d_colorvector.sip, sip/qwt3d_io_gl2ps.sip, sip/qwt3d_label.sip, sip/qwt3d_plot.sip, numpy/qwt3d_numarray.h, numpy/qwt3d_python.cpp, sip/STD_VECTOR_BASE, sip/STD_VECTOR_USER, sip/qwt3d_axisvector.sip, sip/qwt3d_cellfield.sip, sip/qwt3d_function.sip, sip/qwt3d_scale.sip, sip/qwt3d_types.sip, numpy/qwt3d_numarray.cpp, numpy/qwt3d_numeric.cpp, numpy/qwt3d_numeric.h, numpy/qwt3d_python.h, configure/configure.py, examples/AutoSwitch.py, examples/SimplePlot.py, examples/TestNumarray.py, examples/TestNumeric.py: Initial revision PyQwt3D-pyqwt3d-0.1.8/Doc/000077500000000000000000000000001334664011000151075ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/Doc/Makefile000066400000000000000000000017621334664011000165550ustar00rootroot00000000000000MKHOWTO := $(HOME)/CVS/PyQwt/BUILD/Python-2.5.2/Doc/tools/mkhowto SOURCES := \ pyqwt3d/configure.help \ pyqwt3d/copyright.tex \ pyqwt3d/pyqwt3d.tex doc: $(SOURCES) if [ ! -e html/pyqwt3d ]; then mkdir html/pyqwt3d; fi (cd html/pyqwt3d; rm -f *.css *.dat *.html *.idx *.old *.pl *.gif) cp -p html/icons/*.png html/pyqwt3d python $(MKHOWTO) --html --dir html/pyqwt3d \ --image-type png --favicon pyfav.png \ --up-link http://pyqwt.sourceforge.net --up-title "PyQwt Home" \ pyqwt3d/pyqwt3d.tex (cd html/pyqwt3d; rm -f *.dat *.idx *.old *.pl *.gif) python nospam.py html/pyqwt3d/*.html date -u "+%Y-%m-%d %T" > doc htdoc: doc $(SOURCES) if [ ! -e html/htdoc ]; then mkdir html/htdoc; fi (cd html/htdoc; rm -f *.css *.dat *.html *.idx *.old *.pl *.gif) cp -pr html/pyqwt3d/* html/htdoc python sourceforge.py html/htdoc/*.html date -u "+%Y-%m-%d %T" > htdoc pyqwt3d/configure.help: ../configure/configure.py python ../configure/configure.py --help > pyqwt3d/configure.help # EOF PyQwt3D-pyqwt3d-0.1.8/Doc/html/000077500000000000000000000000001334664011000160535ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/Doc/html/about.dat000066400000000000000000000016601334664011000176620ustar00rootroot00000000000000

This document was generated using the LaTeX2HTML translator.

LaTeX2HTML is Copyright © 1993, 1994, 1995, 1996, 1997, Nikos Drakos, Computer Based Learning Unit, University of Leeds, and Copyright © 1997, 1998, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The application of LaTeX2HTML to the Python documentation has been heavily tailored by Fred L. Drake, Jr. Original navigation icons were contributed by Christopher Petrilli.

PyQwt3D-pyqwt3d-0.1.8/Doc/html/icons/000077500000000000000000000000001334664011000171665ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/Doc/html/icons/blank.png000066400000000000000000000020071334664011000207620ustar00rootroot00000000000000‰PNG  IHDR D¤ŠÆPLTE 3f™Ìÿ333f3™3Ì3ÿ3f3fff™fÌfÿf™3™f™™™Ì™ÿ™Ì3ÌfÌ™ÌÌÌÿÌÿ3ÿfÿ™ÿÌÿÿÿ333f3™3Ì3ÿ333333f33™33Ì33ÿ33f33f3ff3™f3Ìf3ÿf3™33™3f™3™™3Ì™3ÿ™3Ì33Ì3fÌ3™Ì3ÌÌ3ÿÌ3ÿ33ÿ3fÿ3™ÿ3Ìÿ3ÿÿ3f3fff™fÌfÿf3f33ff3f™3fÌ3fÿ3fff3fffff™ffÌffÿff™f3™ff™f™™fÌ™fÿ™fÌf3ÌffÌf™ÌfÌÌfÿÌfÿf3ÿffÿf™ÿfÌÿfÿÿf™3™f™™™Ì™ÿ™3™33™f3™™3™Ì3™ÿ3™f™3f™ff™™f™Ìf™ÿf™™™3™™f™™™™™Ì™™ÿ™™Ì™3Ì™fÌ™™Ì™ÌÌ™ÿÌ™ÿ™3ÿ™fÿ™™ÿ™Ìÿ™ÿÿ™Ì3ÌfÌ™ÌÌÌÿÌ3Ì33Ìf3Ì™3ÌÌ3Ìÿ3ÌfÌ3fÌffÌ™fÌÌfÌÿfÌ™Ì3™Ìf™Ì™™ÌÌ™Ìÿ™ÌÌÌ3ÌÌfÌÌ™ÌÌÌÌÌÿÌÌÿÌ3ÿÌfÿÌ™ÿÌÌÿÌÿÿÌÿ3ÿfÿ™ÿÌÿÿÿ3ÿ33ÿf3ÿ™3ÿÌ3ÿÿ3ÿfÿ3fÿffÿ™fÿÌfÿÿfÿ™ÿ3™ÿf™ÿ™™ÿÌ™ÿÿ™ÿÌÿ3ÌÿfÌÿ™ÌÿÌÌÿÿÌÿÿÿ3ÿÿfÿÿ™ÿÿÌÿÿÿÿÿâââãããäääåååæææçççèèèéééêêêëëëìììíííîîîïïïðððñññòòòóóóôôôõõõööö÷÷÷øøøùùùúúúûûûüüüýýýþþþÿÿÿCA×bKGDˆHIDATxÚc¸I0Œ*U0ª`¤*­d.¡ç®CtEXtSoftware@(#)ImageMagick 4.2.8 99/08/01 cristy@mystic.es.dupont.com‘º!¸*tEXtSignature0ac660e469fb3b89a555665df224a4beó –ûtEXtPage32x32+0+0çS2ðIEND®B`‚PyQwt3D-pyqwt3d-0.1.8/Doc/html/icons/contents.png000066400000000000000000000012111334664011000215240ustar00rootroot00000000000000‰PNG  IHDR D¤ŠÆ`PLTEÿÿÿ™ÌÿÂõ†¹ì|¯âs¦ÙiœÏ_’ÅV‰¼L²Cv©:m 0c–&YŒPƒFy =p3f?0­bKGD{¼lIDATxÚÍ’Ý’Ã …‹‚ ÆÞÿe1I»7íMgg3™xF>`|À‡çñüdydÍïlª•O'>hGBa®a¤ƒV8 +šVœ†½ï¨Õ—é‹v/ºŒæÜ{R˜38 wJŒhº"U‹o. i|ÂM-àI3è¯S$e¯Ú|§ÚÈEåoˆ3£vë èR°,߬3.7wè€å`ZËjúhF Ö ™¥Ø*eSü@Q_É ª¹ËÃLzTXtSoftwarexÚsÐPÖôÌMLOõMLÏLÎV0Ñ3Ò3R°´Ô70Õ70TH.Ê,.©tÈ­,.ÉLÖK-ÖK)-ÈÏ+ÑKÎÏôK€ôÝÄ^3zTXtSignaturexÚK²05K3K124H1266KJL3M5420¶4I´07µ0‹è.iê zTXtPagexÚ36ª06Ò6Ð6 šùGwÃIEND®B`‚PyQwt3D-pyqwt3d-0.1.8/Doc/html/icons/next.png000066400000000000000000000007771334664011000206650ustar00rootroot00000000000000‰PNG  IHDR D¤ŠÆ`PLTEÿÿÿ™ÌÿÂõ†¹ì|¯âs¦ÙiœÏ_’ÅV‰¼L²Cv©:m 0c–&YŒPƒ =p3f]ž=ÆbKGDâµ=º“IDATxÚÍ“ÁÂ0Dc@©‰ ùÿ¯•‚vͶã­{åMf¥értF@š‡ñ u¬Q‚@îNô ;:ñÀ%ÙQ°…!X³ÁxmS1 ZOc*ŒTx×ô®<Ø wæçüqþžh“A,Z~LzTXtSoftwarexÚsÐPÖôÌMLOõMLÏLÎV0Ñ3Ò3R°´Ô70Õ70TH.Ê,.©tÈ­,.ÉLÖK-ÖK)-ÈÏ+ÑKÎÏôK€ôÝÄ^3zTXtSignaturexÚ3231³´L47374K11426NL31·05L210HL3|nÐɾÈÄzTXtPagexÚ36ª06Ò6Ð6 šùGwÃIEND®B`‚PyQwt3D-pyqwt3d-0.1.8/Doc/html/icons/previous.png000066400000000000000000000007771334664011000215630ustar00rootroot00000000000000‰PNG  IHDR D¤ŠÆ`PLTEÿÿÿ™ÌÿÂõ†¹ì|¯âs¦ÙiœÏ_’ÅV‰¼L²Cv©:m 0c–&YŒPƒFy =p3f?0­bKGD{¼l“IDATxÚÕ’Aà DiIZ¼ÿe›€/Ù8vÛÎvþÃ$Ä/ ¿H5=°÷SÊ`óƒ'R3¿ÈÀjþŽBŠûj±yóìZLŒL ª´N€×„l-è1°wA4ð=r`Ð?7cÀj&$p¼ÇhÐá,²@ׄxx¢® 3LzTXtSoftwarexÚsÐPÖôÌMLOõMLÏLÎV0Ñ3Ò3R°´Ô70Õ70TH.Ê,.©tÈ­,.ÉLÖK-ÖK)-ÈÏ+ÑKÎÏôK€ôÝÄ^3zTXtSignaturexÚ304L³0JL4M4KI4H56µ4L¶L444H40µ421vC·[̓zTXtPagexÚ36ª06Ò6Ð6 šùGwÃIEND®B`‚PyQwt3D-pyqwt3d-0.1.8/Doc/html/style.css000066400000000000000000000230631334664011000177310ustar00rootroot00000000000000/* * The first part of this is the standard CSS generated by LaTeX2HTML, * with the "empty" declarations removed. */ /* Century Schoolbook font is very similar to Computer Modern Math: cmmi */ .math { font-family: "Century Schoolbook", serif; } .math i { font-family: "Century Schoolbook", serif; font-weight: bold } .boldmath { font-family: "Century Schoolbook", serif; font-weight: bold } /* * Implement both fixed-size and relative sizes. * * I think these can be safely removed, as it doesn't appear that * LaTeX2HTML ever generates these, even though these are carried * over from the LaTeX2HTML stylesheet. */ small.xtiny { font-size : xx-small; } small.tiny { font-size : x-small; } small.scriptsize { font-size : smaller; } small.footnotesize { font-size : small; } big.xlarge { font-size : large; } big.xxlarge { font-size : x-large; } big.huge { font-size : larger; } big.xhuge { font-size : xx-large; } /* * Document-specific styles come next; * these are added for the Python documentation. * * Note that the size specifications for the H* elements are because * Netscape on Solaris otherwise doesn't get it right; they all end up * the normal text size. */ body { color: #000000; background-color: #ffffff; } a:link:active { color: #ff0000; } a:link:hover { background-color: #bbeeff; } a:visited:hover { background-color: #bbeeff; } a:visited { color: #551a8b; } a:link { color: #0000bb; } h1, h2, h3, h4, h5, h6 { font-family: avantgarde, sans-serif; font-weight: bold; } h1 { font-size: 180%; } h2 { font-size: 150%; } h3, h4 { font-size: 120%; } /* These are section titles used in navigation links, so make sure we * match the section header font here, even it not the weight. */ .sectref { font-family: avantgarde, sans-serif; } /* And the label before the titles in navigation: */ .navlabel { font-size: 85%; } /* LaTeX2HTML insists on inserting
elements into headers which * are marked with \label. This little bit of CSS magic ensures that * these elements don't cause spurious whitespace to be added. */ h1>br, h2>br, h3>br, h4>br, h5>br, h6>br { display: none; } code, tt { font-family: "lucida typewriter", lucidatypewriter, monospace; } var { font-family: times, serif; font-style: italic; font-weight: normal; } .Unix { font-variant: small-caps; } .typelabel { font-family: lucida, sans-serif; } .navigation td { background-color: #99ccff; font-weight: bold; font-family: avantgarde, sans-serif; font-size: 110%; } div.warning { background-color: #fffaf0; border: thin solid black; padding: 1em; margin-left: 2em; margin-right: 2em; } div.warning .label { font-family: sans-serif; font-size: 110%; margin-right: 0.5em; } div.note { background-color: #fffaf0; border: thin solid black; padding: 1em; margin-left: 2em; margin-right: 2em; } div.note .label { margin-right: 0.5em; font-family: sans-serif; } address { font-size: 80%; } .release-info { font-style: italic; font-size: 80%; } .titlegraphic { vertical-align: top; } .verbatim pre { color: #00008b; font-family: "lucida typewriter", lucidatypewriter, monospace; font-size: 90%; } .verbatim { margin-left: 2em; } .verbatim .footer { padding: 0.05in; font-size: 85%; background-color: #99ccff; margin-right: 0.5in; } .grammar { background-color: #99ccff; margin-right: 0.5in; padding: 0.05in; } .grammar-footer { padding: 0.05in; font-size: 85%; } .grammartoken { font-family: "lucida typewriter", lucidatypewriter, monospace; } .productions { background-color: #bbeeff; } .productions a:active { color: #ff0000; } .productions a:link:hover { background-color: #99ccff; } .productions a:visited:hover { background-color: #99ccff; } .productions a:visited { color: #551a8b; } .productions a:link { color: #0000bb; } .productions table { vertical-align: baseline; empty-cells: show; } .productions > table td, .productions > table th { padding: 2px; } .productions > table td:first-child, .productions > table td:last-child { font-family: "lucida typewriter", lucidatypewriter, monospace; } /* same as the second selector above, but expressed differently for Opera */ .productions > table td:first-child + td + td { font-family: "lucida typewriter", lucidatypewriter, monospace; vertical-align: baseline; } .productions > table td:first-child + td { padding-left: 1em; padding-right: 1em; } .productions > table tr { vertical-align: baseline; } .email { font-family: avantgarde, sans-serif; } .mailheader { font-family: avantgarde, sans-serif; } .mimetype { font-family: avantgarde, sans-serif; } .newsgroup { font-family: avantgarde, sans-serif; } .url { font-family: avantgarde, sans-serif; } .file { font-family: avantgarde, sans-serif; } .guilabel { font-family: avantgarde, sans-serif; } .realtable { border-collapse: collapse; border-color: black; border-style: solid; border-width: 0px 0px 2px 0px; empty-cells: show; margin-left: auto; margin-right: auto; padding-left: 0.4em; padding-right: 0.4em; } .realtable tbody { vertical-align: baseline; } .realtable tfoot { display: table-footer-group; } .realtable thead { background-color: #99ccff; border-width: 0px 0px 2px 1px; display: table-header-group; font-family: avantgarde, sans-serif; font-weight: bold; vertical-align: baseline; } .realtable thead :first-child { border-width: 0px 0px 2px 0px; } .realtable thead th { border-width: 0px 0px 2px 1px } .realtable td, .realtable th { border-color: black; border-style: solid; border-width: 0px 0px 1px 1px; padding-left: 0.4em; padding-right: 0.4em; } .realtable td:first-child, .realtable th:first-child { border-left-width: 0px; vertical-align: baseline; } .center { text-align: center; } .left { text-align: left; } .right { text-align: right; } .refcount-info { font-style: italic; } .refcount-info .value { font-weight: bold; color: #006600; } /* * Some decoration for the "See also:" blocks, in part inspired by some of * the styling on Lars Marius Garshol's XSA pages. * (The blue in the navigation bars is #99CCFF.) */ .seealso { background-color: #fffaf0; border: thin solid black; padding: 0pt 1em 4pt 1em; } .seealso > .heading { font-size: 110%; font-weight: bold; } /* * Class 'availability' is used for module availability statements at * the top of modules. */ .availability .platform { font-weight: bold; } /* * Additional styles for the distutils package. */ .du-command { font-family: monospace; } .du-option { font-family: avantgarde, sans-serif; } .du-filevar { font-family: avantgarde, sans-serif; font-style: italic; } .du-xxx:before { content: "** "; font-weight: bold; } .du-xxx:after { content: " **"; font-weight: bold; } /* * Some specialization for printed output. */ @media print { .online-navigation { display: none; } } PyQwt3D-pyqwt3d-0.1.8/Doc/nospam.py000066400000000000000000000023221334664011000167550ustar00rootroot00000000000000#!/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) # hide() 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: *** PyQwt3D-pyqwt3d-0.1.8/Doc/pyqwt3d/000077500000000000000000000000001334664011000165225ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/Doc/pyqwt3d/StdVectorExample.txt000066400000000000000000000012111334664011000225070ustar00rootroot00000000000000>>> from Qwt3D import * >>> tf = TripleField() >>> tf.push_back(Triple(0.0, 1.0, 2.0)) >>> tf.push_back(Triple(1.0, 2.0, 3.0)) >>> for t in tf: # thanks to __getitem__ ... print t.x, t.y, t.z ... 0.0 1.0 2.0 1.0 2.0 3.0 >>> for i in range(len(tf)): # thanks to __len__ ... print tf[i].x, tf[i].y, tf[i].z ... 0.0 1.0 2.0 1.0 2.0 3.0 >>> for i in range(len(tf)): # thanks to __len__ ... tf[i] = Triple(i, 2*i, 3*i) # thanks to __setitem__ ... >>> for t in tf: # thanks to __getitem__ ... print t.x, t.y, t.z ... 0.0 0.0 0.0 1.0 2.0 3.0 >>> PyQwt3D-pyqwt3d-0.1.8/Doc/pyqwt3d/copyright.tex000066400000000000000000000022551334664011000212600ustar00rootroot00000000000000Copyright \copyright{} 2004-2007 Gerard Vermeulen PyQwt3D 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. PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, PyQwt3D becomes a free plug-in for a non-free program. %% Local Variables: %% fill-column: 79 %% End: PyQwt3D-pyqwt3d-0.1.8/Doc/pyqwt3d/pyqwt3d.tex000066400000000000000000000646261334664011000206750ustar00rootroot00000000000000\documentclass{manual} % Links \newcommand{\QwtPlotDdd}{\ulink{QwtPlot3D} {http://qwtplot3d.sourceforge.net}} \newcommand{\QwtPlotDddApi}{\ulink{QwtPlot3D API documentation} {http://qwtplot3d.sourceforge.net/web/navigation/api_frame.html}} \newcommand{\QwtPlotDddManual}{\ulink{QwtPlot3D manual} {http://qwtplot3d.sourceforge.net/web/navigation/manual_frame.html}} \newcommand{\ZLib}{\ulink{ZLib} {http://www.gzip.org/zlib}} \newcommand{\mailinglist}{\ulink{mailing list} {mailto:pyqwt-users@lists.sourceforge.net}} % Source code \newcommand{\NumPy}{\ulink{NumPy} {http://www.numpy.org}} \newcommand{\NumPyTarGz}{\ulink{numpy-1.0.3} {http://prdownloads.sourceforge.net/numpy/numpy-1.0.3.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{\NewSip}{\ulink{sip-4.7.tar.gz} {http://pyqwt.sourceforge.net/support/sip-4.7.tar.gz}} \newcommand{\PyQtGpl}{\ulink{PyQt-x11-gpl-3.17.3.tar.gz} {http://pyqwt.sourceforge.net/support/PyQt-x11-gpl-3.17.3.tar.gz}} \newcommand{\PyQtMac}{\ulink{PyQt-mac-gpl-3.17.2.tar.gz} {http://pyqwt.sourceforge.net/support/PyQt-mac-gpl-3.17.3/tar.gz}} \newcommand{\PyQtFGpl}{\ulink{PyQt4-x11-gpl-4.3.tar.gz} {http://pyqwt.sourceforge.net/support/PyQt-x11-gpl-4.3.tar.gz}} \newcommand{\PyQtFMac}{\ulink{PyQt4-mac-gpl-4.3.tar.gz} {http://pyqwt.sourceforge.net/support/PyQt-mac-gpl-4.3.tar.gz}} \newcommand{\PyQtCom}{\ulink{PyQt-commercial} {http://www.riverbankcomputing.co.uk/pyqt/buy.php}} \newcommand{\PyQwtDddTarGz}{\ulink{PyQwt3D-0.1.6.tar.gz} {http://prdownloads.sourceforge.net/pyqwt/PyQwt3D-0.1.6.tar.gz?download}} \newcommand{\QwtPlotDddTgz}{\ulink{qwtplot3d-0.2.7.tgz} {http://prdownloads.sourceforge.net/qwtplot3d/qwtplot3d-0.2.7.tgz?download}} \newcommand{\QwtPlotDddZip}{\ulink{qwtplot3d-0.2.7.zip} {http://prdownloads.sourceforge.net/qwtplot3d/qwtplot3d-0.2.7.zip?download}} \newcommand{\Examples}{\ulink{PyQwt3D examples} {http://pyqwt.sourceforge.net/pyqwt3d-examples.html}} \newcommand{\MacPorts}{\ulink{MacPorts} {http://www.macports.org}} % Installers for MS-Windows \newcommand{\PythonExe}{\ulink{python-2.5.1.msi} {http://www.python.org/ftp/python/2.5/python-2.5.1.msi}} \newcommand{\NumPyExe}{\ulink{numpy-1.0.3.win32-py2.5.exe} {http://prdownloads.sourceforge.net/numpy/numpy-1.0.3.win32-py2.5.exe}} \newcommand{\QtOldExe}{\ulink{qt-win-opensource-4.2.2-mingw.exe} {ftp://ftp.trolltech.com/qt/source/qt-win-opensource-4.2.2-mingw.exe}} \newcommand{\QtNewExe}{\ulink{qt-win-opensource-4.2.3-mingw.exe} {ftp://ftp.trolltech.com/qt/source/qt-win-opensource-4.2.3-mingw.exe}} \newcommand{\DevCpp}{\ulink{Dev-C++} {http://prdownloads.sourceforge.net/dev-cpp/devcpp-4.9.9.2_setup.exe}} \newcommand{\PyQtOldExe}{\ulink{PyQt-gpl-4.1.1-Py2.5-Qt4.2.2.exe} {http://pyqwt.sourceforge.net/support/PyQt-gpl-4.1.1-Py2.5-Qt4.2.2.exe}} \newcommand{\PyQtNewExe}{\ulink{PyQt-gpl-4.2-Py2.5-Qt4.2.3.exe} {http://pyqwt.sourceforge.net/support/PyQt-gpl-4.2-Py2.5-Qt4.2.3.exe}} \newcommand{\PyQwtNewExe}{\ulink{PyQwt3D-0.1.6-Python2.5-Qt4.2.3-PyQt-4.2-NumPy1.0.3.exe} {http://prdownloads.sourceforge.net/pyqwt/PyQwt3D-0.1.6-Python2.5-Qt4.2.3-PyQt-4.2-NumPy1.0.3.exe}} \newcommand{\PrerequisitesEnd}{ To exploit the full power of the PyQwt3D, you should install at least one the Numerical Python extensions: \NumPy{}, \numarray{}, \Numeric{}. I am testing PyQwt3D with \NumPyTarGz{}, \numarrayTarGz{}, and \NumericTarGz{}. \NumPy{} is actively developed and recommended; \numarray{} and \Numeric{} are unmaintained. \begin{notice}[note] PyQwt3D contains a patched version of QwtPlot3D-0.2.7 to enable the SVG and PGF vector output file formats and the patched version of QwtPlot3D-0.2.7 is required when you want to use the SVG and PGF formats. The PyQwt3D extension module containing statically linked sources of QwtPlot3D-0.2.7 coexists very well with system wide shared libraries of any version of QwtPlot3D. \end{notice} } \newcommand{\Future}{ \begin{notice}[warning] The documentation is for the future PyQwt3D-0.1.6 which has not yet been released. Please refer, to the documentation in the release that you are using. \end{notice} } \renewcommand{\Future}{} \title{PyQwt3D Manual} % boilerplate.tex? \author{Gerard Vermeulen} \date{\today} \release{0.1.6} \setshortversion{0.1.6} \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 PyQwt3D is a set of Python bindings for the \QwtPlotDdd{} library which extends the Qt framework with widgets to visualize 3-dimensional data. It allows you to integrate PyQt, Qt, QwtPlot3D, the Numerical Python extensions, and optionally SciPy in a GUI Python application or in an interactive Python session. \end{abstract} \tableofcontents \chapter{Introduction\label{introduction}} \Future{} PyQwt3D is a set of Python bindings for the \QwtPlotDdd{} library which extends the Qt framework with widgets to visualize 3-dimensional data. It wraps also a small subset of the OpenGL API. The \Examples{} show how to program with PyQwt3D. \chapter{Installation\label{installation}} \Future{} \begin{notice}[note] PyQwt3D for Qt-3 can coexist with PyQwt3D for Qt-4. The statement \begin{verbatim} import Qwt3D \end{verbatim} imports PyQwt3D for Qt-3 and the statement \begin{verbatim} import PyQt4.Qwt3D \end{verbatim} imports PyQwt3D for Qt-4 \end{notice} \section{Installation prerequisites\label{prerequisites}} \Future{} Installation prerequisites for \PyQwtDddTarGz{} are: \begin{enumerate} \item \ulink{Python}{http://www.python.org}.\\ Supported versions: Python-2.5.x, and Python-2.4.x. \item \ulink{Qt}{http://www.trolltech.com}.\\ Supported versions: Qt-4.3.x, Qt-4.2.x, Qt-3.3.x, and Qt-3.2.x. \item \NewSip{}.\\ Supported versions: SIP-4.7.x, SIP-4.6.x, and SIP-4.5.x.\\ \item \PyQtGpl{}, \PyQtFGpl, \PyQtMac{}, \PyQtFMac{} and \PyQtCom{}.\\ Supported versions: PyQt-4.3.x, PyQt-4.2.x, PyQt-4.1.x, and PyQt-3.17.x.\\ \item \QwtPlotDdd{}.\\ Supported versions: \QwtPlotDddTgz{} or \QwtPlotDddZip{}. \PyQwtDddTarGz{} contains a version of \QwtPlotDdd{} for your convenience. You can (but unless you are using Windows do not have to) compile and link the \QwtPlotDdd{} sources statically into the PyQwt3D extension module. \item \ZLib{} is needed to enable compression in the PDF and PostScript output of \QwtPlotDdd{}.\\ Supported versions: zlib-1.2.x, and zlib-1.1.x. \PyQwtDddTarGz{} contains the necessary source files of zlib-1.2.3 to remove the dependency on zlib (but you are free to use an already installed shared or dynamic load library of zlib). \end{enumerate} \PrerequisitesEnd{} \section{Installation\label{install}} \Future{} \subsection{Installation on \POSIX{} and MacOS/X\label{posix-install}} \Future{} The installation procedure consists of three steps: \begin{enumerate} \item Unpack \PyQwtDddTarGz{}. \item Do a quick start to test the installation by running the commands: \begin{verbatim} cd PyQwt3D-0.1.6 cd configure python configure.py -Q ../qwtplot3d-0.2.7 make make install \end{verbatim} where the directory \file{/sources/of/qwtplot3d} must contain the directories \file{3rdparty}, \file{include} and \file{src}.\\ The installation will fail if Qt has been configured without runtime type information (RTTI). In this case, run the commands: \begin{verbatim} cd PyQwt3D-0.1.6 cd configure python configure.py -Q /sources/of/qwtplot3d --extra-cxxflags=-frtti make make install \end{verbatim} where \code{-frtti} enables RTTI for g++. Check your compiler documention for other C++ compilers. \item Fine tune (optional) \begin{itemize} \item to enable compression of PostScript and PDF files by running the commands: \begin{verbatim} python configure.py -Q /sources/of/qwtplot3d -l z -D HAVE_ZLIB make make install \end{verbatim} Add \begin{verbatim} -L /directory/with/libz.* \end{verbatim} to the \file{configure.py} options, if the linker fails to find the zlib library. \item to use a the QwtPlot3D library on your system by running the commands: \begin{verbatim} rm -rf Qwt3D python configure.py -I /usr/include/qwtplot3d make make install \end{verbatim} where \file{/usr/include/qwtplot3d} is an example for the installation directory of the QwtPlot3D header files. Add \begin{verbatim} -L /directory/with/libqwtplot3d.* \end{verbatim} to the \file{configure.py} options, if the linker fails to find the QwtPlot3D library. \end{itemize} \end{enumerate} \begin{notice}[warning] The patched version of QwtPlot3D-0.2.7 included in PyQwt3D is required to enable saving of plots to the SVG and PGF vector file formats. In addition, you have to define HAVE_ZLIB and HAVE_LIBPNG to enable pixmaps in the SVG driver of GL2PS. A minimal configuration example is \begin{verbatim} python configure.py -Q ../qwtplot3d-0.2.7 -D HAVE_ZLIB -D HAVE_LIBPNG \ -l z -l png \end{verbatim} which may need extra options to indicate the location of the headers and libraries of libpng and zlib. For instance, a configuration example for Mac OS X with libpng from \MacPorts{} is: \begin{verbatim} python configure.py -Q ../qwtplot3d-O.2.7 -I /opt/local/include \ -L /opt/local/lib -D HAVE_ZLIB -D HAVE_LIBPNG -l z -l png \end{verbatim} \end{notice} \begin{notice}[note] \file{PyQwt-0.1.6/GNUmakefile} is makefile for GNU make which contains more examples of how to invoke \file{configure.py}. Adapt and use it, if you have GNU make. \end{notice} \begin{notice}[note] If you run into problems, send a log to the \mailinglist{}. There are at least two options to log the output of make: \begin{enumerate} \item Invoke make, tie stderr to stdout, and redirect stdout to LOG.txt: \begin{verbatim} # For Qt-3 make 3 2&>1 >LOG.txt # For Qt-4 make 4 2&>1 >LOG.txt \end{verbatim} However, you do not see what is going on. \item Use script to capture all screen output of make to LOG.txt: \begin{verbatim} # For Qt-3 script -c 'make 3' LOG.txt # For Qt-4 script -c 'make 4' LOG.txt \end{verbatim} The script command appeared in 3.0BSD and is part of util-linux. \end{enumerate} \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} \subsection{Installation on Windows with MSVC\label{win-install}} \Future{} The installation procedure consists of three steps: \begin{enumerate} \item Unpack \PyQwtDddTarGz{}. \item Do a quick start to test the installation by running the commands: \begin{verbatim} cd PyQwt3D-0.1.6 cd configure python configure.py -Q ..\qwtplot3d-0.2.7 nmake nmake install \end{verbatim} where the folder \file{C:\textbackslash{}sources\textbackslash{}of\textbackslash{}qwtplot3d} must contain the folders \file{3rdparty}, \file{include} and \file{src}. You can also edit one of the files \file{go3.bat}, \file{go4.bat}, or \file{go-mingw.bat} to suit your setup. \item Fine tune (optional) by running the commands: \begin{verbatim} python configure.py -Q C:\sources\of\qwtplot3d -l zlib -D HAVE_ZLIB nmake nmake install \end{verbatim} to enable compression of PostScript and PDF files. Add \begin{verbatim} -L C:\folder\containing\zlib.lib \end{verbatim} to the \file{configure.py} options, if the linker fails to find the zlib library. \end{enumerate} \begin{notice}[note] The files \file{configure\textbackslash{}go3.bat} and \file{configure\textbackslash{}go4.bat} are examples of how to automatize the invokations of \strong{configure.py}, \strong{nmake}, and \strong{nmake install}. The file \file{configure\textbackslash{}go-mingw.bat} is used to build PyQwt3D with MinGW after building libpng by hand. Adapt and use one of those files. \end{notice} \begin{notice}[note] If you run into problems, send a log to the \mailinglist{}. Try \begin{verbatim} go3.bat >LOG.txt \end{verbatim} or \begin{verbatim} go4.bat >LOG.txt \end{verbatim} to make a log. \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} \begin{notice}[note] Since PyQwt3D wraps some classes and functions that are not exported from a QwtPlot3D dynamic load library, you have to compile and link the QwtPlot3D sources into PyQwt3D's extension module. \end{notice} \subsection{Binary Installer for Windows \label{windows-nsis}} \Future{} Run the following installers, if you have not done so: \begin{enumerate} \item \PythonExe{}. \item \NumPyExe{}. \item \QtNewExe{}.\\ Let the Qt installer install MinGW if for instance \DevCpp{} has not been installed before Qt. \item \PyQtNewExe{}.\\ Make sure that you can run the PyQt examples by tweaking the environment variable \var{PATH}. \item Install \PyQwtNewExe{}. \end{enumerate} \chapter{PyQwt3D Module Reference \label{reference}} \Future{} The reference should be used in conjunction with the \QwtPlotDddManual{} and the \QwtPlotDddApi{}. 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. The classes in the QwtPlot3D library have quite a few protected attributes. They are not easily exported to Python (SIP wraps protected member function, but not protected attributes). I will export protected attributes to Python on demand. For instance, \var{Enrichment.plot} is accessible from Python, but protected in C++. \section{Class reference \label{classes}} \Future{} \begin{classdesc*}{Arrow} is fully implemented. \end{classdesc*} \begin{classdesc*}{AutoScaler} is fully implemented. \end{classdesc*} \begin{classdesc*}{Axis} is fully implemented. \end{classdesc*} \begin{classdesc*}{AxisVector} wraps \ctype{std::vector}. See \ref{wrappers} for details. \end{classdesc*} \begin{classdesc*}{Cell} wraps \ctype{std::vector}. See \ref{wrappers} for details. \end{classdesc*} \begin{classdesc*}{CellData} is fully implemented. \end{classdesc*} \begin{classdesc*}{CellField} wraps \ctype{std::vector}. See \ref{wrappers} for details. \end{classdesc*} \begin{classdesc*}{Color} is fully implemented. \end{classdesc*} \begin{classdesc*}{ColorLegend} is fully implemented. \end{classdesc*} \begin{classdesc*}{Cone} is fully implemented. \end{classdesc*} \begin{classdesc*}{CoordinateSystem} is fully implemented. \end{classdesc*} \begin{classdesc*}{CrossHair} is fully implemented. \end{classdesc*} \begin{classdesc*}{Data} is fully implemented.\\ FIXME: what to do with the protected data members? \end{classdesc*} \begin{classdesc*}{Dot} is fully implemented. \end{classdesc*} \begin{classdesc*}{DoubleVector} wraps \ctype{std::vector}. See \ref{wrappers} for details. \end{classdesc*} \begin{classdesc*}{Drawable} is fully implemented.\\ FIXME: what to do with the protected data members? \end{classdesc*} \begin{classdesc*}{Enrichment} is fully implemented.\\ \begin{cvardesc}{const Plot3D*}{plot} This C++ protected data member is accessible in Python. \end{cvardesc} \end{classdesc*} \begin{classdesc*}{Freevector} is fully implemented. \end{classdesc*} \begin{classdesc*}{FreeVectorField} wraps \ctype{std::vector}. See \ref{wrappers} for details. \end{classdesc*} \begin{classdesc*}{Function} is fully implemented. \end{classdesc*} \begin{classdesc*}{GLStateBewarer} is fully implemented. \end{classdesc*} \begin{classdesc*}{GridData} \begin{itemize} \item{vertices}. The public data member: \begin{verbatim} DataMatrix vertices; \end{verbatim} is not accessible. FIXME: how to wrap \class{DataMatrix} safely? \item{normals}. The public data member: \begin{verbatim} DataMatrix normals; \end{verbatim} is not accessible. FIXME: how to wrap \class{DataMatrix} safely? \end{itemize} \end{classdesc*} \begin{classdesc*}{GridMapping} is fully implemented.\\ FIXME: what to do with the protected data members? \end{classdesc*} \begin{classdesc*}{IO} \begin{itemize} \item{defineInputHandler}. C++ declaration: \begin{verbatim} static bool defineInputHandler(QString const& format, Function func); \end{verbatim} is not implemented (it is impossible to implement callbacks without an extra void pointer to hold a Python callable). \item{defineOutputHandler}. C++ declaration: \begin{verbatim} static bool defineOutputHandler(QString const& format, Function func); \end{verbatim} is not implemented (it is impossible to implement callbacks without an extra void pointer to hold a Python callable). \end{itemize} \end{classdesc*} \begin{classdesc*}{Label} is fully implemented. \end{classdesc*} \begin{classdesc*}{LinearAutoscaler} is fully implemented. \end{classdesc*} \begin{classdesc*}{LinearScale} is fully implemented.\\ FIXME: what to do with the protected data members? \end{classdesc*} \begin{classdesc*}{LogScale} is fully implemented. \end{classdesc*} \begin{classdesc*}{Mapping} is fully implemented. \end{classdesc*} \begin{classdesc*}{NativeReader} is fully implemented. \end{classdesc*} \begin{classdesc*}{ParallelEpiped} is fully implemented. \end{classdesc*} \begin{classdesc*}{ParametricSurface} is fully implemented. \end{classdesc*} \begin{classdesc*}{PixmapWriter} is fully implemented. \end{classdesc*} \begin{classdesc*}{Plot3D} is fully implemented.\\ FIXME: what to do with the protected data members?\\ \end{classdesc*} \begin{classdesc*}{RGBA} is fully implemented. \end{classdesc*} \begin{classdesc*}{Scale} is fully implemented.\\ FIXME: what to do with the protected data members? \end{classdesc*} \begin{classdesc*}{StandardColor} is fully implemented.\\ FIXME: what to do with the protected data members? \end{classdesc*} \begin{classdesc*}{SurfacePlot} is fully implemented. \begin{itemize} \item{facets}. C++ declaration: \begin{verbatim} std::pair facets() const; \end{verbatim} returns a tuple of two Python ints. \item{loadFromData}. C++ declaration: \begin{verbatim} bool loadFromData(Qwt3D::Triple** data, unsigned int columns, unsigned int rows, bool uperiodic = false, bool vperiodic = false); \end{verbatim} is wrapped by: \begin{verbatim} success = surfacePlot.loadFromData(data, uperiodic = False, vperiodic = False) \end{verbatim} where \var{success} is \constant{True} or \constant{False}, \var{data} is convertable to a Numeric or numarray array of Python floats with a shape (N, M, 3), and \var{uperiodic} and \var{vperiodic} are Python bools.\\ C++ declaration: \begin{verbatim} bool loadFromData(double** data, unsigned int columns, unsigned int rows, double minx, double maxx, double miny, double maxy); \end{verbatim} is wrapped by: \begin{verbatim} success = surfacePlot.loadFromData(data, minx, maxx, miny, maxy) \end{verbatim} where \var{success} is \constant{True} or \constant{False}, \var{data} is convertable to a Numeric or numarray array of Python floats with a shape (N, M), and \var{minx}, \var{maxx}, \var{miny} and \var{maxy} are convertable to Python floats.\\ C++ declaration: \begin{verbatim} bool loadFromData(Qwt3D::TripleField const& data, Qwt3D::CellField const& poly); \end{verbatim} is wrapped by: \begin{verbatim} success = surfacePlot.loadFromData(tripleField, cellField) \end{verbatim} where \var{success} is \constant{True} or \constant{False}, \var{tripleField} is a \class{TripleField}, and \var{cellField} is a \class{CellField}. \item{createDataRepresentation}. C++ declarations: \begin{verbatim} bool createDataRepresentation( Qwt3D::Triple** data, unsigned int columns, unsigned int rows, bool uperiodic = false, bool vperiodic = false); bool createDataRepresentation( double** data, unsigned int columns, unsigned int rows, double minx, double maxx, double miny, double maxy); bool createDataRepresentation( Qwt3D::TripleField const& data, Qwt3D::CellFieldconst& poly) \end{verbatim} are deprecated and therefore not implemented. \item{readIn}. C++ declaration: \begin{verbatim} void readIn(Qwt3D::GridData& grid, Triple** data, unsigned int columns, unsigned int rows); \end{verbatim} is wrapped by: \begin{verbatim} surfacePlot.readIn(gridData, data) \end{verbatim} where \var{gridData} is a \class{GridData}, and \var{data} is convertable to a Numeric or numarray array of Python floats with a shape (N, M, 3).\\ C++ declaration: \begin{verbatim} void readIn(Qwt3D::GridData& grid, double** data, unsigned int columns, unsigned int rows, double minx, double maxx, double miny, double maxy); \end{verbatim} is wrapped by: \begin{verbatim} surfacePlot.readIn(gridData, data, minx, maxx, miny, maxy) \end{verbatim} where \var{gridData} is a \class{GridData}, \var{data} is convertable to a Numeric or numarray array of Python floats with a shape (N, M), and \var{minx}, \var{maxx}, \var{miny} and \var{maxy} are convertable to Python floats. \end{itemize} \end{classdesc*} \begin{classdesc*}{Triple} \begin{itemize} \item{operator *()}. C++ declaration: \begin{verbatim} Triple operator*(double, const Triple &); \end{verbatim} is not implemented. \item{operator /()}. C++ declaration: \begin{verbatim} Triple operator/(double, const Triple &); \end{verbatim} is not implemented. \end{itemize} \end{classdesc*} \begin{classdesc*}{TripleField} wraps \ctype{std::vector}. See \ref{wrappers} for details. \end{classdesc*} \begin{classdesc*}{Tuple} is fully implemented. \end{classdesc*} \begin{classdesc*}{VectorWriter} is fully implemented. \end{classdesc*} \begin{classdesc*}{VertexEnrichment} is fully implemented. \end{classdesc*} \section{Wrappers for \ctype{std::vector} \label{wrappers}} \Future{} PyQwt3D has a partial interface to the following C++ std::vector templates: \begin{enumerate} \item \class{AxisVector} for \ctype{std::vector} \item \class{Cell} for \ctype{std::vector} \item \class{CellField} for \ctype{std::vector} \item \class{ColorVector} for \ctype{std::vector} \item \class{DoubleVector} for \ctype{std::vector} \item \class{FreeVectorField} for \ctype{std::vector} \item \class{TripleField} for \ctype{std::vector} \end{enumerate} The interface implements four constructors for each template instantianation -- taking Cell as example: \begin{enumerate} \item \code{Cell()} \item \code{Cell(size)} \item \code{Cell(size, item)} \item \code{Cell(otherCell)} \end{enumerate} and 13 member functions -- taking Cell as example: \begin{enumerate} \item \code{result = cell.capacity()} \item \code{cell.clear()} \item \code{result = cell.empty()} \item \code{result = cell.back()} \item \code{result = cell.front()} \item \code{result = cell.max_size()} \item \code{cell.pop_back()} \item \code{cell.push_back(item)} \item \code{cell.reserve(size)} \item \code{cell.reserve(size, item = 0)} \item \code{cell.resize(size, item = 0)} \item \code{result = cell.size()} \item \code{cell.swap(otherCell)} \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{StdVectorExample.txt} \section{Function reference \label{functions}} \Future{} \begin{funcdesc}{plot}{x, y, function, title='', labels=('x', 'y', 'z')} Returns a plot of \code{function(x, y)} Here, \var{x} and \var{y} are vectors, \var{function} is function of two variables, \var{title} as string and \var{labels} a sequence of three strings. The axes are scaled to make the axis frame cubic. \end{funcdesc} \begin{funcdesc}{save}{plot3d, name, format, landscape=VectorWriter.OFF, textmode=VectorWriter.NATIVE, sortmode=sortmode=VectorWriter.BSPSORT} Saves a snapshot of a Plot3D widget to a file. Here, \var{plot3d} is a Plot3D widget or a widget with a Plot3D widget as child, \var{name} is the file name, and \var{format} a case-insensitive string indicating the file format. \var{landscape} can be \constant{VectorWriter.ON}, \constant{VectorWriter.OFF}, or \constant{VectorWriter.AUTO}, \var{textmode} can be \constant{VectorWriter.PIXEL}, \constant{VectorWriter.NATIVE}, or \constant{VectorWriter.TEX}, and \var{sortmode} can be \constant{VectorWriter.NOSORT}, \constant{VectorWriter.SIMPLESORT}, or \constant{VectorWriter.BSPSORT}. PyQwt3D uses GL2PS to support vector formats as EPS, EPS_GZ, PDF, PGF, PS, PS_GZ, SVG, and SVG_GZ. It uses Qt to support pixmap formats as GIF, JPEG, PNG, and others. \function{save} returns \constant{True} on success and \constant{False} on failure. \end{funcdesc} \begin{cfuncdesc}{const GLubyte*}{gl_error}{} is implemented as \begin{verbatim} message = gl_error() \end{verbatim} \end{cfuncdesc} \begin{cfuncdesc}{bool}{ViewPort2World} {double \&wx, double \&wy, double \&wz, double vx, double vy, double vz} is implemented as \begin{verbatim} success, wx, wy, wz = ViewPort2World(vx, vy, vz) \end{verbatim} \end{cfuncdesc} \begin{cfuncdesc}{bool}{World2ViewPort} {double \&vx, double \&vy, double \&vz, double wx, double wy, double wz} is implemented as \begin{verbatim} success, vx, vy, vz = World2Viewport(wx, wy, wz) \end{verbatim} \end{cfuncdesc} \input{pyqwt3d.ind} \end{document} %% Local Variables: %% fill-column: 79 %% End: PyQwt3D-pyqwt3d-0.1.8/Doc/sourceforge.py000066400000000000000000000016341334664011000200100ustar00rootroot00000000000000#!/usr/bin/env python import os import re import sys 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)) mailRe = re.compile(r'(.*)') 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() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/GNUmakefile000066400000000000000000000075751334664011000164720ustar00rootroot00000000000000# GNU-Makefile for PyQwt3D # # 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-static 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-static' LOG.txt # The script command appeared in 3.0BSD and is part of util-linux. # # Edit QWT3DOPTIONS first. # To compile and link the QwtPlot3D sources statically into PyQwt3D. QWT3DDIR := $(shell pwd)/qwtplot3d-0.2.7 # To compile and link the zlib sources statically into PyQwt3D. ZLIBDIR := $(shell pwd)/zlib-1.2.3 # To compile and link the libpng sources statically into PyQwt3D. PNGVER := 1.2.18 PNGDIR := $(shell pwd)/libpng-$(PNGVER) # Edit QWT3DOPTIONS first (DarwinPorts install in /opt/local). #QWT3DOPTIONS := -Q $(QWT3DDIR) -Z $(ZLIBDIR) -D HAVE_LIBPNG -l png QWT3DOPTIONS := -Q $(QWT3DDIR) -D HAVE_ZLIB -l z -D HAVE_LIBPNG -I /opt/local/include -L /opt/local/lib -l png # Do not edit below this line, unless you know what you are doing. JOBS := $(shell getconf _NPROCESSORS_ONLN) UNAME := $(shell uname) ifeq ($(UNAME),Linux) JOBS := $(shell getconf _NPROCESSORS_ONLN) endif ifeq ($(UNAME),Darwin) JOBS := $(shell sysctl -n hw.ncpu) endif .PHONY: dist qwtplot-0.2.7 # Build and link PyQwt3D including the local source tree of Qwt3D. all: 3 4 debug: 3d 4d trace: 3t 4t 3: cd configure \ && python configure.py -3 $(QWT3DOPTIONS) -j $(JOBS) \ && $(MAKE) -j $(JOBS) 4: cd configure \ && python configure.py -4 $(QWT3DOPTIONS) -j $(JOBS) \ && $(MAKE) -j $(JOBS) 3d: cd configure \ && python configure.py --debug $(QWT3DOPTIONS) -j $(JOBS) \ && $(MAKE) -j $(JOBS) 4d: cd configure \ && python configure.py --debug -4 $(QWT3DOPTIONS) -j $(JOBS) \ && $(MAKE) -j $(JOBS) 3t: cd configure \ && python configure.py --debug --trace -3 $(QWT3DOPTIONS) -j $(JOBS) \ && $(MAKE) -j $(JOBS) 4t: cd configure \ && python configure.py --debug --trace -4 $(QWT3DOPTIONS) -j $(JOBS) \ && $(MAKE) -j $(JOBS) # 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 # QwtPlot3D code. qwtplot3d-doc.zip: wget http://qwtplot3d.sourceforge.net/qwtplot3d-doc.zip qwtplot3d-0.2.7.tgz: wget http://prdownloads.sourceforge.net/qwtplot3d/qwtplot3d-0.2.7.tgz qwtplot3d-0.2.7: qwtplot3d-doc.zip qwtplot3d-0.2.7.tgz rm -rf qwtplot3d qwtplot3d-doc qwtplot3d-0.2.7 (unzip qwtplot3d-doc.zip; mv qwtplot3d qwtplot3d-doc) (tar xfz qwtplot3d-0.2.7.tgz; mv qwtplot3d qwtplot3d-0.2.7) ./unbieber.py qwtplot3d-0.2.7 .c .cpp .h patch -p0 --fuzz=10 -b -z .pyqwt3d Doxyfile.doxygen; \ doxygen -u Doxyfile.doxygen; \ doxygen Doxyfile.doxygen) LIBPNG_TAR_GZ := libpng-1.2.18-no-config.tar.gz libpng-$(PNGVER)-no-config.tar.gz: wget http://prdownloads.sourceforge.net/libpng/$@ libpng: libpng-$(PNGVER)-no-config.tar.gz tar xfz $< diff: ./gendiff qwtplot3d-0.2.7 .pyqwt3d >pyqwt3d-0.2.7.patch # PyQwt3D documentation. doc: (cd Doc && make doc && make htdoc) clean: rm -f *~ */*~ */*/*~ distclean: clean find . -name '.#*' -o -name '*.pyc' | xargs rm -f rm -rf configure/Makefile rm -rf configure/OpenGL_Qt3 configure/tmp-OpenGL_Qt3 rm -rf configure/OpenGL_Qt4 configure/tmp-OpenGL_Qt4 rm -rf configure/Qwt3D_Qt3 configure/tmp-Qwt3D_Qt3 rm -rf configure/Qwt3D_Qt4 configure/tmp-Qwt3D_Qt4 dist: all distclean doc python setup.py sdist # EOF PyQwt3D-pyqwt3d-0.1.8/MANIFEST.in000066400000000000000000000030741334664011000161440ustar00rootroot00000000000000# MANIFEST template file to make a distribution tarball # Package stuff include COPYING COPYING.PyQwt3D ChangeLog THANKS TODO *.TXT include MANIFEST.in GNUmakefile NEWS # Documentation graft Doc prune Doc/html/htdoc recursive-exclude Doc *cvsignore* *~ # configure graft configure prune configure/OpenGL_Qt3 prune configure/OpenGL_Qt4 prune configure/tmp-OpenGL_Qt3 prune configure/tmp-OpenGL_Qt4 prune configure/Qwt3D_Qt3 prune configure/Qwt3D_Qt4 prune configure/tmp-Qwt3D_Qt3 prune configure/tmp-Qwt3D_Qt4 recursive-exclude configure Makefile PyQwt3D.nsi *.cpp *.pyc *cvsignore* *~ # Qt3 examples graft examples recursive-exclude examples *.html *.pdf *.png *ps *.pyc *.svg *cvsignore* *~ # fake headers graft include recursive-exclude include *.pyqwt3d *cvsignore* *~ # Numerical Python interface graft numpy recursive-exclude numpy *.py *cvsignore* *~ # PyQwt python code for PyQt/Qt3 graft qt3lib recursive-exclude qt3lib *cvsignore* *~ # Qt4 examples graft qt4examples recursive-exclude qt4examples *.html *.pdf *.png *ps *.pyc *.svg *cvsignore* *~ # PyQwt python code for PyQt4/Qt4 graft qt4lib recursive-exclude qt4lib *cvsignore* *~ # QwtPlot3D graft qwtplot3d-0.2.7 recursive-exclude qwtplot3d-0.2.7 *~ # sip files graft sip recursive-exclude sip *.py *cvsignore* *~ # The zlib-1.2.3 library. graft zlib-1.2.3 prune zlib-1.2.3/amiga prune zlib-1.2.3/as400 prune zlib-1.2.3/contrib prune zlib-1.2.3/examples prune zlib-1.2.3/msdos prune zlib-1.2.3/old prune zlib-1.2.3/projects prune zlib-1.2.3/qnx prune zlib-1.2.3/win32 # Local Variables: *** # mode: sh *** # End: *** PyQwt3D-pyqwt3d-0.1.8/NEWS000066400000000000000000000023161334664011000151030ustar00rootroot00000000000000v0.1.6 -- 2007-08-08 - Fixed the display of text on screen and in pixmaps with Qt-4 and X. v0.1.5 -- 2007-08-07 - Added support for QwtPlot3D-0.2.7 - Added support for SIP-4.7, PyQt-4.3 and PyQt-3.17.3. - Added support for SVG and PGF vector output. - Added Qwt3D.save() to facilitate saving plots to a file. - Added Qwt3D.plot() to facilitate function plotting with nicely scaled axes. - Fixed the type of the result of IO.outputHandler(format). - Fixed saving to pixmap formats in qt4examples/Grab.py. v0.1.4 -- 2007-04-15 - Added a NSIS Windows installer. - Added support for SIP-4.6. - Removed support for SIP-4.4 and the workarounds needed for SIP-4.4 v0.1.2 -- 2006-10-29 - Added support for Python-2.5 (requires PyQt and SIP snapshots or the future PyQt-3.17, PyQt-4.1 and SIP-4.5). - support for Qt-4.2.x and -4.1.x - Added support for NumPy-1.0, see http://numpy.scipy.org. - Added PyQwt3D.OpenGL to give access to a small subset of the OpenGL API. - Added the EnrichmentDemo.py example to demonstrate PyQwt3D.OpenGL v0.1.1 -- 2006-02-18 - Added support for NumPy, see http://numeric.scipy.org/ - Added support for SIP-4.3.x. - Fixed build problems on Mac OS X. v0.1.0 -- 2005-02-27 - The first release of PyQwt3D.PyQwt3D-pyqwt3d-0.1.8/README000066400000000000000000000007031334664011000152620ustar00rootroot00000000000000INTRODUCTION PyQwt3D is a set of Python bindings for the QwtPlot3D library. LICENSE GPL with an exception allowing dynamic linking with the non-free versions of Qt and PyQt. PREREQUISITES See Doc/html/pyqwt3d/prerequisites.html. INSTALLATION See Doc/html/pyqwt3d/install.html. Have fun -- Gerard Vermeulen .. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 79 End: PyQwt3D-pyqwt3d-0.1.8/README.md000066400000000000000000000004121334664011000156560ustar00rootroot00000000000000# PyQwt3D This is a fork of Mark Colclough's and Gerard Vermeulen's library which can be found here: http://pyqwt.sourceforge.net The library is updated to work with python3 and Qt5. This project will be closed as soon as someone sets up a more official project. PyQwt3D-pyqwt3d-0.1.8/THANKS000066400000000000000000000002641334664011000153170ustar00rootroot00000000000000Jay O'Connor - for helping in resolving Windows build issues (starting from creepy CVS). Brian M. Bowen - for requesting a simple OpenGL module. - for starting EnrichmentDemo.py. PyQwt3D-pyqwt3d-0.1.8/TODO000066400000000000000000000001001334664011000150610ustar00rootroot00000000000000- Remove all FIXME's. - Export protected data (what? and how?). PyQwt3D-pyqwt3d-0.1.8/configure/000077500000000000000000000000001334664011000163635ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/configure/PyQwt3D.nsi.in000066400000000000000000000177721334664011000207740ustar00rootroot00000000000000# PyQwt3D5 NSIS installer script. # # Copyright (C) 2004-2007 Gerard Vermeulen # # This file is part of PyQwt3D. # # PyQwt3D 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. # # PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, # PyQwt3D becomes a free plug-in for a non-free program. # These will change with different releases. !define PYQWT3D_VERSION "0.1.6" !define PYQWT3D_PYQT_VERSION "%(PYQT_VERSION)s" !define PYQWT3D_PYTHON_VERSION "%(PYTHON_VERSION)s" !define PYQWT3D_QT_VERSION "%(QT_VERSION)s" !define PYQWT3D_NUMPY_VERSION "%(NUMPY_VERSION)s" # These are all derived from the above. !define PYQWT3D_NAME "PyQwt3D-${PYQWT3D_VERSION}" !define PYQWT3D_INSTALLDIR "C:\Python${PYQWT3D_PYTHON_VERSION}\" !define PYQWT3D_PYTHON_HKLM "Software\Python\PythonCore\${PYQWT3D_PYTHON_VERSION}\InstallPath" # Tweak some of the standard pages. !define MUI_WELCOMEPAGE_TEXT \ "This wizard will guide you through the installation of ${PYQWT3D_NAME} \ built with the MinGW compiler against:\r\n\ - Python-${PYQWT3D_PYTHON_VERSION}.x\r\n\ - Qt-${PYQWT3D_QT_VERSION}\r\n\ - PyQt-${PYQWT3D_PYQT_VERSION}\r\n\ - NumPy-${PYQWT3D_NUMPY_VERSION}.\r\n\ \r\n\ The license of the distribution of any of your software using PyQwt3D has to \ be compatible with the GPL licence. Assure your licensees 4 freedoms to \ comply with the GPL:\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 PyQwt3D 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 "PyQwt3D" Caption "${PYQWT3D_NAME} Setup" OutFile "PyQwt3D-${PYQWT3D_VERSION}-Python${PYQWT3D_PYTHON_VERSION}-Qt${PYQWT3D_QT_VERSION}-PyQt${PYQWT3D_PYQT_VERSION}-NumPy${PYQWT3D_NUMPY_VERSION}.exe" # Set the install directory, from the registry if possible. InstallDir "${PYQWT3D_INSTALLDIR}" InstallDirRegKey HKLM "${PYQWT3D_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 "${PYQWT3D_PYTHON_HKLM}" "" ${If} $0 == "" MessageBox MB_YESNO|MB_ICONQUESTION \ "This copy of PyQwt3D has been built against Python-${PYQWT3D_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\PyQwt3D CreateDirectory $PROGRAMFILES\PyQwt3D SetOverwrite on SetOutPath $INSTDIR\Lib\site-packages\PyQt4\Qwt3D File .\Qwt3D_Qt4\__init__.py File .\Qwt3D_Qt4\ezplot.py File .\Qwt3D_Qt4\_Qwt3D.pyd File .\OpenGL_Qt4\OpenGL.pyd SectionEnd Section "Documentation" SecDocumentation SectionIn 1 SetOverwrite on SetOutPath $PROGRAMFILES\PyQwt3D File /r ..\Doc\html\pyqwt3d File /r ..\qwtplot3d-0.2.7\doc\web\doxygen SectionEnd Section "Examples" SecExamples SectionIn 1 SetOverwrite on SetOutPath $PROGRAMFILES\PyQwt3D File /r ..\qt4examples SectionEnd Section "Start Menu shortcuts" SecShortcuts SectionIn 1 # Make sure this is clean and tidy. RMDir /r "$SMPROGRAMS\${PYQWT3D_NAME}" CreateDirectory "$SMPROGRAMS\${PYQWT3D_NAME}" IfFileExists "$PROGRAMFILES\PyQwt3D\pyqwt3d\index.html" 0 +2 CreateShortCut "$SMPROGRAMS\${PYQWT3D_NAME}\PyQwt3D Documentation.lnk" "$PROGRAMFILES\PyQwt3D\pyqwt3d\index.html" IfFileExists "$PROGRAMFILES\PyQwt3D\doxygen\index.html" 0 +2 CreateShortCut "$SMPROGRAMS\${PYQWT3D_NAME}\QwtPlot3D Documentation.lnk" "$PROGRAMFILES\PyQwt3D\doxygen\index.html" CreateShortCut "$SMPROGRAMS\${PYQWT3D_NAME}\QwtPlot3D Manual.lnk" "http://qwtplot3d.sourceforge.net" IfFileExists "$PROGRAMFILES\PyQwt3D\qt4examples" 0 +3 SetOutPath $INSTDIR CreateShortCut "$SMPROGRAMS\${PYQWT3D_NAME}\Examples Source.lnk" "$PROGRAMFILES\PyQwt3D\qt4examples" CreateShortCut "$SMPROGRAMS\${PYQWT3D_NAME}\Uninstall PyQwt3D.lnk" "$PROGRAMFILES\PyQwt3D\Uninstall.exe" SectionEnd Section -post # Tell Windows about the package. WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D" "UninstallString" '"$PROGRAMFILES\PyQwt3D\Uninstall.exe"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D" "DisplayName" "${PYQWT3D_NAME}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D" "DisplayVersion" "${PYQWT3D_VERSION}" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D" "NoModify" "1" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D" "NoRepair" "1" # Save the installation directory for the uninstaller. WriteRegStr HKLM "Software\PyQwt3D" "" $INSTDIR # Create the uninstaller. WriteUninstaller "$PROGRAMFILES\PyQwt3D\Uninstall.exe" SectionEnd # Section description text. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecModules} \ "The PyQwt3D modules: Qwt, anynumpy, grace, iqt, qplt." !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} \ "The PyQwt3D and Qwt documentation." !insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} \ "Ports to Python of the Qwt-5.0.1 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\PyQwt3D" "" # The modules section. RMDir /r $INSTDIR\Lib\site-packages\PyQt4\Qwt3D # The shortcuts section. RMDir /r "$SMPROGRAMS\${PYQWT3D_NAME}" # The examples section and the installer itself. RMDir /r "$PROGRAMFILES\PyQwt3D" # Clean the registry. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D" DeleteRegKey HKLM "Software\PyQwt3D" SectionEnd PyQwt3D-pyqwt3d-0.1.8/configure/clean.sh000066400000000000000000000002611334664011000200000ustar00rootroot00000000000000#!/bin/sh rm -f Makefile rm -rf OpenGL_Qt*/ rm -f PyQwt3D.nsi rm -rf Qwt3D_Qt*/ rm -f size_t_check.cpp rm -rf tmp-OpenGL_Qt*/ rm -rf tmp-Qwt3D_Qt*/ #rm -f ../sip/types.sip PyQwt3D-pyqwt3d-0.1.8/configure/configure-qt5.py000066400000000000000000000745121334664011000214360ustar00rootroot00000000000000#!/usr/bin/python """ Generate the build tree and Makefiles for PyQwt3D. """ # Copyright (C) 2003-2008 Gerard Vermeulen # # This file is part of PyQwt3D. # # PyQwt3D 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. # # PyQwt3D 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, # PyQwt3D becomes a free plug-in for a non-free program. import compileall import glob import optparse import os import pprint import re import shutil import sys #import traceback pyvers="%d.%d"%(sys.version_info.major,sys.version_info.minor) import PyQt5.QtCore qtconf = PyQt5.QtCore.PYQT_CONFIGURATION pyqt_mod_dir="/usr/lib/python%s/dist-packages/PyQt5/"%pyvers qt_inc_dir="/usr/include/x86_64-linux-gnu/qt5/" pyqt_sip_dir = "/usr/share/sip/PyQt5" #/usr/share/sip/PyQt4 class Die(Exception): def __init__(self, info): Exception.__init__(self, info) # __init__() # class Die try: required = 'At least SIP-4.5 and its development tools are required.' import sipconfig except ImportError: raise Die(required) if 0x040500 > sipconfig._pkg_config['sip_version']: raise Die(required) del required def get_pyqt_configuration(options): """Return the PyQt configuration for Qt3 or Qt4 """ if options.qt == 5: required = 'At least PyQt-5 and its development tools are required.' options.qwt3d = 'Qwt3D_Qt5' options.opengl = 'OpenGL_Qt5' options.excluded_features.append("-x HAS_QT3 -x HAS_QT4") options.subdirs.extend([options.qwt3d, options.opengl]) try: configuration = sipconfig.Configuration() except AttributeError: raise Die( 'Check if SIP and PyQt or PyQt5 have been installed properly.' ) 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 = 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 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 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 check_numpy(configuration, 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 # Try to find numpy/arrayobject.h. from numpy.distutils.misc_util import get_numpy_include_dirs 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: print(('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,)) raise ImportError print('Found NumPy-%s.\n' % numpy.__version__) options.extra_defines.append('HAS_NUMPY') options.extra_include_dirs.extend(include_dirs) except ImportError: options.excluded_features.append('-x HAS_NUMPY') print(('Failed to find NumPy: ' '%s will be build without support for NumPy.\n' ) % (package,)) return options # check_numpy() def check_sip(configuration, options, package): """Check if PyQwt3D can be built with SIP. """ version = configuration.sip_version version_str = configuration.sip_version_str required = '%s requires at least SIP-4.5' % (package,) print("Found SIP-%s.\n" % version_str) if 0x040500 > version: raise SystemExit(required) options.extra_include_dirs.append(configuration.sip_inc_dir) return options # check_sip() def check_compiler(configuration, options, package): """Check compiler specifics """ print('Do not get upset by error messages in the next 3 compiler checks:') makefile = sipconfig.Makefile(configuration=configuration) generator = makefile.optional_string('MAKEFILE_GENERATOR', 'UNIX') # FIXME: 'MSVC' should be worse than 'MSVC.NET' if generator in ['MSVC', 'MSVC.NET']: options.extra_cxxflags.extend(['-GR', '-GX']) program = os.linesep.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) print("Check if 'size_t' and '%s' are the same type:" % ctype) if compile_qt_program(name, configuration): comment = '' print("YES") else: print("NO") 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', 'types.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(configuration, options, package): """Adapt to different operating systems """ print("Found '%s' operating system:" % os.name) print(sys.version) print() if os.name == 'nt': options.extra_defines.append('WIN32') return options # check_os() 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 SystemExit( '"%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\n' % (key, ' '.join(sbf[key])))#, file=output) # fix_build_file() def setup_opengl_build(configuration, options, package): """Setup the OpenGL extension build """ print('Setup the OpenGL package build.') build_dir = options.opengl tmp_dir = 'tmp-' + build_dir build_file = os.path.join(tmp_dir, '%s.sbf' % options.opengl) # 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.') pyqt_sip_flags="" if options.qt == 5: pyqt_sip_flags = qtconf['sip_flags'] sipfile = os.path.join( os.pardir, "sip", "OpenGL_Qt5_Module.sip") # invoke SIP print(qtconf['sip_flags']) cmd = ' '.join( [configuration.sip_bin, "-I",pyqt_sip_dir, pyqt_sip_flags, '-b', build_file, '-c', tmp_dir, options.jobs, options.trace, ] # SIP assumes POSIX style path separators + [sipfile.replace('\\', '/')] ) print('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): print('Copy %s -> %s.' % (source, target)) lazy_copies += 1 print('%s file(s) lazily copied.' % lazy_copies) # module makefile if options.qt == 5: # FIXME options.extra_include_dirs.append( os.path.join(qt_inc_dir, 'Qt')) options.extra_include_dirs.append( os.path.join(qt_inc_dir, 'QtCore')) options.extra_include_dirs.append( os.path.join(qt_inc_dir, 'QtGui')) options.extra_include_dirs.append( os.path.join(qt_inc_dir, 'QtWidgets')) options.extra_include_dirs.append( os.path.join(qt_inc_dir, 'QtOpenGL')) options.extra_include_dirs.append(qt_inc_dir) """makefile = sipconfig.ModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, #installs = installs, qt = ['QtOpenGL'], opengl = 1, warnings = 1, debug = options.debug, )""" makefile = sipconfig.SIPModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, #installs = installs, #qt = ['QtOpenGL'], opengl = 1, 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() # setup_opengl_build() def nsis(): """Generate the script for the Nullsoft Scriptable Install System. """ try: from numpy.version import version as numpy_version from PyQt5.Qt import PYQT_VERSION_STR, QT_VERSION_STR except: return open('PyQwt3D.nsi', 'w').write(open('PyQwt3D.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_qwt3d_build(configuration, options, package): """Setup the Qwt3D extension build """ print('Setup the Qwt3D package build.') # initialize build_dir = options.qwt3d tmp_dir = "tmp-%s" % options.qwt3d build_file = os.path.join(tmp_dir, "qwt3d.sbf") #sip_dir = os.path.join(configuration.pyqt_sip_dir, 'Qwt3D') sip_dir = os.path.join(pyqt_sip_dir, 'Qwt3D') extra_sources = [] extra_headers = [] extra_moc_headers = [] extra_py_files = glob.glob( os.path.join(os.pardir, 'qt5lib', 'PyQt5', 'Qwt3D', '*.py')) # do we compile and link the sources of QwtPlot3D into PyQwt3D? if options.qwtplot3d_sources: # yes, zap all 'qwtplot3d' while options.extra_libs.count('qwtplot3d'): options.extra_libs.remove('qwtplot3d') elif 'qwtplot3d' not in options.extra_libs: # no, add 'qwtplot3d' if needed options.extra_libs.append('qwtplot3d') # This line is added by the Debian while options.extra_libs.count('qwtplot3d'): options.extra_libs.remove('qwtplot3d') # do we also compile and link the sources of zlib into PyQwt3D? if options.zlib_sources: options.extra_defines.append('HAVE_ZLIB') print("Extended options:") pprint.pprint(options.__dict__) print() # do we compile and link the sources of QwtPlot3D statically into PyQwt3D? if options.qwtplot3d_sources: extra_sources += glob.glob(os.path.join( options.qwtplot3d_sources, 'src', '*.cpp')) extra_sources += glob.glob(os.path.join( options.qwtplot3d_sources, '3rdparty', 'gl2ps', '*.c')) extra_headers += glob.glob(os.path.join( options.qwtplot3d_sources, 'include', '*.h')) extra_headers += glob.glob(os.path.join( options.qwtplot3d_sources, '3rdparty', 'gl2ps', '*.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) # do we compile and link the sources of zlib statically into PyQwt3D? if options.zlib_sources: examples = ('example.c', 'minigzip.c') for source in glob.glob(os.path.join(options.zlib_sources, '*.c')): if os.path.basename(source) not in examples: extra_sources.append(source) extra_headers += glob.glob(os.path.join( options.zlib_sources, '*.h')) # add the interface to the numerical Python extensions extra_sources += glob.glob(os.path.join(os.pardir, 'numpy', '*.cpp')) extra_headers += glob.glob(os.path.join(os.pardir, 'numpy', '*.h')) # add the extra headers which make protected data members accessible extra_headers += glob.glob(os.path.join(os.pardir, 'include', '*.h')) # put all code into a clean temporary directory try: shutil.rmtree(tmp_dir) except: pass try: os.mkdir(tmp_dir) except: raise SystemExit("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) # fix '#include "gl2ps".h' because gl2ps.h got relocated if options.qwtplot3d_sources: for source in [os.path.join(tmp_dir, 'qwt3d_io_gl2ps.cpp')]: text = open(source).read() if -1 != text.find('../3rdparty/gl2ps/'): open(source, 'w').write(text.replace('../3rdparty/gl2ps/', '')) pyqt_sip_flags="" if options.qt == 5: pyqt_sip_flags = qtconf['sip_flags'] sipfile = os.path.join( os.pardir, "sip", "Qwt3D_Qt5_Module.sip") # invoke SIP cmd = " ".join( [configuration.sip_bin, # SIP assumes POSIX style path separators #"-I", os.path.join(os.pardir, "sip").replace("\\", "/"), "-I", pyqt_sip_dir.replace("\\", "/"), pyqt_sip_flags, "-b", build_file, "-c", tmp_dir, options.jobs, options.trace, ] + options.sip_include_dirs + options.excluded_features + options.timelines # SIP assumes POSIX style path separators + [sipfile.replace("\\", "/")] ) print("sip invokation:") pprint.pprint(cmd) print() if os.path.exists(build_file): os.remove(build_file) os.system(cmd) if not os.path.exists(build_file): raise SystemExit('SIP failed to generate the C++ code.') # FIXME: sip-4.7 does not generate those include files anymore for name in [os.path.join(tmp_dir, name) for name in [ 'sip_Qwt3DAxisVector.h', 'sip_Qwt3DColorVector.h', 'sip_Qwt3DCellField.h', 'sip_Qwt3DDoubleVector.h', 'sip_Qwt3DFreeVector.h', 'sip_Qwt3DTriple.h', 'sip_Qwt3DTripleField.h', ]]: if not os.path.exists(name): open(name, 'w') # 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]) # Windows fix: resolve the scope of POINTS in enumValues[] for source in glob.glob(os.path.join(tmp_dir, '*.cpp')): text = open(source).read() # sipNm__Qwt3D_POINTS changed between: SIP-4.2 and SIP-4.2.1 if (-1 != text.find('{sipNm__Qwt3D_POINTS, POINTS')): text = text.replace('{sipNm__Qwt3D_POINTS, POINTS', '{sipNm__Qwt3D_POINTS, Qwt3D::POINTS') open(source, 'w').write(text) # copy lazily to the build directory to speed up recompilation if not os.path.exists(build_dir): try: os.mkdir(build_dir) except: raise SystemExit("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): print("Copy %s -> %s." % (source, target)) lazy_copies += 1 print("%s file(s) lazily copied." % lazy_copies) # byte-compile the Python files compileall.compile_dir(build_dir, 1, 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]) for option in options.sip_include_dirs: # split and undo the POSIX style path separator directory = option.split()[-1].replace('/', os.sep) if directory.startswith(os.pardir): installs.append([[os.path.join(os.pardir, f) for f in glob.glob( os.path.join(directory, "*.sip"))], sip_dir]) # module makefile if options.qt == 5: # FIXME options.extra_include_dirs.append( os.path.join(qt_inc_dir, 'Qt')) makefile = sipconfig.SIPModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, installs = installs, #qt = ['QtCore', 'QtGui', 'QtOpenGL'], opengl = 1, warnings = 1, debug = options.debug, ) """ makefile = sipconfig.SIPModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, #installs = installs, #qt = ['QtOpenGL'], opengl = 1, 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() nsis() # setup_qwt3d_build() def setup_parent_build(configuration, options): """Generate the parent Makefile """ print("Setup the PyQwt3D build.") 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( '-5', '--qt5', action='store_const', const=5, dest='qt', default=5, help=('build for Qt5 and PyQt5 [default Qt5]')) common_options.add_option( '-Q', '--qwtplot3d-sources', default='', action='store', type='string', metavar='/sources/of/qwtplot3d', help=('compile and link the QwtPlot3D source files in' ' /sources/of/qwtplot3d statically into PyQwt3D' ' (required on Windows)')) common_options.add_option( '-Z', '--zlib-sources', default='', action='store', type='string', metavar='/sources/of/zlib', help=('compile and link the QwtPlot3D source files in' ' /sources/of/zlib statically into PyQwt3D' ' (the -Z option is ignored without the -Q option)')) common_options.add_option( '-D', '--extra-defines', default=[], action='append', type='string', metavar='HAVE_ZLIB', help=('add an extra preprocessor definition (HAVE_ZLIB enables' ' compression of EPS/PDF/PS/SVG output and HAVE_LIBPNG enables' ' pixmaps in the SVG output, but both defines are ignored' ' without the -Q option)')) common_options.add_option( '-I', '--extra-include-dirs', default=[], action='append', type='string', metavar='/usr/include/qwtplot3d', help=('add an extra directory to search for headers' ' (the compiler must be able to find the QwtPlot3D 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 QwtPlot3D 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)')) common_options.add_option( '-l', '--extra-libs', default=[], action='append', type='string', metavar='z', help=('add an extra library (to link the zlib library, you must' ' specify "zlib" or "zlib1" on Windows' ' and "z" on POSIX and MacOS/X)')) 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( '--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='ESP_3_2_1', help=('add a timeline for SIP to adapt to a library version' ' (normally one of the timeline options in sip/timelines.sip)')) sip_options.add_option( '--sip-include-dirs', default=[os.path.join(os.pardir, 'sip')], 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' else: options.trace = '' if options.qwtplot3d_sources == '': options.zlib_sources = '' if options.trace: options.trace = '-r' options.extra_defines.append('TRACE_PYQWT3D') else: options.trace = '' options.modules = [] options.subdirs = [] return options, args # parse_args() def main(): # parse the command line options, args = parse_args() print("Command line options:") pprint.pprint(options.__dict__) print() configuration = get_pyqt_configuration(options) # extend the options options = check_sip(configuration, options, 'PyQwt3D') options = check_os(configuration, options, 'PyQwt3D') #options = check_compiler(configuration, options, 'PyQwt3D') options = check_numpy(configuration, options, 'PyQwt3D') if not options.module_install_path: options.module_install_path = os.path.join( pyqt_mod_dir, 'Qwt3D') setup_opengl_build(configuration, options, 'PyQwt3D') setup_qwt3d_build(configuration, options, 'PyQwt3D') # main makefile sipconfig.ParentMakefile( configuration = configuration, subdirs = options.subdirs).generate() # main() if __name__ == "__main__": main() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/configure/configure.py000077500000000000000000001025041334664011000207230ustar00rootroot00000000000000#!/usr/bin/python """ Generate the build tree and Makefiles for PyQwt3D. """ # Copyright (C) 2003-2008 Gerard Vermeulen # # This file is part of PyQwt3D. # # PyQwt3D 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. # # PyQwt3D 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, # PyQwt3D becomes a free plug-in for a non-free program. import compileall import glob import optparse import os import pprint import re import shutil import sys import traceback class Die(Exception): def __init__(self, info): Exception.__init__(self, info) # __init__() # class Die try: required = 'At least SIP-4.5 and its development tools are required.' import sipconfig except ImportError: raise Die(required) if 0x040500 > sipconfig._pkg_config['sip_version']: raise Die(required) del required def get_pyqt_configuration(options): """Return the PyQt configuration for Qt3 or Qt4 """ if options.qt == 3: required = 'At least PyQt-3.17 and its development tools are required.' options.qwt3d = 'Qwt3D_Qt3' options.opengl = 'OpenGL_Qt3' options.excluded_features.append("-x HAS_QT4 -x HAS_QT5") try: import pyqtconfig as pyqtconfig except ImportError: raise Die(required) if 0x031100 > pyqtconfig._pkg_config['pyqt_version']: raise Die(required) elif options.qt == 4: required = 'At least PyQt-4.1 and its development tools are required.' options.qwt3d = 'Qwt3D_Qt4' options.opengl = 'OpenGL_Qt4' options.excluded_features.append("-x HAS_QT3 -x HAS_QT5") try: import PyQt4.pyqtconfig as pyqtconfig except ImportError: raise Die(required) if 0x040100 > pyqtconfig._pkg_config['pyqt_version']: raise Die(required) options.subdirs.extend([options.qwt3d, options.opengl]) try: configuration = pyqtconfig.Configuration() except AttributeError: raise Die( 'Check if SIP and PyQt or PyQt4 have been installed properly.' ) 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 = 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 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 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 check_numarray(configuration, options, package): '''See if 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): print('Found numarray-%s.\n' % numarray.__version__) options.extra_defines.append('HAS_NUMARRAY') else: print(('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') print(('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): print('Found Numeric-%s.\n' % Numeric.__version__) options.extra_defines.append('HAS_NUMERIC') else: print(('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') print(('Failed to find Numeric: ' '%s will be build without support for Numeric.\n' ) % (package,)) return options # check_numeric() def check_numpy(configuration, 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 # Try to find numpy/arrayobject.h. from numpy.distutils.misc_util import get_numpy_include_dirs 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: print(('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,)) raise ImportError print('Found NumPy-%s.\n' % numpy.__version__) options.extra_defines.append('HAS_NUMPY') options.extra_include_dirs.extend(include_dirs) except ImportError: options.excluded_features.append('-x HAS_NUMPY') print(('Failed to find NumPy: ' '%s will be build without support for NumPy.\n' ) % (package,)) return options # check_numpy() def check_sip(configuration, options, package): """Check if PyQwt3D can be built with SIP. """ version = configuration.sip_version version_str = configuration.sip_version_str required = '%s requires at least SIP-4.5' % (package,) print("Found SIP-%s.\n" % version_str) if 0x040500 > version: raise SystemExit(required) options.extra_include_dirs.append(configuration.sip_inc_dir) return options # check_sip() def check_compiler(configuration, options, package): """Check compiler specifics """ print('Do not get upset by error messages in the next 3 compiler checks:') makefile = sipconfig.Makefile(configuration=configuration) generator = makefile.optional_string('MAKEFILE_GENERATOR', 'UNIX') # FIXME: 'MSVC' should be worse than 'MSVC.NET' if generator in ['MSVC', 'MSVC.NET']: options.extra_cxxflags.extend(['-GR', '-GX']) program = os.linesep.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) print("Check if 'size_t' and '%s' are the same type:" % ctype) if compile_qt_program(name, configuration): comment = '' print("YES") else: print("NO") 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', 'types.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(configuration, options, package): """Adapt to different operating systems """ print("Found '%s' operating system:" % os.name) print(sys.version) print() if os.name == 'nt': options.extra_defines.append('WIN32') return options # check_os() 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 SystemExit( '"%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\n' % (key, ' '.join(sbf[key])))#, file=output) # fix_build_file() def setup_opengl_build(configuration, options, package): """Setup the OpenGL extension build """ print('Setup the OpenGL package build.') build_dir = options.opengl tmp_dir = 'tmp-' + build_dir build_file = os.path.join(tmp_dir, '%s.sbf' % options.opengl) # 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.') if options.qt == 3: pyqt_sip_flags = configuration.pyqt_qt_sip_flags sipfile = os.path.join( os.pardir, "sip", "OpenGL_Qt3_Module.sip") elif options.qt == 4: pyqt_sip_flags = configuration.pyqt_sip_flags sipfile = os.path.join( os.pardir, "sip", "OpenGL_Qt4_Module.sip") # invoke SIP cmd = ' '.join( [configuration.sip_bin, '-b', build_file, '-c', tmp_dir, options.jobs, options.trace, ] # SIP assumes POSIX style path separators + [sipfile.replace('\\', '/')] ) print('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): print('Copy %s -> %s.' % (source, target)) lazy_copies += 1 print('%s file(s) lazily copied.' % lazy_copies) # module makefile if options.qt == 3: makefile = sipconfig.ModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, #installs = installs, qt = 1, opengl = 1, warnings = 1, debug = options.debug, ) elif options.qt == 4: # FIXME options.extra_include_dirs.append( os.path.join(configuration.qt_inc_dir, 'Qt')) makefile = sipconfig.ModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, #installs = installs, qt = ['QtOpenGL'], opengl = 1, 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() # setup_opengl_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('PyQwt3D.nsi', 'w').write(open('PyQwt3D.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_qwt3d_build(configuration, options, package): """Setup the Qwt3D extension build """ print('Setup the Qwt3D package build.') # initialize build_dir = options.qwt3d tmp_dir = "tmp-%s" % options.qwt3d build_file = os.path.join(tmp_dir, "qwt3d.sbf") sip_dir = os.path.join(configuration.pyqt_sip_dir, 'Qwt3D') extra_sources = [] extra_headers = [] extra_moc_headers = [] if configuration.qt_version < 0x040000: extra_py_files = glob.glob( os.path.join(os.pardir, 'qt3lib', 'Qwt3D', '*.py')) else: extra_py_files = glob.glob( os.path.join(os.pardir, 'qt4lib', 'PyQt4', 'Qwt3D', '*.py')) # do we compile and link the sources of QwtPlot3D into PyQwt3D? if options.qwtplot3d_sources: # yes, zap all 'qwtplot3d' while options.extra_libs.count('qwtplot3d'): options.extra_libs.remove('qwtplot3d') #elif ('qwtplot3d' not in options.extra_libs: Must be added manually. libqwtplot3d or libqwtplot3d-qt4 is ok # no, add 'qwtplot3d' if needed # options.extra_libs.append('qwtplot3d') # do we also compile and link the sources of zlib into PyQwt3D? if options.zlib_sources: options.extra_defines.append('HAVE_ZLIB') print("Extended options:") pprint.pprint(options.__dict__) print() # do we compile and link the sources of QwtPlot3D statically into PyQwt3D? if options.qwtplot3d_sources: extra_sources += glob.glob(os.path.join( options.qwtplot3d_sources, 'src', '*.cpp')) extra_sources += glob.glob(os.path.join( options.qwtplot3d_sources, '3rdparty', 'gl2ps', '*.c')) extra_headers += glob.glob(os.path.join( options.qwtplot3d_sources, 'include', '*.h')) extra_headers += glob.glob(os.path.join( options.qwtplot3d_sources, '3rdparty', 'gl2ps', '*.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) # do we compile and link the sources of zlib statically into PyQwt3D? if options.zlib_sources: examples = ('example.c', 'minigzip.c') for source in glob.glob(os.path.join(options.zlib_sources, '*.c')): if os.path.basename(source) not in examples: extra_sources.append(source) extra_headers += glob.glob(os.path.join( options.zlib_sources, '*.h')) # add the interface to the numerical Python extensions extra_sources += glob.glob(os.path.join(os.pardir, 'numpy', '*.cpp')) extra_headers += glob.glob(os.path.join(os.pardir, 'numpy', '*.h')) # add the extra headers which make protected data members accessible extra_headers += glob.glob(os.path.join(os.pardir, 'include', '*.h')) # put all code into a clean temporary directory try: shutil.rmtree(tmp_dir) except: pass try: os.mkdir(tmp_dir) except: raise SystemExit("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) # fix '#include "gl2ps".h' because gl2ps.h got relocated if options.qwtplot3d_sources: for source in [os.path.join(tmp_dir, 'qwt3d_io_gl2ps.cpp')]: text = open(source).read() if -1 != text.find('../3rdparty/gl2ps/'): open(source, 'w').write(text.replace('../3rdparty/gl2ps/', '')) if options.qt == 3: pyqt_sip_flags = configuration.pyqt_qt_sip_flags sipfile = os.path.join( os.pardir, "sip", "Qwt3D_Qt3_Module.sip") elif options.qt == 4: pyqt_sip_flags = configuration.pyqt_sip_flags sipfile = os.path.join( os.pardir, "sip", "Qwt3D_Qt4_Module.sip") # invoke SIP cmd = " ".join( [configuration.sip_bin, # SIP assumes POSIX style path separators #"-I", os.path.join(os.pardir, "sip").replace("\\", "/"), "-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 + [sipfile.replace("\\", "/")] ) print("sip invokation:") pprint.pprint(cmd) print() if os.path.exists(build_file): os.remove(build_file) os.system(cmd) if not os.path.exists(build_file): raise SystemExit('SIP failed to generate the C++ code.') # FIXME: sip-4.7 does not generate those include files anymore for name in [os.path.join(tmp_dir, name) for name in [ 'sip_Qwt3DAxisVector.h', 'sip_Qwt3DColorVector.h', 'sip_Qwt3DCellField.h', 'sip_Qwt3DDoubleVector.h', 'sip_Qwt3DFreeVector.h', 'sip_Qwt3DTriple.h', 'sip_Qwt3DTripleField.h', ]]: if not os.path.exists(name): open(name, 'w') # 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]) # Windows fix: resolve the scope of POINTS in enumValues[] for source in glob.glob(os.path.join(tmp_dir, '*.cpp')): text = open(source).read() # sipNm__Qwt3D_POINTS changed between: SIP-4.2 and SIP-4.2.1 if (-1 != text.find('{sipNm__Qwt3D_POINTS, POINTS')): text = text.replace('{sipNm__Qwt3D_POINTS, POINTS', '{sipNm__Qwt3D_POINTS, Qwt3D::POINTS') open(source, 'w').write(text) # copy lazily to the build directory to speed up recompilation if not os.path.exists(build_dir): try: os.mkdir(build_dir) except: raise SystemExit("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): print("Copy %s -> %s." % (source, target)) lazy_copies += 1 print("%s file(s) lazily copied." % lazy_copies) # byte-compile the Python files compileall.compile_dir(build_dir, 1, 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]) for option in options.sip_include_dirs: # split and undo the POSIX style path separator directory = option.split()[-1].replace('/', os.sep) if directory.startswith(os.pardir): installs.append([[os.path.join(os.pardir, f) for f in glob.glob( os.path.join(directory, "*.sip"))], sip_dir]) # module makefile if options.qt == 3: makefile = sipconfig.ModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, installs = installs, qt = 1, opengl = 1, warnings = 1, debug = options.debug, ) elif options.qt == 4: # FIXME options.extra_include_dirs.append( os.path.join(configuration.qt_inc_dir, 'Qt')) makefile = sipconfig.ModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, installs = installs, qt = ['QtCore', 'QtGui', 'QtOpenGL'], opengl = 1, 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_qwt3d_build() def setup_parent_build(configuration, options): """Generate the parent Makefile """ print("Setup the PyQwt3D build.") 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', '--qwtplot3d-sources', default='', action='store', type='string', metavar='/sources/of/qwtplot3d', help=('compile and link the QwtPlot3D source files in' ' /sources/of/qwtplot3d statically into PyQwt3D' ' (required on Windows)')) common_options.add_option( '-Z', '--zlib-sources', default='', action='store', type='string', metavar='/sources/of/zlib', help=('compile and link the QwtPlot3D source files in' ' /sources/of/zlib statically into PyQwt3D' ' (the -Z option is ignored without the -Q option)')) common_options.add_option( '-D', '--extra-defines', default=[], action='append', type='string', metavar='HAVE_ZLIB', help=('add an extra preprocessor definition (HAVE_ZLIB enables' ' compression of EPS/PDF/PS/SVG output and HAVE_LIBPNG enables' ' pixmaps in the SVG output, but both defines are ignored' ' without the -Q option)')) common_options.add_option( '-I', '--extra-include-dirs', default=[], action='append', type='string', metavar='/usr/include/qwtplot3d', help=('add an extra directory to search for headers' ' (the compiler must be able to find the QwtPlot3D 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 QwtPlot3D 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)')) common_options.add_option( '-l', '--extra-libs', default=[], action='append', type='string', metavar='z', help=('add an extra library (to link the zlib library, you must' ' specify "zlib" or "zlib1" on Windows' ' and "z" on POSIX and MacOS/X)')) 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( '--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='ESP_3_2_1', help=('add a timeline for SIP to adapt to a library version' ' (normally one of the timeline options in sip/timelines.sip)')) sip_options.add_option( '--sip-include-dirs', default=[os.path.join(os.pardir, 'sip')], 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' else: options.trace = '' if options.qwtplot3d_sources == '': options.zlib_sources = '' if options.trace: options.trace = '-r' options.extra_defines.append('TRACE_PYQWT3D') else: options.trace = '' options.modules = [] options.subdirs = [] return options, args # parse_args() def main(): # parse the command line options, args = parse_args() print("Command line options:") pprint.pprint(options.__dict__) print() configuration = get_pyqt_configuration(options) # extend the options options = check_sip(configuration, options, 'PyQwt3D') options = check_os(configuration, options, 'PyQwt3D') options = check_compiler(configuration, options, 'PyQwt3D') options = check_numarray(configuration, options, 'PyQwt3D') options = check_numeric(configuration, options, 'PyQwt3D') options = check_numpy(configuration, options, 'PyQwt3D') if not options.module_install_path: options.module_install_path = os.path.join( configuration.pyqt_mod_dir, 'Qwt3D') setup_opengl_build(configuration, options, 'PyQwt3D') setup_qwt3d_build(configuration, options, 'PyQwt3D') # main makefile sipconfig.ParentMakefile( configuration = configuration, subdirs = options.subdirs).generate() # main() if __name__ == "__main__": main() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/configure/go-mingw.bat000066400000000000000000000005531334664011000206020ustar00rootroot00000000000000REM Example for "python configure.py [options]" on Windows REM Edit the argument for the -Q option to suit your system REM Assumes that only libpng.a has been built in c:\build\libpng-1.2.18 python configure.py -4 -Q ..\qwtplot3d-0.2.7 -Z ..\zlib-1.2.3 -D HAVE_ZLIB -D HAVE_PNG -I c:\build\libpng-1.2.32 -L c:\build\libpng-1.2.32 -l png make make install PyQwt3D-pyqwt3d-0.1.8/configure/go3.bat000066400000000000000000000003351334664011000175440ustar00rootroot00000000000000REM Example for "python configure.py [options]" on Windows REM Edit the argument for the -Q option to suit your system python configure.py -3 -Q ..\qwtplot3d-0.2.7 -Z ..\zlib-1.2.3 -D HAVE_ZLIB nmake nmake install PyQwt3D-pyqwt3d-0.1.8/configure/go4.bat000066400000000000000000000003351334664011000175450ustar00rootroot00000000000000REM Example for "python configure.py [options]" on Windows REM Edit the argument for the -Q option to suit your system python configure.py -4 -Q ..\qwtplot3d-0.2.7 -Z ..\zlib-1.2.3 -D HAVE_ZLIB nmake nmake install PyQwt3D-pyqwt3d-0.1.8/examples/000077500000000000000000000000001334664011000162205ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/examples/AutoSwitch.py000077500000000000000000000056141334664011000206750ustar00rootroot00000000000000#!/usr/bin/env python import sys from qt import QApplication, QSplitter, QTimer, SIGNAL from Qwt3D import * class Saddle(Function): def __init__(self, *args): Function.__init__(self, *args) self.setDomain(-2.5, 2.5, -2.5, 2.5) self.setMaxZ(1.5) self.setMinZ(-1.5) self.setMesh(31,31) # __init__() def __call__(self, x, y): return x*y # __call__() # class Saddle class Hat(Function): def __init__(self, *args): Function.__init__(self, *args) self.setDomain(-1.5, 1.5, -1.5, 1.5) self.setMesh(41, 41) # __init__() def __call__(self, x, y): return 1.0/(x*x+y*y+0.3) # __call__() # class Hat class Plot(SurfacePlot): def __init__(self, parent, updateinterval): SurfacePlot.__init__(self, parent) self.setRotation(30, 0, 15) self.setShift(0.1, 0, 0) self.setZoom(0.8) self.coordinates().setNumberFont("Courier", 8) axes = self.coordinates().axes # alias for axis in axes: axis.setMajors(7) axis.setMinors(4) axes[X1].setLabelString("x") axes[Y1].setLabelString("y") axes[Z1].setLabelString("z") axes[X2].setLabelString("x") axes[Y2].setLabelString("y") axes[Z2].setLabelString("z") axes[X3].setLabelString("x") axes[Y3].setLabelString("y") axes[Z3].setLabelString("z") axes[X4].setLabelString("x") axes[Y4].setLabelString("y") axes[Z4].setLabelString("z") timer = QTimer(self) self.connect(timer, SIGNAL('timeout()'), self.rotate) timer.start(updateinterval) # __init__() def rotate(self): self.setRotation(int(self.xRotation()+2) % 360, int(self.yRotation()+2) % 360, int(self.zRotation()+2) % 360) # rotate() # class Plot() def make(): demo = QSplitter(QSplitter.Horizontal) plot1 = Plot(demo, 30) plot1.setFloorStyle(FLOORISO) plot1.setCoordinateStyle(BOX) saddle = Saddle(plot1) saddle.create() plot1.setTitle("Autoswitching axes") plot1.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) plot1.makeCurrent() plot1.updateData() plot1.updateGL() plot2 = Plot(demo ,80) plot2.setZoom(0.8) hat = Hat(plot2) hat.create() plot2.setPlotStyle(HIDDENLINE) plot2.setFloorStyle(FLOORDATA) plot2.setCoordinateStyle(FRAME) plot2.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) plot2.makeCurrent() plot2.updateData() plot2.updateGL() demo.resize(800, 400) demo.show() return demo # make() def main(args): app = QApplication(args) demo = make() app.setMainWidget(demo) app.exec_loop() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/examples/EnrichmentDemo.py000077500000000000000000000220501334664011000214750ustar00rootroot00000000000000#!/usr/bin/env python # A Python translation of the "enrichments" example of QwtPlot3D import sys import qt from Qwt3D import * from Qwt3D.OpenGL import * # translated from enrichments.cpp class Bar(VertexEnrichment): def __init__(self, radius = 0.0, level = 1.0): VertexEnrichment.__init__(self) self.configure(radius, level) # init() def clone(self): return self # clone() def configure(self, radius, level): self.radius = radius self.level = level # configure() def drawBegin(self): self.diag = self.radius*(self.plot.hull().maxVertex - self.plot.hull().minVertex).length() glLineWidth(0) glEnable(GL_POLYGON_OFFSET_FILL) glPolygonOffset(1, 1) # drawBegin() def drawEnd(self): pass # drawEnd() def draw(self, pos): interval = self.plot.hull().maxVertex.z - self.plot.hull().minVertex.z numlevel = self.plot.hull().minVertex.z + self.level * interval interval /= 100 if pos.z > numlevel - interval and pos.z < numlevel + interval: Label3D().draw(pos, self.diag, 2*self.diag) minz = self.plot.hull().minVertex.z # FIXME: rgbat = self.plot.dataColor()(pos) rgbat = self.plot.dataColor()(pos.x, pos.y, pos.z) rgbab = self.plot.dataColor()(pos.x, pos.y, minz) glBegin(GL_QUADS) glColor4d(rgbab.r, rgbab.g, rgbab.b, rgbab.a) glVertex3d(pos.x - self.diag, pos.y - self.diag, minz) glVertex3d(pos.x + self.diag, pos.y - self.diag, minz) glVertex3d(pos.x + self.diag, pos.y + self.diag, minz) glVertex3d(pos.x - self.diag, pos.y + self.diag, minz) if pos.z > numlevel - interval and pos.z < numlevel + interval: glColor3d(0.7, 0.0, 0.0) else: glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glColor4d(rgbab.r, rgbab.g,rgbat.b, rgbab.a) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glColor4d(rgbat.r,rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glColor4d(rgbab.r, rgbab.g, rgbat.b, rgbab.a) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glColor4d(rgbab.r, rgbab.g, rgbat.b, rgbab.a) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glColor4d(rgbab.r, rgbab.g, rgbat.b, rgbab.a) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glEnd() glColor3d(0, 0, 0) glBegin(GL_LINES) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glEnd() # draw() # class Bar class Label3D: def __init__(self): pass # __init__() def draw(self, pos, w, h): gap = 0.3 glColor3d(1,1,1) glBegin(GL_QUADS) glVertex3d(pos.x - w, pos.y, pos.z + gap); glVertex3d(pos.x + w, pos.y, pos.z + gap); glVertex3d(pos.x + w, pos.y, pos.z + gap + h) glVertex3d(pos.x - w, pos.y, pos.z + gap + h) glEnd() glColor3d(0.4,0,0) glBegin(GL_LINE_LOOP) glVertex3d(pos.x - w, pos.y,pos.z + gap) glVertex3d(pos.x + w, pos.y,pos.z + gap) glVertex3d(pos.x + w, pos.y,pos.z + gap + h) glVertex3d(pos.x - w, pos.y, pos.z + gap + h) glEnd() glBegin(GL_LINES) glVertex3d(pos.x, pos.y, pos.z) glVertex3d(pos.x, pos.y, pos.z + gap) glEnd() # draw() # class Label3D class Hat(Function): def __init__(self, *args): Function.__init__(self, *args) # __init__() def __call__(self, x, y): return 1.0/(x*x + y*y + 0.5) # __call__() def name(self): return QString('$\\frac{1}{x^2+y^2+\\frac{1}{2}}$') # name() # class Hat # translated from enrichmentmainwindow.cpp class EnrichmentDemo(qt.QWidget): def __init__(self, *args): qt.QWidget.__init__(self, *args) plot = self.plot = SurfacePlot(self) plot.setTitle('Bar Style (Vertex Enrichment)') plot.setTitleFont('Arial', 12) plot.setZoom(0.8); plot.setRotation(30.0, 0.0, 15.0) plot.setCoordinateStyle(BOX) self.width = 0.007 self.level = .5 self.bar = plot.setPlotStyle(Bar(self.width, self.level)) hat = Hat(plot) hat.setMesh(23, 21) hat.setDomain(-1.8, 1.7, -1.6, 1.7) hat.create() plot.setFloorStyle(FLOORDATA) axes = plot.coordinates().axes # alias for axis in axes: axis.setMajors(5) axis.setMinors(4) plot.coordinates().setGridLinesColor(RGBA(0.0, 0.0, 0.5)) plot.coordinates().setLineWidth(1) plot.coordinates().setNumberFont("Courier", 8) plot.coordinates().adjustNumbers(5) self.setColor() plot.updateData(); plot.updateGL(); # Level levelLabel = qt.QLabel('Level', self) levelSlider = qt.QSlider(self) levelSlider.setValue(50); levelSlider.setTickmarks(qt.QSlider.Right) levelSlider.setTickInterval(10) levelSlider.setMaxValue(100) levelLayout = qt.QVBoxLayout() levelLayout.addWidget(levelLabel) levelLayout.addWidget(levelSlider) self.connect( levelSlider, qt.SIGNAL('valueChanged(int)'), self.setLevel) # Layout mainLayout = qt.QHBoxLayout(self) #self.setLayout(mainLayout) mainLayout.addWidget(plot) mainLayout.addLayout(levelLayout) # __init__() def setColor(self): i, step = 252, 4 colorVector = ColorVector() while (i>=0): colorVector.push_back(RGBA(i/255.0, max((i-60)/255.0, 0.0), 0.0)) step -= 1 if step == 0: i -= 4 step = 4 color = StandardColor(self.plot) color.setColorVector(colorVector) self.plot.setDataColor(color) # setColor() def setLevel(self, level): self.level = 1.0 - 0.01*level; self.bar.configure(self.width, self.level) self.plot.updateData() self.plot.updateGL() # setLevel() # class EnrichmentDemo def make(): demo = EnrichmentDemo() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = qt.QApplication(args) demo = make() app.setMainWidget(demo) app.exec_loop() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/examples/Grab.py000077500000000000000000000027311334664011000174530ustar00rootroot00000000000000#!/usr/bin/env python import inspect # iqt is part of PyQwt import Qwt5.iqt from Qwt3D import Plot3D, save def walk(p): if isinstance(p, Plot3D): yield p else: if p.children() is not None: for c in p.children(): for cc in walk(c): yield cc # def walk() def main(): print inspect.getsource(save) for demo in ['ParametricSurfaceDemo', 'SimplePlot', 'TestNumPy', ]: result = __import__(demo).make() raw_input("Is the demo looking HAPPY? ") for format in ('png', 'pdf', 'ps', 'eps', 'svg'): print 'Saving %s.%s...' % (demo, format), if save(result, '%s.%s' % (demo, format), format): print 'success' else: print 'failure' for demo in ['AutoSwitch', 'EnrichmentDemo', ]: result = __import__(demo).make() raw_input("Is the demo looking HAPPY? ") for i, w in enumerate(walk(result)): for format in ('png', 'pdf', 'ps', 'eps', 'svg'): print 'Saving %s%s.%s...' % (demo, i, format), if save(w, '%s%s.%s' % (demo, i, format), format): print 'success' else: print 'failure' # main() if __name__ == '__main__': main() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/examples/Makefile000066400000000000000000000000361334664011000176570ustar00rootroot00000000000000html: python py2html.py *.py PyQwt3D-pyqwt3d-0.1.8/examples/ParametricSurfaceDemo.py000077500000000000000000000025671334664011000230140ustar00rootroot00000000000000#!/usr/bin/env python import sys from math import cos, pi, sin from qt import QApplication from Qwt3D import ParametricSurface, RGBA, SurfacePlot, Triple, NOCOORD class Sphere(ParametricSurface): def __init__(self, *args): ParametricSurface.__init__(self, *args) self.setMesh(41, 31) self.setDomain(0, 2*pi, 0, pi) self.setPeriodic(False, False) # __init__() def __call__(self, u, v): r = 1.0 return Triple(r*cos(u)*sin(v), r*sin(u)*sin(v), r*cos(v)) # __call__() # class Sphere class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) self.setTitle("A Simple Parametric Surface Demonstration") self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) sphere = Sphere(self) sphere.create() self.setRotation(45, 15, 0) self.setCoordinateStyle(NOCOORD); self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.setMainWidget(demo) app.exec_loop() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/examples/PyFontify.py000066400000000000000000000107151334664011000205250ustar00rootroot00000000000000"""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]` PyQwt3D-pyqwt3d-0.1.8/examples/SimplePlot.py000077500000000000000000000033211334664011000206640ustar00rootroot00000000000000#!/usr/bin/env python import sys from math import log from PyQt4 import Qt from PyQt4.Qwt3D import Function, RGBA, SurfacePlot, BOX, X1, Y1, Z1 class Rosenbrock(Function): def __init__(self, *args): Function.__init__(self, *args) # __init__() def __call__(self, x, y): return log((1-x)*(1-x) + 100*(y-x*x)*(y-x*x)) / 8 # __call__() # class Rosenbrock class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) self.setTitle('A Simple SurfacePlot Demonstration'); self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) rosenbrock = Rosenbrock(self) rosenbrock.setMesh(41, 31) rosenbrock.setDomain(-1.73, 1.5, -1.5, 1.5) rosenbrock.setMinZ(-10) rosenbrock.create() self.setRotation(30, 0, 15) self.setScale(1, 1, 1) self.setShift(0.15, 0, 0) self.setZoom(0.9) axes = self.coordinates().axes # alias for axis in axes: axis.setMajors(7) axis.setMinors(4) axes[X1].setLabelString('x-axis') axes[Y1].setLabelString('y-axis') axes[Z1].setLabelString('z-axis') self.setCoordinateStyle(BOX); self.updateData(); self.updateGL(); # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = Qt.QApplication(args) demo = make() #app.setMainWidget(demo) sys.exit(app.exec_()) # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/examples/TestNumPy.py000077500000000000000000000056551334664011000205200ustar00rootroot00000000000000#!/usr/bin/env python from numpy import * import sys from Qwt3D import * from qt import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) def matrix2d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( double **, unsigned int, unsigned int, double, double, double, double); """ # columns xs = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, float)) # rows ys = multiply.outer( ones((nx,), float), miny+((maxy-miny)/(ny-1))*arange(ny)) return function(xs, ys) # matrix2d() def matrix3d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( Triple **, unsigned int, unsigned int, bool = false, bool = false); """ xyzs = zeros((nx, ny, 3), float) # columns xyzs[:,:,0] = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, float)) # rows xyzs[:,:,1] = multiply.outer( ones((nx,), float), miny+((maxy-miny)/(ny-1))*arange(ny)) # result xyzs[:,:,2] = function(xyzs[:,:,0], xyzs[:,:,1]) return xyzs # matrix3d() def saddle(x, y): return x*y # saddle() class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) self.setRotation(30, 0, 15) self.setScale(1.0, 1.0, 1.0) nx, ny, minx, maxx, miny, maxy = 3, 5, -1.0, 1.0, -1.0, 1.0 if True: zs = matrix2d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print zs self.loadFromData(zs, minx, maxx, miny, maxy) else: xyzs = matrix3d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print xyzs self.loadFromData(xyzs) axes = self.coordinates().axes # alias for axis, label in ((X1, "x"), (Y1, "y"), (Z1, "z")): axes[axis].setAutoScale(False) axes[axis].setMajors(5) # 6 major ticks axes[axis].setMinors(3) # 2 minor ticks axes[axis].setLabelString(label) self.setCoordinateStyle(BOX) self.coordinates().setGridLines(True, True) self.coordinates().setLineSmooth(True) self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.setMainWidget(demo) app.exec_loop() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/examples/TestNumarray.py000077500000000000000000000056601334664011000212420ustar00rootroot00000000000000#!/usr/bin/env python from numarray import * import sys from Qwt3D import * from qt import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) def matrix2d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( double **, unsigned int, unsigned int, double, double, double, double); """ # columns xs = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows ys = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) return function(xs, ys) # matrix2d() def matrix3d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( Triple **, unsigned int, unsigned int, bool = false, bool = false); """ xyzs = zeros((nx, ny, 3), Float) # columns xyzs[:,:,0] = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows xyzs[:,:,1] = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) # result xyzs[:,:,2] = function(xyzs[:,:,0], xyzs[:,:,1]) return xyzs # matrix3d() def saddle(x, y): return x*y # saddle() class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) self.setRotation(30, 0, 15) self.setScale(1.0, 1.0, 1.0) nx, ny, minx, maxx, miny, maxy = 3, 5, -1.0, 1.0, -1.0, 1.0 if True: zs = matrix2d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print zs self.loadFromData(zs, minx, maxx, miny, maxy) else: xyzs = matrix3d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print xyzs self.loadFromData(xyzs) axes = self.coordinates().axes # alias for axis, label in ((X1, "x"), (Y1, "y"), (Z1, "z")): axes[axis].setAutoScale(False) axes[axis].setMajors(5) # 6 major ticks axes[axis].setMinors(3) # 2 minor ticks axes[axis].setLabelString(label) self.setCoordinateStyle(BOX) self.coordinates().setGridLines(True, True) self.coordinates().setLineSmooth(True) self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.setMainWidget(demo) app.exec_loop() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/examples/TestNumeric.py000077500000000000000000000056571334664011000210540ustar00rootroot00000000000000#!/usr/bin/env python from Numeric import * import sys from Qwt3D import * from qt import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) def matrix2d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( double **, unsigned int, unsigned int, double, double, double, double); """ # columns xs = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows ys = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) return function(xs, ys) # matrix2d() def matrix3d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( Triple **, unsigned int, unsigned int, bool = false, bool = false); """ xyzs = zeros((nx, ny, 3), Float) # columns xyzs[:,:,0] = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows xyzs[:,:,1] = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) # result xyzs[:,:,2] = function(xyzs[:,:,0], xyzs[:,:,1]) return xyzs # matrix3d() def saddle(x, y): return x*y # saddle() class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) self.setRotation(30, 0, 15) self.setScale(1.0, 1.0, 1.0) nx, ny, minx, maxx, miny, maxy = 3, 5, -1.0, 1.0, -1.0, 1.0 if True: zs = matrix2d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print zs self.loadFromData(zs, minx, maxx, miny, maxy) else: xyzs = matrix3d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print xyzs self.loadFromData(xyzs) axes = self.coordinates().axes # alias for axis, label in ((X1, "x"), (Y1, "y"), (Z1, "z")): axes[axis].setAutoScale(False) axes[axis].setMajors(5) # 6 major ticks axes[axis].setMinors(3) # 2 minor ticks axes[axis].setLabelString(label) self.setCoordinateStyle(BOX) self.coordinates().setGridLines(True, True) self.coordinates().setLineSmooth(True) self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.setMainWidget(demo) app.exec_loop() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/examples/py2html.py000077500000000000000000000027751334664011000202070ustar00rootroot00000000000000#!/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) PyQwt3D-pyqwt3d-0.1.8/gendiff000077500000000000000000000017451334664011000157410ustar00rootroot00000000000000#!/usr/bin/env python import difflib import os import sys import time def usage(): print "gendiff tree .suffix" sys.exit(1) # usage() def main(args): if len(args) != 3: usage() tree = args[1] suffix = args[2] for root, _, files in os.walk(tree): for name in files: fromfile = os.path.join(root, name) tofile = os.path.join(root, os.path.splitext(name)[0]) if os.path.splitext(name)[-1] == suffix and os.path.exists(tofile): fromdate = time.ctime(os.stat(fromfile).st_mtime) todate = time.ctime(os.stat(tofile).st_mtime) fromlines = open(fromfile, 'U').readlines() tolines = open(tofile, 'U').readlines() sys.stdout.writelines(difflib.unified_diff( fromlines, tolines, fromfile, tofile, fromdate, todate)) # main() if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/include.pyqwt3d.patch000066400000000000000000000005561334664011000204660ustar00rootroot00000000000000--- include/qwt3d_enrichment.h.pyqwt3d 2006-09-16 08:07:52.000000000 +0200 +++ include/qwt3d_enrichment.h 2006-09-16 08:09:46.000000000 +0200 @@ -35,7 +35,8 @@ virtual void assign(Plot3D const& pl) {plot = &pl;} //!< Assign to existent plot; virtual TYPE type() const = 0; //!< Overwrite -protected: +// A PyQwt3D hack +public: const Plot3D* plot; }; PyQwt3D-pyqwt3d-0.1.8/include/000077500000000000000000000000001334664011000160255ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/include/qwt3d_enrichment.h000066400000000000000000000040541334664011000214570ustar00rootroot00000000000000#ifndef qwt3d_enrichment_h__2004_02_23_19_24_begin_guarded_code #define qwt3d_enrichment_h__2004_02_23_19_24_begin_guarded_code #include "qwt3d_global.h" #include "qwt3d_types.h" namespace Qwt3D { class Plot3D; //! Abstract base class for data dependent visible user objects /** Enrichments provide a framework for user defined OPenGL objects. The base class has a pure virtuell function clone(). 2 additional functions are per default empty and could also get a new implementation in derived classes. They can be used for initialization issues or actions not depending on the related primitive. */ class QWT3D_EXPORT Enrichment { public: enum TYPE{ VERTEXENRICHMENT, EDGEENRICHMENT, FACEENRICHMENT, VOXELENRICHMENT }; //!< Type of the Enrichment - only VERTEXENRICHMENT's are defined at this moment. Enrichment() : plot(0) {} virtual ~Enrichment(){} virtual Enrichment* clone() const = 0; //!< The derived class should give back a new Derived(something) here virtual void drawBegin(){}; //!< Empty per default. Can be overwritten. virtual void drawEnd(){}; //!< Empty per default. Can be overwritten. virtual void assign(Plot3D const& pl) {plot = &pl;} //!< Assign to existent plot; virtual TYPE type() const = 0; //!< Overwrite // A PyQwt3D hack public: const Plot3D* plot; }; //! Abstract base class for vertex dependent visible user objects /** VertexEnrichments introduce a specialized draw routine for vertex dependent data. draw() is called, when the Plot realizes its internal OpenGL data representation for every Vertex associated to his argument. */ class QWT3D_EXPORT VertexEnrichment : public Enrichment { public: VertexEnrichment() : Qwt3D::Enrichment() {} virtual Enrichment* clone() const = 0; //!< The derived class should give back a new Derived(something) here virtual void draw(Qwt3D::Triple const&) = 0; //!< Overwrite this virtual TYPE type() const {return Qwt3D::Enrichment::VERTEXENRICHMENT;} //!< This gives VERTEXENRICHMENT }; // todo EdgeEnrichment, FaceEnrichment, VoxelEnrichment etc. } // ns #endif PyQwt3D-pyqwt3d-0.1.8/numpy/000077500000000000000000000000001334664011000155525ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/numpy/qwt3d_numarray.cpp000066400000000000000000000050651334664011000212440ustar00rootroot00000000000000// qwt3d_numarray.cpp: encapsulates all PyQwt3D's calls to the numarray C-API. // // Copyright (C) 2004-2007 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #ifdef HAS_NUMARRAY #include #include #include #include void qwt3d_import_numarray() { import_array(); } int try_PyObject_to_NumarrayArrayContiguousFloat2D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny) { if (!PyArray_Check(in)) return 0; *out = PyArray_ContiguousFromObject(in, PyArray_DOUBLE, 2, 2); if (!*out) { PyErr_SetString( PyExc_RuntimeError, "Failed to make contiguous 2D array of PyArray_DOUBLE"); return -1; } *data = reinterpret_cast( reinterpret_cast(*out)->data); *nx = reinterpret_cast(*out)->dimensions[0]; *ny = reinterpret_cast(*out)->dimensions[1]; return 1; } int try_PyObject_to_NumarrayArrayContiguousFloat3D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny, unsigned int *nz) { if (!PyArray_Check(in)) return 0; *out = PyArray_ContiguousFromObject(in, PyArray_DOUBLE, 3, 3); if (!*out) { PyErr_SetString( PyExc_RuntimeError, "Failed to make contiguous 3D array of PyArray_DOUBLE"); return -1; } *data = reinterpret_cast( reinterpret_cast(*out)->data); *nx = reinterpret_cast(*out)->dimensions[0]; *ny = reinterpret_cast(*out)->dimensions[1]; *nz = reinterpret_cast(*out)->dimensions[2]; return 1; } #endif // HAS_NUMARRAY // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/numpy/qwt3d_numarray.h000066400000000000000000000026051334664011000207060ustar00rootroot00000000000000// qwt3d_numarray.h: encapsulates all PyQwt3D's calls to the numarray C-API. // // Copyright (C) 2004-2007 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #ifndef QWT3D_NUMARRAY_H #define QWT3D_NUMARRAY_H #include #ifdef HAS_NUMARRAY int try_PyObject_to_NumarrayArrayContiguousFloat2D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny); int try_PyObject_to_NumarrayArrayContiguousFloat3D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny, unsigned int *nz); #endif // HAS_NUMARRAY #endif // QWT3D_NUMARRAY_H // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/numpy/qwt3d_numeric.cpp000066400000000000000000000050501334664011000210420ustar00rootroot00000000000000// qwt3d_numeric.cpp: encapsulates all PyQwt3D's calls to the Numeric C-API. // // Copyright (C) 2004-2007 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #ifdef HAS_NUMERIC #include #include #include #include void qwt3d_import_numeric() { import_array(); } int try_PyObject_to_NumericArrayContiguousFloat2D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny) { if (!PyArray_Check(in)) return 0; *out = PyArray_ContiguousFromObject(in, PyArray_DOUBLE, 2, 2); if (!*out) { PyErr_SetString( PyExc_RuntimeError, "Failed to make contiguous 2D array of PyArray_DOUBLE"); return -1; } *data = reinterpret_cast( reinterpret_cast(*out)->data); *nx = reinterpret_cast(*out)->dimensions[0]; *ny = reinterpret_cast(*out)->dimensions[1]; return 1; } int try_PyObject_to_NumericArrayContiguousFloat3D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny, unsigned int *nz) { if (!PyArray_Check(in)) return 0; *out = PyArray_ContiguousFromObject(in, PyArray_DOUBLE, 3, 3); if (!*out) { PyErr_SetString( PyExc_RuntimeError, "Failed to make contiguous 3D array of PyArray_DOUBLE"); return -1; } *data = reinterpret_cast( reinterpret_cast(*out)->data); *nx = reinterpret_cast(*out)->dimensions[0]; *ny = reinterpret_cast(*out)->dimensions[1]; *nz = reinterpret_cast(*out)->dimensions[2]; return 1; } #endif // HAS_NUMERIC // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/numpy/qwt3d_numeric.h000066400000000000000000000025741334664011000205170ustar00rootroot00000000000000// qwt3d_numeric.h: encapsulates all PyQwt3D's calls to the Numeric C-API. // // Copyright (C) 2004-2007 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #ifndef QWT3D_NUMERIC_H #define QWT3D_NUMERIC_H #include #ifdef HAS_NUMERIC int try_PyObject_to_NumericArrayContiguousFloat2D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny); int try_PyObject_to_NumericArrayContiguousFloat3D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny, unsigned int *nz); #endif // HAS_NUMERIC #endif // QWT3D_NUMERIC_H // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/numpy/qwt3d_numpy.cpp000066400000000000000000000054141334664011000205540ustar00rootroot00000000000000// qwt3d_numeric.cpp: encapsulates all PyQwt3D's calls to the Numeric C-API. // // Copyright (C) 2004-2007 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #ifdef HAS_NUMPY #include #include #include #include #if PY_MAJOR_VERSION >= 3 int qwt3d_import_numpy() { // this is a function which does error handling import_array(); return 0; } #else void qwt3d_import_numpy() { // this is a function which does error handling import_array(); } #endif int try_PyObject_to_NumPyArrayContiguousFloat2D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny) { if (!PyArray_Check(in)) return 0; *out = PyArray_ContiguousFromObject(in, PyArray_DOUBLE, 2, 2); if (!*out) { PyErr_SetString( PyExc_RuntimeError, "Failed to make contiguous 2D array of PyArray_DOUBLE"); return -1; } *data = reinterpret_cast( reinterpret_cast(*out)->data); *nx = reinterpret_cast(*out)->dimensions[0]; *ny = reinterpret_cast(*out)->dimensions[1]; return 1; } int try_PyObject_to_NumPyArrayContiguousFloat3D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny, unsigned int *nz) { if (!PyArray_Check(in)) return 0; *out = PyArray_ContiguousFromObject(in, PyArray_DOUBLE, 3, 3); if (!*out) { PyErr_SetString( PyExc_RuntimeError, "Failed to make contiguous 3D array of PyArray_DOUBLE"); return -1; } *data = reinterpret_cast( reinterpret_cast(*out)->data); *nx = reinterpret_cast(*out)->dimensions[0]; *ny = reinterpret_cast(*out)->dimensions[1]; *nz = reinterpret_cast(*out)->dimensions[2]; return 1; } #endif // HAS_NUMPY // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/numpy/qwt3d_numpy.h000066400000000000000000000025541334664011000202230ustar00rootroot00000000000000// qwt3d_numeric.h: encapsulates all PyQwt3D's calls to the NumPy C-API. // // Copyright (C) 2004-2007 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #ifndef QWT3D_NUMPY_H #define QWT3D_NUMPY_H #include #ifdef HAS_NUMPY int try_PyObject_to_NumPyArrayContiguousFloat2D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny); int try_PyObject_to_NumPyArrayContiguousFloat3D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny, unsigned int *nz); #endif // HAS_NUMPY #endif // QWT3D_NUMPY_H // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/numpy/qwt3d_python.cpp000066400000000000000000000070241334664011000207240ustar00rootroot00000000000000// qwt3d_python.cpp: // - return a handle to the data of contiguous numarray and Numeric arrays. // // Copyright (C) 2004-2007 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include #include #include #include int try_PyObject_to_PyArrayContiguousFloat2D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny) { int result; #ifdef HAS_NUMPY if ((result = try_PyObject_to_NumPyArrayContiguousFloat2D( in, out, data, nx, ny))) return result; #endif #ifdef HAS_NUMERIC if ((result = try_PyObject_to_NumericArrayContiguousFloat2D( in, out, data, nx, ny))) return result; #endif #ifdef HAS_NUMARRAY if ((result = try_PyObject_to_NumarrayArrayContiguousFloat2D( in, out, data, nx, ny))) return result; #endif PyErr_SetString(PyExc_TypeError, "expected is a sequency convertible to\n" #ifdef HAS_NUMPY "(*) a NumPy 2D array of PyArray_DOUBLE.\n" #else "(!) rebuild PyQwt3D to support NumPy arrays.\n" #endif #ifdef HAS_NUMERIC "(*) a Numeric 2D array of PyArray_DOUBLE.\n" #else "(!) rebuild PyQwt3D to support Numeric arrays.\n" #endif #ifdef HAS_NUMARRAY "(*) a numarray 2D array of PyArray_DOUBLE.\n" #else "(!) rebuild PyQwt3D to support numarray arrays.\n" #endif ); return -1; } int try_PyObject_to_PyArrayContiguousFloat3D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny, unsigned int *nz) { int result; #ifdef HAS_NUMPY if ((result = try_PyObject_to_NumPyArrayContiguousFloat3D( in, out, data, nx, ny, nz))) return result; #endif #ifdef HAS_NUMERIC if ((result = try_PyObject_to_NumericArrayContiguousFloat3D( in, out, data, nx, ny, nz))) return result; #endif #ifdef HAS_NUMARRAY if ((result = try_PyObject_to_NumarrayArrayContiguousFloat3D( in, out, data, nx, ny, nz))) return result; #endif PyErr_SetString(PyExc_TypeError, "expected is a sequency convertible to\n" #ifdef HAS_NUMPY "(*) a contiguous NumPy 3D array of PyArray_DOUBLE.\n" #else "(!) rebuild PyQwt3D to support NumPy arrays.\n" #endif #ifdef HAS_NUMERIC "(*) a contiguous Numeric 3D array of PyArray_DOUBLE.\n" #else "(!) rebuild PyQwt3D to support Numeric arrays.\n" #endif #ifdef HAS_NUMARRAY "(*) a contiguous numarray 3D array of PyArray_DOUBLE.\n" #else "(!) rebuild PyQwt3D to support numarray arrays.\n" #endif ); return -1; } // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/numpy/qwt3d_python.h000066400000000000000000000035441334664011000203740ustar00rootroot00000000000000// qwt3d_python.h: // - return a handle to the data of contiguous numarray and Numeric arrays. // // Copyright (C) 2004-2007 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #ifndef QWT3D_PYTHON_H #define QWT3D_PYTHON_H #include #ifdef HAS_NUMARRAY // to hide numarray's import_array() void qwt3d_import_numarray(); #endif // HAS_NUMARRAY #ifdef HAS_NUMERIC // to hide Numeric's import_array() void qwt3d_import_numeric(); #endif // HAS_NUMERIC #ifdef HAS_NUMPY // to hide NumPy's import_array() #if PY_MAJOR_VERSION >= 3 int qwt3d_import_numpy(); #else void qwt3d_import_numpy(); #endif #endif // HAS_NUMPY // returns 1, 0, -1 in case of success, wrong object type, failure int try_PyObject_to_PyArrayContiguousFloat2D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny); // returns 1, 0, -1 in case of success, wrong object type, failure int try_PyObject_to_PyArrayContiguousFloat3D( PyObject *in, PyObject **out, double **data, unsigned int *nx, unsigned int *ny, unsigned int *nz); #endif // QWT3D_PYTHON_H // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/pyqwt3d-0.2.7.patch000066400000000000000000000144221334664011000175030ustar00rootroot00000000000000--- qwtplot3d-0.2.7/include/qwt3d_global.h.pyqwt3d Tue Aug 7 19:50:24 2007 +++ qwtplot3d-0.2.7/include/qwt3d_global.h Tue Aug 7 19:50:24 2007 @@ -8,7 +8,7 @@ #define QWT3D_MAJOR_VERSION 0 #define QWT3D_MINOR_VERSION 2 -#define QWT3D_PATCH_VERSION 6 +#define QWT3D_PATCH_VERSION 7 // // Create Qwt3d DLL if QWT3D_DLL is defined (Windows only) --- qwtplot3d-0.2.7/src/qwt3d_io.cpp.pyqwt3d Tue Aug 7 19:50:24 2007 +++ qwtplot3d-0.2.7/src/qwt3d_io.cpp Tue Aug 7 19:50:24 2007 @@ -302,6 +302,14 @@ #endif vecfunc.setFormat("PDF"); defineOutputHandler("PDF", vecfunc); + vecfunc.setFormat("SVG"); + defineOutputHandler("SVG", vecfunc); + vecfunc.setFormat("PGF"); + defineOutputHandler("PGF", vecfunc); +#ifdef GL2PS_HAVE_ZLIB + vecfunc.setFormat("SVG_GZ"); + defineOutputHandler("SVG_GZ", vecfunc); +#endif defineInputHandler("mes", NativeReader()); defineInputHandler("MES", NativeReader()); @@ -310,21 +318,22 @@ /*! \deprecated Use Plot3D::save or IO::save instead. - Writes vector data supported by gl2ps. The corresponding format types are "EPS","PS"or "PDF". - If zlib has been configured this will be extended by "EPS_GZ" and "PS_GZ". + Writes vector data supported by gl2ps. The corresponding format types are "EPS","PS", "PDF", "SVG", or "PGF". + If zlib has been configured this will be extended by "EPS_GZ", "PS_GZ" and "SVG_GZ". \b Beware: BSPSORT turns out to behave very slowly and memory consuming, especially in cases where many polygons appear. It is still more exact than SIMPLESORT. */ -bool Plot3D::saveVector(QString const& fileName, QString const& format, VectorWriter::TEXTMODE text, VectorWriter::SORTMODE sortmode) +bool Plot3D::saveVector(QString const& fileName, QString const& format, VectorWriter::TEXTMODE textmode, VectorWriter::SORTMODE sortmode) { if (format == "EPS" || format == "EPS_GZ" || format == "PS" - || format == "PS_GZ" || format == "PDF") + || format == "PS_GZ" || format == "PDF" || format == "SVG" + || format == "SVG_GZ" || format == "PGF") { VectorWriter* gl2ps = (VectorWriter*)IO::outputHandler(format); if (gl2ps) { gl2ps->setSortMode(sortmode); - gl2ps->setTextMode(text); + gl2ps->setTextMode(textmode); } return IO::save(this, fileName, format); } @@ -338,7 +347,8 @@ bool Plot3D::savePixmap(QString const& fileName, QString const& format) { if (format == "EPS" || format == "EPS_GZ" || format == "PS" - || format == "PS_GZ" || format == "PDF") + || format == "PS_GZ" || format == "PDF" || format == "SVG" + || format == "SVG_GZ" || format == "PGF") return false; return IO::save(this, fileName, format); --- qwtplot3d-0.2.7/src/qwt3d_io_gl2ps.cpp.pyqwt3d Tue Aug 7 19:50:24 2007 +++ qwtplot3d-0.2.7/src/qwt3d_io_gl2ps.cpp Tue Aug 7 19:50:24 2007 @@ -68,8 +68,8 @@ /*! -Set output format, must be one of "EPS_GZ", "PS_GZ", "EPS", -"PS", "PDF" (case sensitive) +Set output format, must be one of "EPS_GZ", "PS_GZ", "SVG_GZ", "EPS", +"PS", "PDF", "SVG", or "PGF" (case sensitive) */ bool VectorWriter::setFormat(QString const& format) { @@ -95,6 +95,20 @@ gl2ps_format_ = GL2PS_PS; } #endif + else if (format == QString("SVG")) + { + gl2ps_format_ = GL2PS_SVG; + } +#ifdef GL2PS_HAVE_ZLIB + else if (format == QString("SVG_GZ")) + { + gl2ps_format_ = GL2PS_SVG; + } +#endif + else if (format == QString("PGF")) + { + gl2ps_format_ = GL2PS_PGF; + } else { formaterror_ = true; @@ -104,9 +118,20 @@ return true; } +#include +class CLocale { +public: + CLocale() { old = setlocale(LC_ALL, "C"); } + ~CLocale() { setlocale(LC_ALL, old); } +private: + char *old; +}; + //! Performs actual output bool VectorWriter::operator()(Plot3D* plot, QString const& fname) { + CLocale(); + if (formaterror_) return false; @@ -174,7 +199,7 @@ + QString::number(QWT3D_PATCH_VERSION); QString producer = QString("QwtPlot3D ") + version + - " (beta) , (C) 2002"; + ", (C) 2002"; // calculate actual year time_t now; @@ -184,7 +209,8 @@ if (newtime && newtime->tm_year + 1900 > 2002) producer += "-" + QString::number(newtime->tm_year+1900); - producer += " Micha Bieber "; + // the SVG format does not like some of the characters in a mail address + producer += " Micha Bieber, mailto: krischnamurti at users.sourceforge.net"; FILE *fp = fopen(QWT3DLOCAL8BIT(fname), "wb"); if (!fp) @@ -195,7 +221,7 @@ while( state == GL2PS_OVERFLOW ) { bufsize += 2*1024*1024; - gl2psBeginPage ( "---", QWT3DLOCAL8BIT(producer), viewport, + gl2psBeginPage ( QWT3DLOCAL8BIT(fname), QWT3DLOCAL8BIT(producer), viewport, gl2ps_format_, sortmode, options, GL_RGBA, 0, NULL, 0, 0, 0, bufsize, fp, QWT3DLOCAL8BIT(fname) ); @@ -225,7 +251,7 @@ while( state == GL2PS_OVERFLOW ) { bufsize += 2*1024*1024; - gl2psBeginPage ( "---", QWT3DLOCAL8BIT(producer), viewport, + gl2psBeginPage ( QWT3DLOCAL8BIT(fname), QWT3DLOCAL8BIT(producer), viewport, GL2PS_TEX, sortmode, options, GL_RGBA, 0, NULL, 0, 0, 0, bufsize, fp, QWT3DLOCAL8BIT(fn) ); --- qwtplot3d-0.2.7/src/qwt3d_label.cpp.pyqwt3d Tue Aug 7 19:50:24 2007 +++ qwtplot3d-0.2.7/src/qwt3d_label.cpp Tue Aug 7 20:15:42 2007 @@ -121,6 +121,29 @@ } QBitmap bm(pm_.width(),pm_.height()); + +#if QT_VERSION >= 0x040000 && defined(Q_WS_X11) + bm.fill(Qt::white); + p.begin( &bm ); + p.setPen(Qt::black); + p.setFont(font_); + p.drawText(0,r.height() - fm.descent() -1 , text_); + p.end(); + + pm_.setMask(bm); + + // avoids uninitialized areas in some cases + pm_.fill(Qt::white); + p.begin( &pm_ ); + p.setFont( font_ ); + p.setPen( Qt::SolidLine ); + p.setPen( GL2Qt(color.r, color.g, color.b) ); + + p.drawText(0,r.height() - fm.descent() -1 , text_); + p.end(); + + buf_ = pm_.toImage(); +#else bm.fill(Qt::color0); p.begin( &bm ); p.setPen(Qt::color1); @@ -141,11 +164,14 @@ p.drawText(0,r.height() - fm.descent() -1 , text_); p.end(); +#endif + #if QT_VERSION < 0x040000 buf_ = pm_.convertToImage(); #else buf_ = pm_.toImage(); #endif + tex_ = QGLWidget::convertToGLFormat( buf_ ); // flipped 32bit RGBA ? } PyQwt3D-pyqwt3d-0.1.8/qt3lib/000077500000000000000000000000001334664011000156005ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/qt3lib/Qwt3D/000077500000000000000000000000001334664011000165425ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/qt3lib/Qwt3D/__init__.py000066400000000000000000000053071334664011000206600ustar00rootroot00000000000000"""Qwt3D -- a Python interface for the QwtPlot3D library. """ # # Copyright (C) 2003-2007 Gerard Vermeulen # # This file is part of PyQwt3D. # # PyQwt3D 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. # # PyQwt3D 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, # PyQwt3D becomes a free plug-in for a non-free program. from _Qwt3D import * try: from ezplot import * except ImportError, message: if 'numpy' in message: print 'Install numpy to use ezplot' else: raise ImportError, message def save(plot3d, name, format, landscape=VectorWriter.OFF, textmode=VectorWriter.NATIVE, sortmode=VectorWriter.BSPSORT): """save a snapshot a Plot3D widget to a file. - plot3d : the Plot3D widget or a widget with Plot3D widget as child - name : the file name - format : a case-insensitive string indicating the file format - landscape : VectorWriter.ON, OFF or AUTO - textmode : VectorWriter.PIXEL, NATIVE, or TEX - sortmode : VectorWriter.NOSORT, SIMPLESORT, or BSPSORT PyQwt3D uses GL2PS to support vector formats as EPS, EPS_GZ, PDF, PGF, PS, PS_GZ, SVG, and SVG_GZ. It uses Qt to support pixmap formats as GIF, JPEG, PNG, and others. Returns True on success and False on failure. """ format = format.upper() if format in ['EPS', 'EPS_GZ', 'PDF', 'PGF', 'PS', 'PS_GZ', 'SVG', 'SVG_GZ', ]: gl2ps = IO.outputHandler(format) if gl2ps: gl2ps.setLandscape(landscape) gl2ps.setTextMode(textmode) gl2ps.setSortMode(sortmode) return IO.save(plot3d, name, format) # save() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt3lib/Qwt3D/ezplot.py000077500000000000000000000116611334664011000204410ustar00rootroot00000000000000#!/usr/bin/env python """ ezplot is some sugar coating for Qwt3D """ # Copyright (C) 2003-2007 Gerard Vermeulen # # This file is part of PyQwt3D. # # PyQwt3D 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. # # PyQwt3D 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, # PyQwt3D becomes a free plug-in for a non-free program. __all__ = ('plot',) import numpy as np from _Qwt3D import SurfacePlot, RGBA from _Qwt3D import X1, X2, X3, X4, Y1, Y2, Y3, Y4, Z1, Z2, Z3, Z4 def tocube(x, y, z): """ For arrays x, y, z, return scale factors sx and sy, so that dz=sx*dx and dz=sy*dy, where dx=max(x)-min(x), dy=max(y)-min(y), and dz=max(z)-min(z) """ dx = float(x.max()-x.min()) dy = float(y.max()-y.min()) dz = float(z.max()-z.min()) return dz/dx, dz/dy # tocube() # numpy.meshgrid() returns arrays with the wrong shape! def meshgrid(x, y): """ For vectors x, y with lengths Nx=len(x) and Ny=len(y), return X, Y where X and Y are (Nx, Ny) shaped arrays with the elements of x and y repeated to fill the matrix EG, X, Y = meshgrid([1,2,3], [4,5,6,7]) X = 1 1 1 1 2 2 2 2 3 3 3 3 Y = 4 5 6 7 4 5 6 7 4 5 6 7 """ x = np.asarray(x) y = np.asarray(y) numRows, numCols = len(x), len(y) # not reversed, contrary to np.meshgrid x = x.reshape(numRows, 1) X = x.repeat(numCols, axis=1) y = y.reshape(1, numCols) Y = y.repeat(numRows, axis=0) return X, Y # meshgrid() def plot(x, y, function, title='', labels=('x', 'y', 'z')): """ For vectors x and y, return a plot of function(x, y) """ x = np.asarray(x) y = np.asarray(y) # numpy.meshgrid() produces arrays with the wrong shape! z = function(*meshgrid(x, y)) sx, sy = tocube(x, y, z) w = SurfacePlot() if title: w.setTitle(title) w.setBackgroundColor(RGBA(1.0, 1.0, 1.0)) w.setScale(1.0, 1.0, 1.0) w.setRotation(30, 0, 15) # antialiasing w.coordinates().setLineSmooth(True) w.setSmoothMesh(True) # Load the data with scaled end points for the x- and y-axis, # so that all axes have a similar length (within a factor 2). # Rescale the axes limits, so that the axes look correct. w.loadFromData(z, sx*x.min(), sx*x.max(), sy*y.min(), sy*y.max()) axes = w.coordinates().axes for axis in (axes[X1], axes[X2], axes[X3], axes[X4]): start, stop = axis.limits() axis.setLimits(start/sx, stop/sx) axis.setMajors(5) axis.setMinors(0) axis.setLabelString(labels[0]) for axis in (axes[Y1], axes[Y2], axes[Y3], axes[Y4]): start, stop = axis.limits() axis.setLimits(start/sy, stop/sy) axis.setMajors(5) axis.setMinors(0) axis.setLabelString(labels[1]) for axis in (axes[Z1], axes[Z2], axes[Z3], axes[Z4]): axis.setMajors(5) axis.setMinors(0) axis.setLabelString(labels[2]) w.updateData() w.updateGL() w.show() return w # plot() def test(): def xonly(x, _): return x def yonly(_, y): return y def saddle(x, y): return x*y def rosenbrock(x, y): return (1-x)**2+100*(y-x**2)**2 def fantasy(x, y): return x*y*np.exp(4-x*x-y*y) a = plot(np.linspace(-3, 3), np.linspace(-1, 1), xonly, title="f(x, y) = x") b = plot(np.linspace(-3, 3), np.linspace(-1, 1), yonly, title="f(x, y) = y") c = plot(np.linspace(-3, 3), np.linspace(-3, 3), saddle, title="f(x, y) = x*y") d = plot(np.linspace(-3, 3), np.linspace(-3, 3), rosenbrock, title="f(x, y) = (1-x)**2 + 100*(y-x**2)**2") e = plot(np.linspace(-2, 2), np.linspace(-2, 2), fantasy, title="f(x, y) = x*y*exp(4-x**2-y**2))") raw_input('Happy? ') # test() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt4examples/000077500000000000000000000000001334664011000166515ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/qt4examples/AutoSwitch.py000077500000000000000000000062601334664011000213240ustar00rootroot00000000000000#!/usr/bin/env python import sys from PyQt4.Qt import QApplication, QCoreApplication, QFont, QFontDatabase from PyQt4.Qt import QSplitter, QTimer, SIGNAL, Qt from PyQt4.Qwt3D._Qwt3D import * class Saddle(Function): def __init__(self, *args): Function.__init__(self, *args) self.setDomain(-2.5, 2.5, -2.5, 2.5) self.setMaxZ(1.5) self.setMinZ(-1.5) self.setMesh(31,31) # __init__() def __call__(self, x, y): return x*y # __call__() # class Saddle class Hat(Function): def __init__(self, *args): Function.__init__(self, *args) self.setDomain(-1.5, 1.5, -1.5, 1.5) self.setMesh(41, 41) # __init__() def __call__(self, x, y): return 1.0/(x*x+y*y+0.3) # __call__() # class Hat class Plot(SurfacePlot): def __init__(self, parent, updateinterval): SurfacePlot.__init__(self, parent) # fonts family = QCoreApplication.instance().font().family() if 'Verdana' in QFontDatabase().families(): family = 'Verdana' family = 'Courier' self.setTitleFont(family, 16, QFont.Bold) self.setRotation(30, 0, 15) self.setShift(0.1, 0, 0) self.setZoom(0.8) self.coordinates().setNumberFont(family, 8) axes = self.coordinates().axes # alias for axis in axes: axis.setMajors(7) axis.setMinors(4) axes[X1].setLabelString("x") axes[Y1].setLabelString("y") axes[Z1].setLabelString("z") axes[X2].setLabelString("x") axes[Y2].setLabelString("y") axes[Z2].setLabelString("z") axes[X3].setLabelString("x") axes[Y3].setLabelString("y") axes[Z3].setLabelString("z") axes[X4].setLabelString("x") axes[Y4].setLabelString("y") axes[Z4].setLabelString("z") timer = QTimer(self) self.connect(timer, SIGNAL('timeout()'), self.rotate) timer.start(updateinterval) # __init__() def rotate(self): self.setRotation(int(self.xRotation()+2) % 360, int(self.yRotation()+2) % 360, int(self.zRotation()+2) % 360) # rotate() # class Plot() def make(): demo = QSplitter(Qt.Horizontal) plot1 = Plot(demo, 30) plot1.setFloorStyle(FLOORISO) plot1.setCoordinateStyle(BOX) saddle = Saddle(plot1) saddle.create() plot1.setTitle("Autoswitching axes") plot1.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) plot1.makeCurrent() plot1.updateData() plot1.updateGL() plot2 = Plot(demo, 80) plot2.setZoom(0.8) hat = Hat(plot2) hat.create() plot2.setPlotStyle(HIDDENLINE) plot2.setFloorStyle(FLOORDATA) plot2.setCoordinateStyle(FRAME) plot2.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) plot2.makeCurrent() plot2.updateData() plot2.updateGL() demo.resize(800, 400) demo.show() return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt4examples/EnrichmentDemo.py000077500000000000000000000226161334664011000221360ustar00rootroot00000000000000#!/usr/bin/env python # A Python translation of the "enrichments" example of QwtPlot3D import sys import PyQt4.Qt as Qt from PyQt4.Qwt3D._Qwt3D import * from PyQt4.Qwt3D.OpenGL import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) # translated from enrichments.cpp class Bar(VertexEnrichment): def __init__(self, radius = 0.0, level = 1.0): VertexEnrichment.__init__(self) self.configure(radius, level) # init() def clone(self): return self # clone() def configure(self, radius, level): self.radius = radius self.level = level # configure() def drawBegin(self): self.diag = self.radius*(self.plot.hull().maxVertex - self.plot.hull().minVertex).length() glLineWidth(0) glEnable(GL_POLYGON_OFFSET_FILL) glPolygonOffset(1, 1) # drawBegin() def drawEnd(self): pass # drawEnd() def draw(self, pos): interval = self.plot.hull().maxVertex.z - self.plot.hull().minVertex.z numlevel = self.plot.hull().minVertex.z + self.level * interval interval /= 100 if pos.z > numlevel - interval and pos.z < numlevel + interval: Label3D().draw(pos, self.diag, 2*self.diag) minz = self.plot.hull().minVertex.z # FIXME: rgbat = self.plot.dataColor()(pos) rgbat = self.plot.dataColor()(pos.x, pos.y, pos.z) rgbab = self.plot.dataColor()(pos.x, pos.y, minz) glBegin(GL_QUADS) glColor4d(rgbab.r, rgbab.g, rgbab.b, rgbab.a) glVertex3d(pos.x - self.diag, pos.y - self.diag, minz) glVertex3d(pos.x + self.diag, pos.y - self.diag, minz) glVertex3d(pos.x + self.diag, pos.y + self.diag, minz) glVertex3d(pos.x - self.diag, pos.y + self.diag, minz) if pos.z > numlevel - interval and pos.z < numlevel + interval: glColor3d(0.7, 0.0, 0.0) else: glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glColor4d(rgbab.r, rgbab.g,rgbat.b, rgbab.a) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glColor4d(rgbat.r,rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glColor4d(rgbab.r, rgbab.g, rgbat.b, rgbab.a) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glColor4d(rgbab.r, rgbab.g, rgbat.b, rgbab.a) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glColor4d(rgbab.r, rgbab.g, rgbat.b, rgbab.a) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glEnd() glColor3d(0, 0, 0) glBegin(GL_LINES) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glEnd() # draw() # class Bar class Label3D: def __init__(self): pass # __init__() def draw(self, pos, w, h): gap = 0.3 glColor3d(1,1,1) glBegin(GL_QUADS) glVertex3d(pos.x - w, pos.y, pos.z + gap); glVertex3d(pos.x + w, pos.y, pos.z + gap); glVertex3d(pos.x + w, pos.y, pos.z + gap + h) glVertex3d(pos.x - w, pos.y, pos.z + gap + h) glEnd() glColor3d(0.4,0,0) glBegin(GL_LINE_LOOP) glVertex3d(pos.x - w, pos.y,pos.z + gap) glVertex3d(pos.x + w, pos.y,pos.z + gap) glVertex3d(pos.x + w, pos.y,pos.z + gap + h) glVertex3d(pos.x - w, pos.y, pos.z + gap + h) glEnd() glBegin(GL_LINES) glVertex3d(pos.x, pos.y, pos.z) glVertex3d(pos.x, pos.y, pos.z + gap) glEnd() # draw() # class Label3D class Hat(Function): def __init__(self, *args): Function.__init__(self, *args) # __init__() def __call__(self, x, y): return 1.0/(x*x + y*y + 0.5) # __call__() def name(self): return QString('$\\frac{1}{x^2+y^2+\\frac{1}{2}}$') # name() # class Hat # translated from enrichmentmainwindow.cpp class EnrichmentDemo(Qt.QWidget): def __init__(self, *args): Qt.QWidget.__init__(self, *args) family = Qt.QCoreApplication.instance().font().family() plot = self.plot = SurfacePlot(self) plot.setTitle('Bar Style (Vertex Enrichment)') if 'Verdana' in Qt.QFontDatabase().families(): family = 'Verdana' family = 'Courier' plot.setTitleFont(family, 16, Qt.QFont.Bold) plot.coordinates().setLabelFont(family, 14) plot.coordinates().setNumberFont(family, 12) plot.setZoom(0.8); plot.setRotation(30.0, 0.0, 15.0) plot.setCoordinateStyle(BOX) self.width = 0.007 self.level = .5 self.bar = plot.setPlotStyle(Bar(self.width, self.level)) hat = Hat(plot) hat.setMesh(23, 21) hat.setDomain(-1.8, 1.7, -1.6, 1.7) hat.create() plot.setFloorStyle(FLOORDATA) axes = plot.coordinates().axes # alias for axis in axes: axis.setMajors(5) axis.setMinors(4) plot.coordinates().setGridLinesColor(RGBA(0.0, 0.0, 0.5)) plot.coordinates().setLineWidth(1) plot.coordinates().setNumberFont(family, 8) plot.coordinates().adjustNumbers(5) self.setColor() plot.updateData(); plot.updateGL(); # Level levelLabel = Qt.QLabel('Level') levelSlider = Qt.QSlider(self) levelSlider.setValue(50); levelSlider.setTickPosition(Qt.QSlider.TicksRight) levelLayout = Qt.QVBoxLayout() levelLayout.addWidget(levelLabel) levelLayout.addWidget(levelSlider) self.connect( levelSlider, Qt.SIGNAL('valueChanged(int)'), self.setLevel) # Layout mainLayout = Qt.QHBoxLayout() self.setLayout(mainLayout) mainLayout.addWidget(plot) mainLayout.addLayout(levelLayout) # __init__() def setColor(self): i, step = 252, 4 colorVector = ColorVector() while (i>=0): colorVector.push_back(RGBA(i/255.0, max((i-60)/255.0, 0.0), 0.0)) step -= 1 if step == 0: i -= 4 step = 4 color = StandardColor(self.plot) color.setColorVector(colorVector) self.plot.setDataColor(color) # setColor() def setLevel(self, level): self.level = 1.0 - 0.01*level; self.bar.configure(self.width, self.level) self.plot.updateData() self.plot.updateGL() # setLevel() # class EnrichmentDemo def make(): demo = EnrichmentDemo() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = Qt.QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt4examples/Grab.py000077500000000000000000000030441334664011000201020ustar00rootroot00000000000000#!/usr/bin/env python import inspect, sys # iqt is part of PyQwt import PyQt4.Qwt5.iqt from PyQt4.Qwt3D import Plot3D, save get_input = input # If this is Python 2, use raw_input() if sys.version_info[:2] <= (2, 7): get_input = raw_input def walk(p): if isinstance(p, Plot3D): yield p else: for c in p.children(): for cc in walk(c): yield cc # def walk() def main(): print(inspect.getsource(save)) for demo in ['ParametricSurfaceDemo', 'SimplePlot', 'TestNumPy', ]: result = __import__(demo).make() get_input("Is the demo looking HAPPY? ") for format in ('png', 'pdf', 'ps', 'eps', 'svg'): print('Saving %s.%s...' % (demo, format)) if save(result, '%s.%s' % (demo, format), format): print('success') else: print('failure') for demo in ['AutoSwitch', 'EnrichmentDemo', ]: result = __import__(demo).make() get_input("Is the demo looking HAPPY? ") for i, w in enumerate(walk(result)): for format in ('png', 'pdf', 'ps', 'eps', 'svg'): print('Saving %s%s.%s...' % (demo, i, format),) if save(w, '%s%s.%s' % (demo, i, format), format): print('success') else: print('failure') # main() if __name__ == '__main__': main() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt4examples/ParametricSurfaceDemo.py000077500000000000000000000033011334664011000234300ustar00rootroot00000000000000#!/usr/bin/env python import sys from math import cos, pi, sin from PyQt4.Qt import QApplication, QCoreApplication, QFont, QFontDatabase, Qt from PyQt4.Qwt3D._Qwt3D import ParametricSurface, RGBA, SurfacePlot, Triple, NOCOORD class Sphere(ParametricSurface): def __init__(self, *args): ParametricSurface.__init__(self, *args) self.setMesh(41, 31) self.setDomain(0, 2*pi, 0, pi) self.setPeriodic(False, False) # __init__() def __call__(self, u, v): r = 1.0 return Triple(r*cos(u)*sin(v), r*sin(u)*sin(v), r*cos(v)) # __call__() # class Sphere class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) # fonts family = QCoreApplication.instance().font().family() if 'Verdana' in QFontDatabase().families(): family = 'Verdana' family = 'Courier' self.setTitleFont(family, 16, QFont.Bold) ## self.setTitleColor(RGBA(1.0, 0.0, 0.0)) self.setTitle("A Simple Parametric Surface Demonstration") self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) sphere = Sphere(self) sphere.create() self.setRotation(45, 15, 0) self.setCoordinateStyle(NOCOORD); self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt4examples/PyFontify.py000066400000000000000000000107151334664011000211560ustar00rootroot00000000000000"""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]` PyQwt3D-pyqwt3d-0.1.8/qt4examples/SimplePlot.py000077500000000000000000000041141334664011000213160ustar00rootroot00000000000000#!/usr/bin/env python import sys from math import log from PyQt4.Qt import QApplication, QCoreApplication, QFont, QFontDatabase from PyQt4.Qwt3D import Function, RGBA, SurfacePlot, BOX, X1, Y1, Z1 class Rosenbrock(Function): def __init__(self, *args): Function.__init__(self, *args) # __init__() def __call__(self, x, y): return log((1-x)*(1-x) + 100*(y-x*x)*(y-x*x)) / 8 # __call__() # class Rosenbrock class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) # fonts family = QCoreApplication.instance().font().family() if 'Verdana' in QFontDatabase().families(): family = 'Verdana' family = 'Courier' self.coordinates().setLabelFont(family, 14) self.coordinates().setNumberFont(family, 12) self.setTitle('A Simple SurfacePlot Demonstration'); self.setTitleFont(family, 16, QFont.Bold) self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) rosenbrock = Rosenbrock(self) rosenbrock.setMesh(41, 31) rosenbrock.setDomain(-1.73, 1.5, -1.5, 1.5) rosenbrock.setMinZ(-10) rosenbrock.create() self.setRotation(30, 0, 15) self.setScale(1, 1, 1) self.setShift(0.15, 0, 0) self.setZoom(0.9) axes = self.coordinates().axes # alias for axis in axes: axis.setMajors(7) axis.setMinors(4) axes[X1].setLabelString('x-axis') axes[Y1].setLabelString('y-axis') axes[Z1].setLabelString('z-axis') self.setCoordinateStyle(BOX); self.updateData(); self.updateGL(); # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt4examples/TestNumPy.py000077500000000000000000000062721334664011000211450ustar00rootroot00000000000000#!/usr/bin/env python from numpy import * import sys from PyQt4.Qwt3D._Qwt3D import * from PyQt4.Qt import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) def matrix2d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( double **, unsigned int, unsigned int, double, double, double, double); """ # columns xs = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, float)) # rows ys = multiply.outer( ones((nx,), float), miny+((maxy-miny)/(ny-1))*arange(ny)) return function(xs, ys) # matrix2d() def matrix3d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( Triple **, unsigned int, unsigned int, bool = false, bool = false); """ xyzs = zeros((nx, ny, 3), float) # columns xyzs[:,:,0] = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, float)) # rows xyzs[:,:,1] = multiply.outer( ones((nx,), float), miny+((maxy-miny)/(ny-1))*arange(ny)) # result xyzs[:,:,2] = function(xyzs[:,:,0], xyzs[:,:,1]) return xyzs # matrix3d() def saddle(x, y): return x*y # saddle() class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) # fonts family = QCoreApplication.instance().font().family() if 'Verdana' in QFontDatabase().families(): family = 'Verdana' family = 'Courier' self.coordinates().setLabelFont(family, 14) self.coordinates().setNumberFont(family, 12) self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) self.setRotation(30, 0, 15) self.setScale(1.0, 1.0, 1.0) nx, ny, minx, maxx, miny, maxy = 3, 5, -1.0, 1.0, -1.0, 1.0 if True: zs = matrix2d(nx, ny, minx, maxx, miny, maxy, saddle) print(type(zs)) print(zs) self.loadFromData(zs, minx, maxx, miny, maxy) else: xyzs = matrix3d(nx, ny, minx, maxx, miny, maxy, saddle) print(type(zs)) print(xyzs) self.loadFromData(xyzs) axes = self.coordinates().axes # alias for axis, label in ((X1, "x"), (Y1, "y"), (Z1, "z")): axes[axis].setAutoScale(False) axes[axis].setMajors(5) # 6 major ticks axes[axis].setMinors(3) # 2 minor ticks axes[axis].setLabelString(label) self.setCoordinateStyle(BOX) self.coordinates().setGridLines(True, True) self.coordinates().setLineSmooth(True) self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt4examples/TestNumarray.py000077500000000000000000000056341334664011000216740ustar00rootroot00000000000000#!/usr/bin/env python from numarray import * import sys from PyQt4.Qwt3D import * from PyQt4.Qt import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) def matrix2d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( double **, unsigned int, unsigned int, double, double, double, double); """ # columns xs = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows ys = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) return function(xs, ys) # matrix2d() def matrix3d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( Triple **, unsigned int, unsigned int, bool = false, bool = false); """ xyzs = zeros((nx, ny, 3), Float) # columns xyzs[:,:,0] = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows xyzs[:,:,1] = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) # result xyzs[:,:,2] = function(xyzs[:,:,0], xyzs[:,:,1]) return xyzs # matrix3d() def saddle(x, y): return x*y # saddle() class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) self.setRotation(30, 0, 15) self.setScale(1.0, 1.0, 1.0) nx, ny, minx, maxx, miny, maxy = 3, 5, -1.0, 1.0, -1.0, 1.0 if True: zs = matrix2d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print zs self.loadFromData(zs, minx, maxx, miny, maxy) else: xyzs = matrix3d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print xyzs self.loadFromData(xyzs) axes = self.coordinates().axes # alias for axis, label in ((X1, "x"), (Y1, "y"), (Z1, "z")): axes[axis].setAutoScale(False) axes[axis].setMajors(5) # 6 major ticks axes[axis].setMinors(3) # 2 minor ticks axes[axis].setLabelString(label) self.setCoordinateStyle(BOX) self.coordinates().setGridLines(True, True) self.coordinates().setLineSmooth(True) self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt4examples/TestNumeric.py000077500000000000000000000056331334664011000214770ustar00rootroot00000000000000#!/usr/bin/env python from Numeric import * import sys from PyQt4.Qwt3D import * from PyQt4.Qt import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) def matrix2d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( double **, unsigned int, unsigned int, double, double, double, double); """ # columns xs = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows ys = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) return function(xs, ys) # matrix2d() def matrix3d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( Triple **, unsigned int, unsigned int, bool = false, bool = false); """ xyzs = zeros((nx, ny, 3), Float) # columns xyzs[:,:,0] = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows xyzs[:,:,1] = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) # result xyzs[:,:,2] = function(xyzs[:,:,0], xyzs[:,:,1]) return xyzs # matrix3d() def saddle(x, y): return x*y # saddle() class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) self.setRotation(30, 0, 15) self.setScale(1.0, 1.0, 1.0) nx, ny, minx, maxx, miny, maxy = 3, 5, -1.0, 1.0, -1.0, 1.0 if True: zs = matrix2d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print zs self.loadFromData(zs, minx, maxx, miny, maxy) else: xyzs = matrix3d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print xyzs self.loadFromData(xyzs) axes = self.coordinates().axes # alias for axis, label in ((X1, "x"), (Y1, "y"), (Z1, "z")): axes[axis].setAutoScale(False) axes[axis].setMajors(5) # 6 major ticks axes[axis].setMinors(3) # 2 minor ticks axes[axis].setLabelString(label) self.setCoordinateStyle(BOX) self.coordinates().setGridLines(True, True) self.coordinates().setLineSmooth(True) self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt4examples/py2html.py000077500000000000000000000027751334664011000206400ustar00rootroot00000000000000#!/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) PyQwt3D-pyqwt3d-0.1.8/qt4lib/000077500000000000000000000000001334664011000156015ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/qt4lib/PyQt4/000077500000000000000000000000001334664011000165625ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/qt4lib/PyQt4/Qwt3D/000077500000000000000000000000001334664011000175245ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/qt4lib/PyQt4/Qwt3D/__init__.py000066400000000000000000000054501334664011000216410ustar00rootroot00000000000000"""Qwt3D -- a Python interface for the QwtPlot3D library. """ # Copyright (C) 2003-2007 Gerard Vermeulen # # This file is part of PyQwt3D. # # PyQwt3D 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. # # PyQwt3D 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, # PyQwt3D becomes a free plug-in for a non-free program. from PyQt4.Qwt3D._Qwt3D import * try: from PyQt4.Qwt3D.ezplot import * except ImportError: #(message): raise ImportError # if 'numpy' in message: # print('Install numpy to use ezplot') # else: # raise ImportError(message) def save(plot3d, name, format, landscape=VectorWriter.OFF, textmode=VectorWriter.NATIVE, sortmode=VectorWriter.BSPSORT): """save a snapshot a Plot3D widget to a file. - plot3d : the Plot3D widget or a widget with Plot3D widget as child - name : the file name - format : a case-insensitive string indicating the file format - landscape : VectorWriter.ON, OFF or AUTO - textmode : VectorWriter.PIXEL, NATIVE, or TEX - sortmode : VectorWriter.NOSORT, SIMPLESORT, or BSPSORT PyQwt3D uses GL2PS to support vector formats as EPS, EPS_GZ, PDF, PGF, PS, PS_GZ, SVG, and SVG_GZ. It uses Qt to support pixmap formats as GIF, JPEG, PNG, and others. Returns True on success and False on failure. """ format = format.upper() if format in ['EPS', 'EPS_GZ', 'PDF', 'PGF', 'PS', 'PS_GZ', 'SVG', 'SVG_GZ', ]: gl2ps = IO.outputHandler(format) if gl2ps: gl2ps.setLandscape(landscape) gl2ps.setTextMode(textmode) gl2ps.setSortMode(sortmode) else: format = format.lower() return IO.save(plot3d, name, format) # save() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt4lib/PyQt4/Qwt3D/ezplot.py000066400000000000000000000116551334664011000214230ustar00rootroot00000000000000#ezplot is some sugar coating for Qwt3D # Copyright (C) 2003-2007 Gerard Vermeulen # # This file is part of PyQwt3D. # # PyQwt3D 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. # # PyQwt3D 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, # PyQwt3D becomes a free plug-in for a non-free program. __all__ = ('plot',) import numpy as np from PyQt4.Qwt3D._Qwt3D import SurfacePlot, RGBA from PyQt4.Qwt3D._Qwt3D import X1, X2, X3, X4, Y1, Y2, Y3, Y4, Z1, Z2, Z3, Z4 def tocube(x, y, z): """ For arrays x, y, z, return scale factors sx and sy, so that dz=sx*dx and dz=sy*dy, where dx=max(x)-min(x), dy=max(y)-min(y), and dz=max(z)-min(z) """ dx = float(x.max()-x.min()) dy = float(y.max()-y.min()) dz = float(z.max()-z.min()) return dz/dx, dz/dy # tocube() # numpy.meshgrid() returns arrays with the wrong shape! def meshgrid(x, y): """ For vectors x, y with lengths Nx=len(x) and Ny=len(y), return X, Y where X and Y are (Nx, Ny) shaped arrays with the elements of x and y repeated to fill the matrix EG, X, Y = meshgrid([1,2,3], [4,5,6,7]) X = 1 1 1 1 2 2 2 2 3 3 3 3 Y = 4 5 6 7 4 5 6 7 4 5 6 7 """ x = np.asarray(x) y = np.asarray(y) numRows, numCols = len(x), len(y) # not reversed, contrary to np.meshgrid x = x.reshape(numRows, 1) X = x.repeat(numCols, axis=1) y = y.reshape(1, numCols) Y = y.repeat(numRows, axis=0) return X, Y # meshgrid() def plot(x, y, function, title='', labels=('x', 'y', 'z')): """ For vectors x and y, return a plot of function(x, y) """ x = np.asarray(x) y = np.asarray(y) # numpy.meshgrid() produces arrays with the wrong shape! z = function(*meshgrid(x, y)) sx, sy = tocube(x, y, z) w = SurfacePlot() if title: w.setTitle(title) w.setBackgroundColor(RGBA(1.0, 1.0, 1.0)) w.setScale(1.0, 1.0, 1.0) w.setRotation(30, 0, 15) # antialiasing w.coordinates().setLineSmooth(True) w.setSmoothMesh(True) # Load the data with scaled end points for the x- and y-axis, # so that all axes have a similar length (within a factor 2). # Rescale the axes limits, so that the axes look correct. w.loadFromData(z, sx*x.min(), sx*x.max(), sy*y.min(), sy*y.max()) axes = w.coordinates().axes for axis in (axes[X1], axes[X2], axes[X3], axes[X4]): start, stop = axis.limits() axis.setLimits(start/sx, stop/sx) axis.setMajors(5) axis.setMinors(0) axis.setLabelString(labels[0]) for axis in (axes[Y1], axes[Y2], axes[Y3], axes[Y4]): start, stop = axis.limits() axis.setLimits(start/sy, stop/sy) axis.setMajors(5) axis.setMinors(0) axis.setLabelString(labels[1]) for axis in (axes[Z1], axes[Z2], axes[Z3], axes[Z4]): axis.setMajors(5) axis.setMinors(0) axis.setLabelString(labels[2]) w.updateData() w.updateGL() w.show() return w # plot() def test(): def xonly(x, _): return x def yonly(_, y): return y def saddle(x, y): return x*y def rosenbrock(x, y): return (1-x)**2+100*(y-x**2)**2 def fantasy(x, y): return x*y*np.exp(4-x*x-y*y) a = plot(np.linspace(-3, 3), np.linspace(-1, 1), xonly, title="f(x, y) = x") b = plot(np.linspace(-3, 3), np.linspace(-1, 1), yonly, title="f(x, y) = y") c = plot(np.linspace(-3, 3), np.linspace(-3, 3), saddle, title="f(x, y) = x*y") d = plot(np.linspace(-3, 3), np.linspace(-3, 3), rosenbrock, title="f(x, y) = (1-x)**2 + 100*(y-x**2)**2") e = plot(np.linspace(-2, 2), np.linspace(-2, 2), fantasy, title="f(x, y) = x*y*exp(4-x**2-y**2))") raw_input('Happy? ') # test() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt5examples/000077500000000000000000000000001334664011000166525ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/qt5examples/AutoSwitch.py000077500000000000000000000063401334664011000213240ustar00rootroot00000000000000#!/usr/bin/env python import sys from PyQt5.QtWidgets import QApplication, QSplitter from PyQt5.QtCore import QCoreApplication, QTimer, Qt from PyQt5.QtGui import QFont, QFontDatabase #from PyQt5.QtWidgets import SIGNAL, Qt from PyQt5.Qwt3D._Qwt3D import * class Saddle(Function): def __init__(self, *args): Function.__init__(self, *args) self.setDomain(-2.5, 2.5, -2.5, 2.5) self.setMaxZ(1.5) self.setMinZ(-1.5) self.setMesh(31,31) # __init__() def __call__(self, x, y): return x*y # __call__() # class Saddle class Hat(Function): def __init__(self, *args): Function.__init__(self, *args) self.setDomain(-1.5, 1.5, -1.5, 1.5) self.setMesh(41, 41) # __init__() def __call__(self, x, y): return 1.0/(x*x+y*y+0.3) # __call__() # class Hat class Plot(SurfacePlot): def __init__(self, parent, updateinterval): SurfacePlot.__init__(self, parent) # fonts family = QCoreApplication.instance().font().family() if 'Verdana' in QFontDatabase().families(): family = 'Verdana' family = 'Courier' self.setTitleFont(family, 16, QFont.Bold) self.setRotation(30, 0, 15) self.setShift(0.1, 0, 0) self.setZoom(0.8) self.coordinates().setNumberFont(family, 8) axes = self.coordinates().axes # alias for axis in axes: axis.setMajors(7) axis.setMinors(4) axes[X1].setLabelString("x") axes[Y1].setLabelString("y") axes[Z1].setLabelString("z") axes[X2].setLabelString("x") axes[Y2].setLabelString("y") axes[Z2].setLabelString("z") axes[X3].setLabelString("x") axes[Y3].setLabelString("y") axes[Z3].setLabelString("z") axes[X4].setLabelString("x") axes[Y4].setLabelString("y") axes[Z4].setLabelString("z") timer = QTimer(self) timer.timeout.connect(self.rotate) timer.start(updateinterval) # __init__() def rotate(self): self.setRotation(int(self.xRotation()+2) % 360, int(self.yRotation()+2) % 360, int(self.zRotation()+2) % 360) # rotate() # class Plot() def make(): demo = QSplitter(Qt.Horizontal) plot1 = Plot(demo, 30) plot1.setFloorStyle(FLOORISO) plot1.setCoordinateStyle(BOX) saddle = Saddle(plot1) saddle.create() plot1.setTitle("Autoswitching axes") plot1.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) plot1.makeCurrent() plot1.updateData() plot1.updateGL() plot2 = Plot(demo, 80) plot2.setZoom(0.8) hat = Hat(plot2) hat.create() plot2.setPlotStyle(HIDDENLINE) plot2.setFloorStyle(FLOORDATA) plot2.setCoordinateStyle(FRAME) plot2.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) plot2.makeCurrent() plot2.updateData() plot2.updateGL() demo.resize(800, 400) demo.show() return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt5examples/EnrichmentDemo.py000077500000000000000000000235111334664011000221320ustar00rootroot00000000000000#!/usr/bin/env python # A Python translation of the "enrichments" example of QwtPlot3D import sys from PyQt5.QtCore import QCoreApplication, Qt from PyQt5.QtWidgets import (QWidget, QApplication, QLabel, QVBoxLayout, QHBoxLayout, QSlider) #(QApplication, QCheckBox, QComboBox, QDateTimeEdit, # QDial, QDialog, QGridLayout, QGroupBox, QHBoxLayout, QLabel, QLineEdit, # QProgressBar, QPushButton, QRadioButton, QScrollBar, QSizePolicy, # QSlider, QSpinBox, QStyleFactory, QTableWidget, QTabWidget, #QTextEdit, # QVBoxLayout, QWidget) from PyQt5.QtGui import QFont, QFontDatabase from PyQt5.Qwt3D._Qwt3D import * from PyQt5.Qwt3D.OpenGL import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) # translated from enrichments.cpp class Bar(VertexEnrichment): def __init__(self, radius = 0.0, level = 1.0): VertexEnrichment.__init__(self) self.configure(radius, level) # init() def clone(self): return self # clone() def configure(self, radius, level): self.radius = radius self.level = level # configure() def drawBegin(self): self.diag = self.radius*(self.plot.hull().maxVertex - self.plot.hull().minVertex).length() glLineWidth(0) glEnable(GL_POLYGON_OFFSET_FILL) glPolygonOffset(1, 1) # drawBegin() def drawEnd(self): pass # drawEnd() def draw(self, pos): interval = self.plot.hull().maxVertex.z - self.plot.hull().minVertex.z numlevel = self.plot.hull().minVertex.z + self.level * interval interval /= 100 if pos.z > numlevel - interval and pos.z < numlevel + interval: Label3D().draw(pos, self.diag, 2*self.diag) minz = self.plot.hull().minVertex.z # FIXME: rgbat = self.plot.dataColor()(pos) rgbat = self.plot.dataColor()(pos.x, pos.y, pos.z) rgbab = self.plot.dataColor()(pos.x, pos.y, minz) glBegin(GL_QUADS) glColor4d(rgbab.r, rgbab.g, rgbab.b, rgbab.a) glVertex3d(pos.x - self.diag, pos.y - self.diag, minz) glVertex3d(pos.x + self.diag, pos.y - self.diag, minz) glVertex3d(pos.x + self.diag, pos.y + self.diag, minz) glVertex3d(pos.x - self.diag, pos.y + self.diag, minz) if pos.z > numlevel - interval and pos.z < numlevel + interval: glColor3d(0.7, 0.0, 0.0) else: glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glColor4d(rgbab.r, rgbab.g,rgbat.b, rgbab.a) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glColor4d(rgbat.r,rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glColor4d(rgbab.r, rgbab.g, rgbat.b, rgbab.a) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glColor4d(rgbab.r, rgbab.g, rgbat.b, rgbab.a) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glColor4d(rgbab.r, rgbab.g, rgbat.b, rgbab.a) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glColor4d(rgbat.r, rgbat.g, rgbat.b, rgbat.a) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glEnd() glColor3d(0, 0, 0) glBegin(GL_LINES) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y-self.diag, minz) glVertex3d(pos.x-self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y-self.diag, minz) glVertex3d(pos.x+self.diag, pos.y-self.diag, pos.z) glVertex3d(pos.x+self.diag, pos.y+self.diag, minz) glVertex3d(pos.x+self.diag, pos.y+self.diag, pos.z) glVertex3d(pos.x-self.diag, pos.y+self.diag, minz) glVertex3d(pos.x-self.diag, pos.y+self.diag, pos.z) glEnd() # draw() # class Bar class Label3D: def __init__(self): pass # __init__() def draw(self, pos, w, h): gap = 0.3 glColor3d(1,1,1) glBegin(GL_QUADS) glVertex3d(pos.x - w, pos.y, pos.z + gap); glVertex3d(pos.x + w, pos.y, pos.z + gap); glVertex3d(pos.x + w, pos.y, pos.z + gap + h) glVertex3d(pos.x - w, pos.y, pos.z + gap + h) glEnd() glColor3d(0.4,0,0) glBegin(GL_LINE_LOOP) glVertex3d(pos.x - w, pos.y,pos.z + gap) glVertex3d(pos.x + w, pos.y,pos.z + gap) glVertex3d(pos.x + w, pos.y,pos.z + gap + h) glVertex3d(pos.x - w, pos.y, pos.z + gap + h) glEnd() glBegin(GL_LINES) glVertex3d(pos.x, pos.y, pos.z) glVertex3d(pos.x, pos.y, pos.z + gap) glEnd() # draw() # class Label3D class Hat(Function): def __init__(self, *args): Function.__init__(self, *args) # __init__() def __call__(self, x, y): return 1.0/(x*x + y*y + 0.5) # __call__() def name(self): return QString('$\\frac{1}{x^2+y^2+\\frac{1}{2}}$') # name() # class Hat # translated from enrichmentmainwindow.cpp class EnrichmentDemo(QWidget): def __init__(self, *args): QWidget.__init__(self, *args) family = QCoreApplication.instance().font().family() plot = self.plot = SurfacePlot(self) plot.setTitle('Bar Style (Vertex Enrichment)') if 'Verdana' in QFontDatabase().families(): family = 'Verdana' family = 'Courier' plot.setTitleFont(family, 16, QFont.Bold) plot.coordinates().setLabelFont(family, 14) plot.coordinates().setNumberFont(family, 12) plot.setZoom(0.8); plot.setRotation(30.0, 0.0, 15.0) plot.setCoordinateStyle(BOX) self.width = 0.007 self.level = .5 self.bar = plot.setPlotStyle(Bar(self.width, self.level)) hat = Hat(plot) hat.setMesh(23, 21) hat.setDomain(-1.8, 1.7, -1.6, 1.7) hat.create() plot.setFloorStyle(FLOORDATA) axes = plot.coordinates().axes # alias for axis in axes: axis.setMajors(5) axis.setMinors(4) plot.coordinates().setGridLinesColor(RGBA(0.0, 0.0, 0.5)) plot.coordinates().setLineWidth(1) plot.coordinates().setNumberFont(family, 8) plot.coordinates().adjustNumbers(5) self.setColor() plot.updateData(); plot.updateGL(); # Level levelLabel = QLabel('Level') levelSlider = QSlider(self) levelSlider.setValue(50); levelSlider.setTickPosition(QSlider.TicksRight) levelLayout = QVBoxLayout() levelLayout.addWidget(levelLabel) levelLayout.addWidget(levelSlider) levelSlider.valueChanged.connect(self.setLevel) # Layout mainLayout = QHBoxLayout() self.setLayout(mainLayout) mainLayout.addWidget(plot) mainLayout.addLayout(levelLayout) # __init__() def setColor(self): i, step = 252, 4 colorVector = ColorVector() while (i>=0): colorVector.push_back(RGBA(i/255.0, max((i-60)/255.0, 0.0), 0.0)) step -= 1 if step == 0: i -= 4 step = 4 color = StandardColor(self.plot) color.setColorVector(colorVector) self.plot.setDataColor(color) # setColor() def setLevel(self, level): self.level = 1.0 - 0.01*level; self.bar.configure(self.width, self.level) self.plot.updateData() self.plot.updateGL() # setLevel() # class EnrichmentDemo def make(): demo = EnrichmentDemo() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt5examples/Grab.py000077500000000000000000000030061334664011000201010ustar00rootroot00000000000000#!/usr/bin/env python import inspect, sys # iqt is part of PyQwt from PyQt5.Qwt3D import Plot3D, save get_input = input # If this is Python 2, use raw_input() if sys.version_info[:2] <= (2, 7): get_input = raw_input def walk(p): if isinstance(p, Plot3D): yield p else: for c in p.children(): for cc in walk(c): yield cc # def walk() def main(): print(inspect.getsource(save)) for demo in ['ParametricSurfaceDemo', 'SimplePlot', 'TestNumPy', ]: result = __import__(demo).make() get_input("Is the demo looking HAPPY? ") for format in ('png', 'pdf', 'ps', 'eps', 'svg'): print('Saving %s.%s...' % (demo, format)) if save(result, '%s.%s' % (demo, format), format): print('success') else: print('failure') for demo in ['AutoSwitch', 'EnrichmentDemo', ]: result = __import__(demo).make() get_input("Is the demo looking HAPPY? ") for i, w in enumerate(walk(result)): for format in ('png', 'pdf', 'ps', 'eps', 'svg'): print('Saving %s%s.%s...' % (demo, i, format),) if save(w, '%s%s.%s' % (demo, i, format), format): print('success') else: print('failure') # main() if __name__ == '__main__': main() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt5examples/ParametricSurfaceDemo.py000077500000000000000000000033671334664011000234450ustar00rootroot00000000000000#!/usr/bin/env python import sys from math import cos, pi, sin from PyQt5.QtWidgets import QApplication from PyQt5.QtCore import QCoreApplication, Qt from PyQt5.QtGui import QFont, QFontDatabase from PyQt5.Qwt3D._Qwt3D import ParametricSurface, RGBA, SurfacePlot, Triple, NOCOORD class Sphere(ParametricSurface): def __init__(self, *args): ParametricSurface.__init__(self, *args) self.setMesh(41, 31) self.setDomain(0, 2*pi, 0, pi) self.setPeriodic(False, False) # __init__() def __call__(self, u, v): r = 1.0 return Triple(r*cos(u)*sin(v), r*sin(u)*sin(v), r*cos(v)) # __call__() # class Sphere class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) # fonts family = QCoreApplication.instance().font().family() if 'Verdana' in QFontDatabase().families(): family = 'Verdana' family = 'Courier' self.setTitleFont(family, 16, QFont.Bold) ## self.setTitleColor(RGBA(1.0, 0.0, 0.0)) self.setTitle("A Simple Parametric Surface Demonstration") self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) sphere = Sphere(self) sphere.create() self.setRotation(45, 15, 0) self.setCoordinateStyle(NOCOORD); self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt5examples/PyFontify.py000066400000000000000000000107171334664011000211610ustar00rootroot00000000000000"""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, withh): return withh.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]` PyQwt3D-pyqwt3d-0.1.8/qt5examples/SimplePlot.py000077500000000000000000000041141334664011000213170ustar00rootroot00000000000000#!/usr/bin/env python import sys from math import log from PyQt5.Qt import QApplication, QCoreApplication, QFont, QFontDatabase from PyQt5.Qwt3D import Function, RGBA, SurfacePlot, BOX, X1, Y1, Z1 class Rosenbrock(Function): def __init__(self, *args): Function.__init__(self, *args) # __init__() def __call__(self, x, y): return log((1-x)*(1-x) + 100*(y-x*x)*(y-x*x)) / 8 # __call__() # class Rosenbrock class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) # fonts family = QCoreApplication.instance().font().family() if 'Verdana' in QFontDatabase().families(): family = 'Verdana' family = 'Courier' self.coordinates().setLabelFont(family, 14) self.coordinates().setNumberFont(family, 12) self.setTitle('A Simple SurfacePlot Demonstration'); self.setTitleFont(family, 16, QFont.Bold) self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) rosenbrock = Rosenbrock(self) rosenbrock.setMesh(41, 31) rosenbrock.setDomain(-1.73, 1.5, -1.5, 1.5) rosenbrock.setMinZ(-10) rosenbrock.create() self.setRotation(30, 0, 15) self.setScale(1, 1, 1) self.setShift(0.15, 0, 0) self.setZoom(0.9) axes = self.coordinates().axes # alias for axis in axes: axis.setMajors(7) axis.setMinors(4) axes[X1].setLabelString('x-axis') axes[Y1].setLabelString('y-axis') axes[Z1].setLabelString('z-axis') self.setCoordinateStyle(BOX); self.updateData(); self.updateGL(); # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt5examples/TestNumPy.py000077500000000000000000000062721334664011000211460ustar00rootroot00000000000000#!/usr/bin/env python from numpy import * import sys from PyQt5.Qwt3D._Qwt3D import * from PyQt5.Qt import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) def matrix2d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( double **, unsigned int, unsigned int, double, double, double, double); """ # columns xs = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, float)) # rows ys = multiply.outer( ones((nx,), float), miny+((maxy-miny)/(ny-1))*arange(ny)) return function(xs, ys) # matrix2d() def matrix3d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( Triple **, unsigned int, unsigned int, bool = false, bool = false); """ xyzs = zeros((nx, ny, 3), float) # columns xyzs[:,:,0] = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, float)) # rows xyzs[:,:,1] = multiply.outer( ones((nx,), float), miny+((maxy-miny)/(ny-1))*arange(ny)) # result xyzs[:,:,2] = function(xyzs[:,:,0], xyzs[:,:,1]) return xyzs # matrix3d() def saddle(x, y): return x*y # saddle() class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) # fonts family = QCoreApplication.instance().font().family() if 'Verdana' in QFontDatabase().families(): family = 'Verdana' family = 'Courier' self.coordinates().setLabelFont(family, 14) self.coordinates().setNumberFont(family, 12) self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) self.setRotation(30, 0, 15) self.setScale(1.0, 1.0, 1.0) nx, ny, minx, maxx, miny, maxy = 3, 5, -1.0, 1.0, -1.0, 1.0 if True: zs = matrix2d(nx, ny, minx, maxx, miny, maxy, saddle) print(type(zs)) print(zs) self.loadFromData(zs, minx, maxx, miny, maxy) else: xyzs = matrix3d(nx, ny, minx, maxx, miny, maxy, saddle) print(type(zs)) print(xyzs) self.loadFromData(xyzs) axes = self.coordinates().axes # alias for axis, label in ((X1, "x"), (Y1, "y"), (Z1, "z")): axes[axis].setAutoScale(False) axes[axis].setMajors(5) # 6 major ticks axes[axis].setMinors(3) # 2 minor ticks axes[axis].setLabelString(label) self.setCoordinateStyle(BOX) self.coordinates().setGridLines(True, True) self.coordinates().setLineSmooth(True) self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt5examples/TestNumarray.py000077500000000000000000000056341334664011000216750ustar00rootroot00000000000000#!/usr/bin/env python from numarray import * import sys from PyQt5.Qwt3D import * from PyQt5.Qt import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) def matrix2d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( double **, unsigned int, unsigned int, double, double, double, double); """ # columns xs = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows ys = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) return function(xs, ys) # matrix2d() def matrix3d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( Triple **, unsigned int, unsigned int, bool = false, bool = false); """ xyzs = zeros((nx, ny, 3), Float) # columns xyzs[:,:,0] = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows xyzs[:,:,1] = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) # result xyzs[:,:,2] = function(xyzs[:,:,0], xyzs[:,:,1]) return xyzs # matrix3d() def saddle(x, y): return x*y # saddle() class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) self.setRotation(30, 0, 15) self.setScale(1.0, 1.0, 1.0) nx, ny, minx, maxx, miny, maxy = 3, 5, -1.0, 1.0, -1.0, 1.0 if True: zs = matrix2d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print zs self.loadFromData(zs, minx, maxx, miny, maxy) else: xyzs = matrix3d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print xyzs self.loadFromData(xyzs) axes = self.coordinates().axes # alias for axis, label in ((X1, "x"), (Y1, "y"), (Z1, "z")): axes[axis].setAutoScale(False) axes[axis].setMajors(5) # 6 major ticks axes[axis].setMinors(3) # 2 minor ticks axes[axis].setLabelString(label) self.setCoordinateStyle(BOX) self.coordinates().setGridLines(True, True) self.coordinates().setLineSmooth(True) self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt5examples/TestNumeric.py000077500000000000000000000056331334664011000215000ustar00rootroot00000000000000#!/usr/bin/env python from Numeric import * import sys from PyQt5.Qwt3D import * from PyQt5.Qt import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) def matrix2d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( double **, unsigned int, unsigned int, double, double, double, double); """ # columns xs = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows ys = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) return function(xs, ys) # matrix2d() def matrix3d(nx, ny, minx, maxx, miny, maxy, function): """Return a data matrix to test the interface to the C++ member function bool SurfacePlot::loadFromData( Triple **, unsigned int, unsigned int, bool = false, bool = false); """ xyzs = zeros((nx, ny, 3), Float) # columns xyzs[:,:,0] = multiply.outer( minx + ((maxx-minx)/(nx-1))*arange(nx), ones(ny, Float)) # rows xyzs[:,:,1] = multiply.outer( ones((nx,), Float), miny+((maxy-miny)/(ny-1))*arange(ny)) # result xyzs[:,:,2] = function(xyzs[:,:,0], xyzs[:,:,1]) return xyzs # matrix3d() def saddle(x, y): return x*y # saddle() class Plot(SurfacePlot): def __init__(self, *args): SurfacePlot.__init__(self, *args) self.setBackgroundColor(RGBA(1.0, 1.0, 0.6)) self.setRotation(30, 0, 15) self.setScale(1.0, 1.0, 1.0) nx, ny, minx, maxx, miny, maxy = 3, 5, -1.0, 1.0, -1.0, 1.0 if True: zs = matrix2d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print zs self.loadFromData(zs, minx, maxx, miny, maxy) else: xyzs = matrix3d(nx, ny, minx, maxx, miny, maxy, saddle) print type(zs) print xyzs self.loadFromData(xyzs) axes = self.coordinates().axes # alias for axis, label in ((X1, "x"), (Y1, "y"), (Z1, "z")): axes[axis].setAutoScale(False) axes[axis].setMajors(5) # 6 major ticks axes[axis].setMinors(3) # 2 minor ticks axes[axis].setLabelString(label) self.setCoordinateStyle(BOX) self.coordinates().setGridLines(True, True) self.coordinates().setLineSmooth(True) self.updateData() self.updateGL() # __init__() # class Plot def make(): demo = Plot() demo.show() # Matrox cards on Linux work better with a resize() after show() demo.resize(600, 400) return demo # make() def main(args): app = QApplication(args) demo = make() app.exec_() # main() # Admire if __name__ == '__main__': main(sys.argv) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt5examples/py2html.py000077500000000000000000000027771334664011000206430ustar00rootroot00000000000000#!/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) PyQwt3D-pyqwt3d-0.1.8/qt5lib/000077500000000000000000000000001334664011000156025ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/qt5lib/PyQt5/000077500000000000000000000000001334664011000165645ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/qt5lib/PyQt5/Qwt3D/000077500000000000000000000000001334664011000175265ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/qt5lib/PyQt5/Qwt3D/__init__.py000066400000000000000000000054501334664011000216430ustar00rootroot00000000000000"""Qwt3D -- a Python interface for the QwtPlot3D library. """ # Copyright (C) 2003-2007 Gerard Vermeulen # # This file is part of PyQwt3D. # # PyQwt3D 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. # # PyQwt3D 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, # PyQwt3D becomes a free plug-in for a non-free program. from PyQt5.Qwt3D._Qwt3D import * try: from PyQt5.Qwt3D.ezplot import * except ImportError: #(message): raise ImportError # if 'numpy' in message: # print('Install numpy to use ezplot') # else: # raise ImportError(message) def save(plot3d, name, format, landscape=VectorWriter.OFF, textmode=VectorWriter.NATIVE, sortmode=VectorWriter.BSPSORT): """save a snapshot a Plot3D widget to a file. - plot3d : the Plot3D widget or a widget with Plot3D widget as child - name : the file name - format : a case-insensitive string indicating the file format - landscape : VectorWriter.ON, OFF or AUTO - textmode : VectorWriter.PIXEL, NATIVE, or TEX - sortmode : VectorWriter.NOSORT, SIMPLESORT, or BSPSORT PyQwt3D uses GL2PS to support vector formats as EPS, EPS_GZ, PDF, PGF, PS, PS_GZ, SVG, and SVG_GZ. It uses Qt to support pixmap formats as GIF, JPEG, PNG, and others. Returns True on success and False on failure. """ format = format.upper() if format in ['EPS', 'EPS_GZ', 'PDF', 'PGF', 'PS', 'PS_GZ', 'SVG', 'SVG_GZ', ]: gl2ps = IO.outputHandler(format) if gl2ps: gl2ps.setLandscape(landscape) gl2ps.setTextMode(textmode) gl2ps.setSortMode(sortmode) else: format = format.lower() return IO.save(plot3d, name, format) # save() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/qt5lib/PyQt5/Qwt3D/ezplot.py000066400000000000000000000116551334664011000214250ustar00rootroot00000000000000#ezplot is some sugar coating for Qwt3D # Copyright (C) 2003-2007 Gerard Vermeulen # # This file is part of PyQwt3D. # # PyQwt3D 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. # # PyQwt3D 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, # and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, # PyQwt3D becomes a free plug-in for a non-free program. __all__ = ('plot',) import numpy as np from PyQt5.Qwt3D._Qwt3D import SurfacePlot, RGBA from PyQt5.Qwt3D._Qwt3D import X1, X2, X3, X4, Y1, Y2, Y3, Y4, Z1, Z2, Z3, Z4 def tocube(x, y, z): """ For arrays x, y, z, return scale factors sx and sy, so that dz=sx*dx and dz=sy*dy, where dx=max(x)-min(x), dy=max(y)-min(y), and dz=max(z)-min(z) """ dx = float(x.max()-x.min()) dy = float(y.max()-y.min()) dz = float(z.max()-z.min()) return dz/dx, dz/dy # tocube() # numpy.meshgrid() returns arrays with the wrong shape! def meshgrid(x, y): """ For vectors x, y with lengths Nx=len(x) and Ny=len(y), return X, Y where X and Y are (Nx, Ny) shaped arrays with the elements of x and y repeated to fill the matrix EG, X, Y = meshgrid([1,2,3], [4,5,6,7]) X = 1 1 1 1 2 2 2 2 3 3 3 3 Y = 4 5 6 7 4 5 6 7 4 5 6 7 """ x = np.asarray(x) y = np.asarray(y) numRows, numCols = len(x), len(y) # not reversed, contrary to np.meshgrid x = x.reshape(numRows, 1) X = x.repeat(numCols, axis=1) y = y.reshape(1, numCols) Y = y.repeat(numRows, axis=0) return X, Y # meshgrid() def plot(x, y, function, title='', labels=('x', 'y', 'z')): """ For vectors x and y, return a plot of function(x, y) """ x = np.asarray(x) y = np.asarray(y) # numpy.meshgrid() produces arrays with the wrong shape! z = function(*meshgrid(x, y)) sx, sy = tocube(x, y, z) w = SurfacePlot() if title: w.setTitle(title) w.setBackgroundColor(RGBA(1.0, 1.0, 1.0)) w.setScale(1.0, 1.0, 1.0) w.setRotation(30, 0, 15) # antialiasing w.coordinates().setLineSmooth(True) w.setSmoothMesh(True) # Load the data with scaled end points for the x- and y-axis, # so that all axes have a similar length (within a factor 2). # Rescale the axes limits, so that the axes look correct. w.loadFromData(z, sx*x.min(), sx*x.max(), sy*y.min(), sy*y.max()) axes = w.coordinates().axes for axis in (axes[X1], axes[X2], axes[X3], axes[X4]): start, stop = axis.limits() axis.setLimits(start/sx, stop/sx) axis.setMajors(5) axis.setMinors(0) axis.setLabelString(labels[0]) for axis in (axes[Y1], axes[Y2], axes[Y3], axes[Y4]): start, stop = axis.limits() axis.setLimits(start/sy, stop/sy) axis.setMajors(5) axis.setMinors(0) axis.setLabelString(labels[1]) for axis in (axes[Z1], axes[Z2], axes[Z3], axes[Z4]): axis.setMajors(5) axis.setMinors(0) axis.setLabelString(labels[2]) w.updateData() w.updateGL() w.show() return w # plot() def test(): def xonly(x, _): return x def yonly(_, y): return y def saddle(x, y): return x*y def rosenbrock(x, y): return (1-x)**2+100*(y-x**2)**2 def fantasy(x, y): return x*y*np.exp(4-x*x-y*y) a = plot(np.linspace(-3, 3), np.linspace(-1, 1), xonly, title="f(x, y) = x") b = plot(np.linspace(-3, 3), np.linspace(-1, 1), yonly, title="f(x, y) = y") c = plot(np.linspace(-3, 3), np.linspace(-3, 3), saddle, title="f(x, y) = x*y") d = plot(np.linspace(-3, 3), np.linspace(-3, 3), rosenbrock, title="f(x, y) = (1-x)**2 + 100*(y-x**2)**2") e = plot(np.linspace(-2, 2), np.linspace(-2, 2), fantasy, title="f(x, y) = x*y*exp(4-x**2-y**2))") raw_input('Happy? ') # test() # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/setup.cfg000066400000000000000000000002721334664011000162240ustar00rootroot00000000000000[sdist] # The option 'force-manifest' indicates the 'sdist' command whether to force # regeneration of the MANIFEST force-manifest=1 # # # Local Variables: *** # mode: sh *** # End: *** PyQwt3D-pyqwt3d-0.1.8/setup.py000066400000000000000000000015421334664011000161160ustar00rootroot00000000000000#!/usr/bin/env python import time from distutils.core import setup name = 'PyQwt3D' version = '0.1.7' #version = '%04d%02d%02d' % (time.localtime()[:3]) long_description = """ PyQwt3D is a set of Python bindings for the QwtPlot3D C++ class library. The QwtPlot3D library (http://qwtplot3d.sourceforge.net) extends the Qt framework with widgets to visualize 3-dimensional data. """ setup( name = name, version = version, description = "Python bindings for the QwtPlot3D 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 (MSVC), MacOS/X", ) # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/sip/000077500000000000000000000000001334664011000151755ustar00rootroot00000000000000PyQwt3D-pyqwt3d-0.1.8/sip/FILL000077500000000000000000000041251334664011000156530ustar00rootroot00000000000000#!/usr/bin/env python # # Generate the SIP specification files for C++ templates. import os STD_VECTOR_BASE = open('STD_VECTOR_BASE').read() STD_VECTOR_USER = open('STD_VECTOR_USER').read() file = open('qwt3d_axisvector.sip', 'w') print >> file, STD_VECTOR_USER % { 'HEAD': ('\n#include ' '\n#include ' '\nusing namespace Qwt3D;' '\ntypedef std::vector AxisVector;' ), 'ITEM': 'Axis', 'VECTOR': 'AxisVector', } file = open('qwt3d_cell.sip', 'w') print >> file, STD_VECTOR_BASE % { 'HEAD': ('\n#include ' '\nusing namespace Qwt3D;' ), 'ITEM': 'size_t', 'VECTOR': 'Cell', } file = open('qwt3d_cellfield.sip', 'w') print >> file, STD_VECTOR_USER % { 'HEAD': ('\n#include ' '\nusing namespace Qwt3D;' ), 'ITEM': 'Cell', 'VECTOR': 'CellField', } file = open('qwt3d_colorvector.sip', 'w') print >> file, STD_VECTOR_USER % { 'HEAD': ('\n#include ' '\nusing namespace Qwt3D;' ), 'ITEM': 'RGBA', 'VECTOR': 'ColorVector', } file = open('qwt3d_doublevector.sip', 'w') print >> file, STD_VECTOR_BASE % { 'HEAD': ('\n#include ' '\ntypedef std::vector DoubleVector;' ), 'ITEM': 'double', 'VECTOR': 'DoubleVector', } file = open('qwt3d_freevectorfield.sip', 'w') print >> file, STD_VECTOR_USER % { 'HEAD': ('\n#include ' '\n#include ' '\nusing namespace Qwt3D;' ), 'ITEM': 'FreeVector', 'VECTOR': 'FreeVectorField', } file = open('qwt3d_triplefield.sip', 'w') print >> file, STD_VECTOR_USER % { 'HEAD': ('\n#include ' '\n#include ' '\nusing namespace Qwt3D;' ), 'ITEM': 'Triple', 'VECTOR': 'TripleField', } # Local Variables: *** # mode: python *** # End: *** PyQwt3D-pyqwt3d-0.1.8/sip/OpenGL_Qt3_Module.sip000066400000000000000000000026641334664011000211020ustar00rootroot00000000000000// The SIP interface definition for the _Qwt3D module of PyQwt3D. // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. %Module Qwt3D.OpenGL 0 %Include OpenGL_mod.sip // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/OpenGL_Qt4_Module.sip000066400000000000000000000026721334664011000211020ustar00rootroot00000000000000// The SIP interface definition for the OpenGL module of PyQwt3D. // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. %Module PyQt4.Qwt3D.OpenGL 0 %Include OpenGL_mod.sip // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/OpenGL_Qt5_Module.sip000066400000000000000000000026721334664011000211030ustar00rootroot00000000000000// The SIP interface definition for the OpenGL module of PyQwt3D. // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. %Module PyQt5.Qwt3D.OpenGL 0 %Include OpenGL_mod.sip // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/OpenGL_mod.sip000066400000000000000000000644251334664011000177100ustar00rootroot00000000000000// The SIP interface definition for the OpenGL module of PyQwt3D. // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef void GLvoid; typedef /*signed*/ char GLbyte; /* 1-byte signed */ typedef short GLshort; /* 2-byte signed */ typedef int GLint; /* 4-byte signed */ typedef unsigned char GLubyte; /* 1-byte unsigned */ typedef unsigned short GLushort; /* 2-byte unsigned */ typedef unsigned int GLuint; /* 4-byte unsigned */ typedef int GLsizei; /* 4-byte signed */ typedef float GLfloat; /* single precision float */ typedef float GLclampf; /* single precision float in [0,1] */ typedef double GLdouble; /* double precision float */ typedef double GLclampd; /* double precision float in [0,1] */ %ModuleHeaderCode #if defined(_WIN32) #include #endif #if defined(__APPLE__) #include #else #include #endif %End // %ModuleHeaderCode /* Boolean values */ const int GL_FALSE; // 0x0 const int GL_TRUE; // 0x1 /* Data types */ const int GL_BYTE; const int GL_UNSIGNED_BYTE; const int GL_SHORT; const int GL_UNSIGNED_SHORT; const int GL_INT; const int GL_UNSIGNED_INT; const int GL_FLOAT; const int GL_2_BYTES; const int GL_3_BYTES; const int GL_4_BYTES; const int GL_DOUBLE; /* Primitives */ const int GL_POINTS; const int GL_LINES; const int GL_LINE_LOOP; const int GL_LINE_STRIP; const int GL_TRIANGLES; const int GL_TRIANGLE_STRIP; const int GL_TRIANGLE_FAN; const int GL_QUADS; const int GL_QUAD_STRIP; const int GL_POLYGON; /* Vertex Arrays */ const int GL_VERTEX_ARRAY; const int GL_NORMAL_ARRAY; const int GL_COLOR_ARRAY; const int GL_INDEX_ARRAY; const int GL_TEXTURE_COORD_ARRAY; const int GL_EDGE_FLAG_ARRAY; const int GL_VERTEX_ARRAY_SIZE; const int GL_VERTEX_ARRAY_TYPE; const int GL_VERTEX_ARRAY_STRIDE; const int GL_NORMAL_ARRAY_TYPE; const int GL_NORMAL_ARRAY_STRIDE; const int GL_COLOR_ARRAY_SIZE; const int GL_COLOR_ARRAY_TYPE; const int GL_COLOR_ARRAY_STRIDE; const int GL_INDEX_ARRAY_TYPE; const int GL_INDEX_ARRAY_STRIDE; const int GL_TEXTURE_COORD_ARRAY_SIZE; const int GL_TEXTURE_COORD_ARRAY_TYPE; const int GL_TEXTURE_COORD_ARRAY_STRIDE; const int GL_EDGE_FLAG_ARRAY_STRIDE; const int GL_VERTEX_ARRAY_POINTER; const int GL_NORMAL_ARRAY_POINTER; const int GL_COLOR_ARRAY_POINTER; const int GL_INDEX_ARRAY_POINTER; const int GL_TEXTURE_COORD_ARRAY_POINTER; const int GL_EDGE_FLAG_ARRAY_POINTER; const int GL_V2F; const int GL_V3F; const int GL_C4UB_V2F; const int GL_C4UB_V3F; const int GL_C3F_V3F; const int GL_N3F_V3F; const int GL_C4F_N3F_V3F; const int GL_T2F_V3F; const int GL_T4F_V4F; const int GL_T2F_C4UB_V3F; const int GL_T2F_C3F_V3F; const int GL_T2F_N3F_V3F; const int GL_T2F_C4F_N3F_V3F; const int GL_T4F_C4F_N3F_V4F; /* Matrix Mode */ const int GL_MATRIX_MODE; const int GL_MODELVIEW; const int GL_PROJECTION; const int GL_TEXTURE; /* Points */ const int GL_POINT_SMOOTH; const int GL_POINT_SIZE; const int GL_POINT_SIZE_GRANULARITY; const int GL_POINT_SIZE_RANGE; /* Lines */ const int GL_LINE_SMOOTH; const int GL_LINE_STIPPLE; const int GL_LINE_STIPPLE_PATTERN; const int GL_LINE_STIPPLE_REPEAT; const int GL_LINE_WIDTH; const int GL_LINE_WIDTH_GRANULARITY; const int GL_LINE_WIDTH_RANGE; /* Polygons */ const int GL_POINT; const int GL_LINE; const int GL_FILL; const int GL_CW; const int GL_CCW; const int GL_FRONT; const int GL_BACK; const int GL_POLYGON_MODE; const int GL_POLYGON_SMOOTH; const int GL_POLYGON_STIPPLE; const int GL_EDGE_FLAG; const int GL_CULL_FACE; const int GL_CULL_FACE_MODE; const int GL_FRONT_FACE; const int GL_POLYGON_OFFSET_FACTOR; const int GL_POLYGON_OFFSET_UNITS; const int GL_POLYGON_OFFSET_POINT; const int GL_POLYGON_OFFSET_LINE; const int GL_POLYGON_OFFSET_FILL; /* Display Lists */ const int GL_COMPILE; const int GL_COMPILE_AND_EXECUTE; const int GL_LIST_BASE; const int GL_LIST_INDEX; const int GL_LIST_MODE; /* Depth buffer */ const int GL_NEVER; const int GL_LESS; const int GL_EQUAL; const int GL_LEQUAL; const int GL_GREATER; const int GL_NOTEQUAL; const int GL_GEQUAL; const int GL_ALWAYS; const int GL_DEPTH_TEST; const int GL_DEPTH_BITS; const int GL_DEPTH_CLEAR_VALUE; const int GL_DEPTH_FUNC; const int GL_DEPTH_RANGE; const int GL_DEPTH_WRITEMASK; const int GL_DEPTH_COMPONENT; /* Lighting */ const int GL_LIGHTING; const int GL_LIGHT0; const int GL_LIGHT1; const int GL_LIGHT2; const int GL_LIGHT3; const int GL_LIGHT4; const int GL_LIGHT5; const int GL_LIGHT6; const int GL_LIGHT7; const int GL_SPOT_EXPONENT; const int GL_SPOT_CUTOFF; const int GL_CONSTANT_ATTENUATION; const int GL_LINEAR_ATTENUATION; const int GL_QUADRATIC_ATTENUATION; const int GL_AMBIENT; const int GL_DIFFUSE; const int GL_SPECULAR; const int GL_SHININESS; const int GL_EMISSION; const int GL_POSITION; const int GL_SPOT_DIRECTION; const int GL_AMBIENT_AND_DIFFUSE; const int GL_COLOR_INDEXES; const int GL_LIGHT_MODEL_TWO_SIDE; const int GL_LIGHT_MODEL_LOCAL_VIEWER; const int GL_LIGHT_MODEL_AMBIENT; const int GL_FRONT_AND_BACK; const int GL_SHADE_MODEL; const int GL_FLAT; const int GL_SMOOTH; const int GL_COLOR_MATERIAL; const int GL_COLOR_MATERIAL_FACE; const int GL_COLOR_MATERIAL_PARAMETER; const int GL_NORMALIZE; /* User clipping planes */ const int GL_CLIP_PLANE0; const int GL_CLIP_PLANE1; const int GL_CLIP_PLANE2; const int GL_CLIP_PLANE3; const int GL_CLIP_PLANE4; const int GL_CLIP_PLANE5; /* Accumulation buffer */ const int GL_ACCUM_RED_BITS; const int GL_ACCUM_GREEN_BITS; const int GL_ACCUM_BLUE_BITS; const int GL_ACCUM_ALPHA_BITS; const int GL_ACCUM_CLEAR_VALUE; const int GL_ACCUM; const int GL_ADD; const int GL_LOAD; const int GL_MULT; const int GL_RETURN; /* Alpha testing */ const int GL_ALPHA_TEST; const int GL_ALPHA_TEST_REF; const int GL_ALPHA_TEST_FUNC; /* Blending */ const int GL_BLEND; const int GL_BLEND_SRC; const int GL_BLEND_DST; const int GL_ZERO; const int GL_ONE; const int GL_SRC_COLOR; const int GL_ONE_MINUS_SRC_COLOR; const int GL_SRC_ALPHA; const int GL_ONE_MINUS_SRC_ALPHA; const int GL_DST_ALPHA; const int GL_ONE_MINUS_DST_ALPHA; const int GL_DST_COLOR; const int GL_ONE_MINUS_DST_COLOR; const int GL_SRC_ALPHA_SATURATE; /* Render Mode */ const int GL_FEEDBACK; const int GL_RENDER; const int GL_SELECT; /* Feedback */ const int GL_2D; const int GL_3D; const int GL_3D_COLOR; const int GL_3D_COLOR_TEXTURE; const int GL_4D_COLOR_TEXTURE; const int GL_POINT_TOKEN; const int GL_LINE_TOKEN; const int GL_LINE_RESET_TOKEN; const int GL_POLYGON_TOKEN; const int GL_BITMAP_TOKEN; const int GL_DRAW_PIXEL_TOKEN; const int GL_COPY_PIXEL_TOKEN; const int GL_PASS_THROUGH_TOKEN; const int GL_FEEDBACK_BUFFER_POINTER; const int GL_FEEDBACK_BUFFER_SIZE; const int GL_FEEDBACK_BUFFER_TYPE; /* Selection */ const int GL_SELECTION_BUFFER_POINTER; const int GL_SELECTION_BUFFER_SIZE; /* Fog */ const int GL_FOG; const int GL_FOG_MODE; const int GL_FOG_DENSITY; const int GL_FOG_COLOR; const int GL_FOG_INDEX; const int GL_FOG_START; const int GL_FOG_END; const int GL_LINEAR; const int GL_EXP; const int GL_EXP2; /* Logic Ops */ const int GL_LOGIC_OP; const int GL_INDEX_LOGIC_OP; const int GL_COLOR_LOGIC_OP; const int GL_LOGIC_OP_MODE; const int GL_CLEAR; const int GL_SET; const int GL_COPY; const int GL_COPY_INVERTED; const int GL_NOOP; const int GL_INVERT; const int GL_AND; const int GL_NAND; const int GL_OR; const int GL_NOR; const int GL_XOR; const int GL_EQUIV; const int GL_AND_REVERSE; const int GL_AND_INVERTED; const int GL_OR_REVERSE; const int GL_OR_INVERTED; /* Stencil */ const int GL_STENCIL_TEST; const int GL_STENCIL_WRITEMASK; const int GL_STENCIL_BITS; const int GL_STENCIL_FUNC; const int GL_STENCIL_VALUE_MASK; const int GL_STENCIL_REF; const int GL_STENCIL_FAIL; const int GL_STENCIL_PASS_DEPTH_PASS; const int GL_STENCIL_PASS_DEPTH_FAIL; const int GL_STENCIL_CLEAR_VALUE; const int GL_STENCIL_INDEX; const int GL_KEEP; const int GL_REPLACE; const int GL_INCR; const int GL_DECR; /* Buffers, Pixel Drawing/Reading */ const int GL_NONE; const int GL_LEFT; const int GL_RIGHT; /*GL_FRONT 0x0404 */ /*GL_BACK 0x0405 */ /*GL_FRONT_AND_BACK 0x0408 */ const int GL_FRONT_LEFT; const int GL_FRONT_RIGHT; const int GL_BACK_LEFT; const int GL_BACK_RIGHT; const int GL_AUX0; const int GL_AUX1; const int GL_AUX2; const int GL_AUX3; const int GL_COLOR_INDEX; const int GL_RED; const int GL_GREEN; const int GL_BLUE; const int GL_ALPHA; const int GL_LUMINANCE; const int GL_LUMINANCE_ALPHA; const int GL_ALPHA_BITS; const int GL_RED_BITS; const int GL_GREEN_BITS; const int GL_BLUE_BITS; const int GL_INDEX_BITS; const int GL_SUBPIXEL_BITS; const int GL_AUX_BUFFERS; const int GL_READ_BUFFER; const int GL_DRAW_BUFFER; const int GL_DOUBLEBUFFER; const int GL_STEREO; const int GL_BITMAP; const int GL_COLOR; const int GL_DEPTH; const int GL_STENCIL; const int GL_DITHER; const int GL_RGB; const int GL_RGBA; /* Implementation limits */ const int GL_MAX_LIST_NESTING; const int GL_MAX_ATTRIB_STACK_DEPTH; const int GL_MAX_MODELVIEW_STACK_DEPTH; const int GL_MAX_NAME_STACK_DEPTH; const int GL_MAX_PROJECTION_STACK_DEPTH; const int GL_MAX_TEXTURE_STACK_DEPTH; const int GL_MAX_EVAL_ORDER; const int GL_MAX_LIGHTS; const int GL_MAX_CLIP_PLANES; const int GL_MAX_TEXTURE_SIZE; const int GL_MAX_PIXEL_MAP_TABLE; const int GL_MAX_VIEWPORT_DIMS; const int GL_MAX_CLIENT_ATTRIB_STACK_DEPTH; /* Gets */ const int GL_ATTRIB_STACK_DEPTH; const int GL_CLIENT_ATTRIB_STACK_DEPTH; const int GL_COLOR_CLEAR_VALUE; const int GL_COLOR_WRITEMASK; const int GL_CURRENT_INDEX; const int GL_CURRENT_COLOR; const int GL_CURRENT_NORMAL; const int GL_CURRENT_RASTER_COLOR; const int GL_CURRENT_RASTER_DISTANCE; const int GL_CURRENT_RASTER_INDEX; const int GL_CURRENT_RASTER_POSITION; const int GL_CURRENT_RASTER_TEXTURE_COORDS; const int GL_CURRENT_RASTER_POSITION_VALID; const int GL_CURRENT_TEXTURE_COORDS; const int GL_INDEX_CLEAR_VALUE; const int GL_INDEX_MODE; const int GL_INDEX_WRITEMASK; const int GL_MODELVIEW_MATRIX; const int GL_MODELVIEW_STACK_DEPTH; const int GL_NAME_STACK_DEPTH; const int GL_PROJECTION_MATRIX; const int GL_PROJECTION_STACK_DEPTH; const int GL_RENDER_MODE; const int GL_RGBA_MODE; const int GL_TEXTURE_MATRIX; const int GL_TEXTURE_STACK_DEPTH; const int GL_VIEWPORT; /* Evaluators */ const int GL_AUTO_NORMAL; const int GL_MAP1_COLOR_4; const int GL_MAP1_INDEX; const int GL_MAP1_NORMAL; const int GL_MAP1_TEXTURE_COORD_1; const int GL_MAP1_TEXTURE_COORD_2; const int GL_MAP1_TEXTURE_COORD_3; const int GL_MAP1_TEXTURE_COORD_4; const int GL_MAP1_VERTEX_3; const int GL_MAP1_VERTEX_4; const int GL_MAP2_COLOR_4; const int GL_MAP2_INDEX; const int GL_MAP2_NORMAL; const int GL_MAP2_TEXTURE_COORD_1; const int GL_MAP2_TEXTURE_COORD_2; const int GL_MAP2_TEXTURE_COORD_3; const int GL_MAP2_TEXTURE_COORD_4; const int GL_MAP2_VERTEX_3; const int GL_MAP2_VERTEX_4; const int GL_MAP1_GRID_DOMAIN; const int GL_MAP1_GRID_SEGMENTS; const int GL_MAP2_GRID_DOMAIN; const int GL_MAP2_GRID_SEGMENTS; const int GL_COEFF; const int GL_DOMAIN; const int GL_ORDER; /* Hints */ const int GL_FOG_HINT; const int GL_LINE_SMOOTH_HINT; const int GL_PERSPECTIVE_CORRECTION_HINT; const int GL_POINT_SMOOTH_HINT; const int GL_POLYGON_SMOOTH_HINT; const int GL_DONT_CARE; const int GL_FASTEST; const int GL_NICEST; /* Scissor box */ const int GL_SCISSOR_TEST; const int GL_SCISSOR_BOX; /* Pixel Mode / Transfer */ const int GL_MAP_COLOR; const int GL_MAP_STENCIL; const int GL_INDEX_SHIFT; const int GL_INDEX_OFFSET; const int GL_RED_SCALE; const int GL_RED_BIAS; const int GL_GREEN_SCALE; const int GL_GREEN_BIAS; const int GL_BLUE_SCALE; const int GL_BLUE_BIAS; const int GL_ALPHA_SCALE; const int GL_ALPHA_BIAS; const int GL_DEPTH_SCALE; const int GL_DEPTH_BIAS; const int GL_PIXEL_MAP_S_TO_S_SIZE; const int GL_PIXEL_MAP_I_TO_I_SIZE; const int GL_PIXEL_MAP_I_TO_R_SIZE; const int GL_PIXEL_MAP_I_TO_G_SIZE; const int GL_PIXEL_MAP_I_TO_B_SIZE; const int GL_PIXEL_MAP_I_TO_A_SIZE; const int GL_PIXEL_MAP_R_TO_R_SIZE; const int GL_PIXEL_MAP_G_TO_G_SIZE; const int GL_PIXEL_MAP_B_TO_B_SIZE; const int GL_PIXEL_MAP_A_TO_A_SIZE; const int GL_PIXEL_MAP_S_TO_S; const int GL_PIXEL_MAP_I_TO_I; const int GL_PIXEL_MAP_I_TO_R; const int GL_PIXEL_MAP_I_TO_G; const int GL_PIXEL_MAP_I_TO_B; const int GL_PIXEL_MAP_I_TO_A; const int GL_PIXEL_MAP_R_TO_R; const int GL_PIXEL_MAP_G_TO_G; const int GL_PIXEL_MAP_B_TO_B; const int GL_PIXEL_MAP_A_TO_A; const int GL_PACK_ALIGNMENT; const int GL_PACK_LSB_FIRST; const int GL_PACK_ROW_LENGTH; const int GL_PACK_SKIP_PIXELS; const int GL_PACK_SKIP_ROWS; const int GL_PACK_SWAP_BYTES; const int GL_UNPACK_ALIGNMENT; const int GL_UNPACK_LSB_FIRST; const int GL_UNPACK_ROW_LENGTH; const int GL_UNPACK_SKIP_PIXELS; const int GL_UNPACK_SKIP_ROWS; const int GL_UNPACK_SWAP_BYTES; const int GL_ZOOM_X; const int GL_ZOOM_Y; /* Texture mapping */ const int GL_TEXTURE_ENV; const int GL_TEXTURE_ENV_MODE; const int GL_TEXTURE_1D; const int GL_TEXTURE_2D; const int GL_TEXTURE_WRAP_S; const int GL_TEXTURE_WRAP_T; const int GL_TEXTURE_MAG_FILTER; const int GL_TEXTURE_MIN_FILTER; const int GL_TEXTURE_ENV_COLOR; const int GL_TEXTURE_GEN_S; const int GL_TEXTURE_GEN_T; const int GL_TEXTURE_GEN_MODE; const int GL_TEXTURE_BORDER_COLOR; const int GL_TEXTURE_WIDTH; const int GL_TEXTURE_HEIGHT; const int GL_TEXTURE_BORDER; const int GL_TEXTURE_COMPONENTS; const int GL_TEXTURE_RED_SIZE; const int GL_TEXTURE_GREEN_SIZE; const int GL_TEXTURE_BLUE_SIZE; const int GL_TEXTURE_ALPHA_SIZE; const int GL_TEXTURE_LUMINANCE_SIZE; const int GL_TEXTURE_INTENSITY_SIZE; const int GL_NEAREST_MIPMAP_NEAREST; const int GL_NEAREST_MIPMAP_LINEAR; const int GL_LINEAR_MIPMAP_NEAREST; const int GL_LINEAR_MIPMAP_LINEAR; const int GL_OBJECT_LINEAR; const int GL_OBJECT_PLANE; const int GL_EYE_LINEAR; const int GL_EYE_PLANE; const int GL_SPHERE_MAP; const int GL_DECAL; const int GL_MODULATE; const int GL_NEAREST; const int GL_REPEAT; const int GL_CLAMP; const int GL_S; const int GL_T; const int GL_R; const int GL_Q; const int GL_TEXTURE_GEN_R; const int GL_TEXTURE_GEN_Q; /* Utility */ const int GL_VENDOR; const int GL_RENDERER; const int GL_VERSION; const int GL_EXTENSIONS; /* Errors */ const int GL_NO_ERROR; const int GL_INVALID_VALUE; const int GL_INVALID_ENUM; const int GL_INVALID_OPERATION; const int GL_STACK_OVERFLOW; const int GL_STACK_UNDERFLOW; const int GL_OUT_OF_MEMORY; /* glPush/PopAttrib bits */ const int GL_CURRENT_BIT; const int GL_POINT_BIT; const int GL_LINE_BIT; const int GL_POLYGON_BIT; const int GL_POLYGON_STIPPLE_BIT; const int GL_PIXEL_MODE_BIT; const int GL_LIGHTING_BIT; const int GL_FOG_BIT; const int GL_DEPTH_BUFFER_BIT; const int GL_ACCUM_BUFFER_BIT; const int GL_STENCIL_BUFFER_BIT; const int GL_VIEWPORT_BIT; const int GL_TRANSFORM_BIT; const int GL_ENABLE_BIT; const int GL_COLOR_BUFFER_BIT; const int GL_HINT_BIT; const int GL_EVAL_BIT; const int GL_LIST_BIT; const int GL_TEXTURE_BIT; const int GL_SCISSOR_BIT; const long GL_ALL_ATTRIB_BITS; /* OpenGL 1.1 */ const int GL_PROXY_TEXTURE_1D; const int GL_PROXY_TEXTURE_2D; const int GL_TEXTURE_PRIORITY; const int GL_TEXTURE_RESIDENT; const int GL_TEXTURE_BINDING_1D; const int GL_TEXTURE_BINDING_2D; const int GL_TEXTURE_INTERNAL_FORMAT; const int GL_ALPHA4; const int GL_ALPHA8; const int GL_ALPHA12; const int GL_ALPHA16; const int GL_LUMINANCE4; const int GL_LUMINANCE8; const int GL_LUMINANCE12; const int GL_LUMINANCE16; const int GL_LUMINANCE4_ALPHA4; const int GL_LUMINANCE6_ALPHA2; const int GL_LUMINANCE8_ALPHA8; const int GL_LUMINANCE12_ALPHA4; const int GL_LUMINANCE12_ALPHA12; const int GL_LUMINANCE16_ALPHA16; const int GL_INTENSITY; const int GL_INTENSITY4; const int GL_INTENSITY8; const int GL_INTENSITY12; const int GL_INTENSITY16; const int GL_R3_G3_B2; const int GL_RGB4; const int GL_RGB5; const int GL_RGB8; const int GL_RGB10; const int GL_RGB12; const int GL_RGB16; const int GL_RGBA2; const int GL_RGBA4; const int GL_RGB5_A1; const int GL_RGBA8; const int GL_RGB10_A2; const int GL_RGBA12; const int GL_RGBA16; const int GL_CLIENT_PIXEL_STORE_BIT; const int GL_CLIENT_VERTEX_ARRAY_BIT; // Not on WIN32 and my x86_64 Gentoo: const int GL_ALL_CLIENT_ATTRIB_BITS; const long GL_CLIENT_ALL_ATTRIB_BITS; /* * Miscellaneous */ void glClearIndex(GLfloat); void glClearColor(GLclampf, GLclampf, GLclampf, GLclampf); void glClear(GLbitfield); void glIndexMask(GLuint); void glColorMask(GLboolean, GLboolean, GLboolean, GLboolean); void glAlphaFunc(GLenum, GLclampf); void glBlendFunc(GLenum, GLenum); void glLogicOp(GLenum); void glCullFace(GLenum); void glFrontFace(GLenum); void glPointSize(GLfloat); void glLineWidth(GLfloat); void glLineStipple(GLint, GLushort); void glPolygonMode(GLenum, GLenum); void glPolygonOffset(GLfloat, GLfloat); // void glPolygonStipple(const GLubyte*); // void glGetPolygonStipple(GLubyte*); void glEdgeFlag(GLboolean); // void glEdgeFlagv(const GLboolean*); void glScissor(GLint, GLint, GLsizei, GLsizei); // void glClipPlane(GLenum, const GLdouble*); // void glGetClipPlane(GLenum, GLdouble*); void glDrawBuffer(GLenum); void glReadBuffer(GLenum); void glEnable(GLenum); void glDisable(GLenum); GLboolean glIsEnabled(GLenum); void glEnableClientState(GLenum); /* 1.1 */ void glDisableClientState(GLenum); /* 1.1 */ // void glGetBooleanv(GLenum, GLboolean*); // void glGetDoublev(GLenum, GLdouble*); // void glGetFloatv(GLenum, GLfloat*); // void glGetIntegerv(GLenum, GLint*); void glPushAttrib(GLbitfield); void glPopAttrib(/* void */); void glPushClientAttrib(GLbitfield); /* 1.1 */ void glPopClientAttrib(/* void */); /* 1.1 */ GLint glRenderMode(GLenum); GLenum glGetError(/* void */); const GLubyte* glGetString(GLenum); void glFinish(/* void */); void glFlush(/* void */); void glHint(GLenum, GLenum); /* * Depth Buffer */ void glClearDepth(GLclampd); void glDepthFunc(GLenum); void glDepthMask(GLboolean); void glDepthRange(GLclampd, GLclampd); /* * Accumulation Buffer */ void glClearAccum(GLfloat, GLfloat, GLfloat, GLfloat); void glAccum(GLenum, GLfloat); /* * Transformation */ void glMatrixMode(GLenum); void glOrtho(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); void glFrustum(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); void glViewport(GLint, GLint, GLsizei, GLsizei); void glPushMatrix(/* void */); void glPopMatrix(/* void */); void glLoadIdentity(/* void */); // void glLoadMatrixd(const GLdouble*); // void glLoadMatrixf(const GLfloat*); // void glMultMatrixd(const GLdouble*); // void glMultMatrixf(const GLfloat*); void glRotated(GLdouble, GLdouble, GLdouble, GLdouble); void glRotatef(GLfloat, GLfloat, GLfloat, GLfloat); void glScaled(GLdouble, GLdouble, GLdouble); void glScalef(GLfloat, GLfloat, GLfloat); void glTranslated(GLdouble, GLdouble, GLdouble); void glTranslatef(GLfloat, GLfloat, GLfloat); /* * Display Lists */ GLboolean glIsList(GLuint); void glDeleteLists(GLuint, GLsizei); GLuint glGenLists(GLsizei); void glNewList(GLuint, GLenum); void glEndList(/* void */); void glCallList(GLuint); // void glCallLists(GLsizei, GLenum, const GLvoid*); void glListBase(GLuint); /* * Drawing Functions */ void glBegin(GLenum); void glEnd(/* void */); void glVertex2d(GLdouble, GLdouble); void glVertex2f(GLfloat, GLfloat); void glVertex2i(GLint, GLint); void glVertex2s(GLshort, GLshort); void glVertex3d(GLdouble, GLdouble, GLdouble); void glVertex3f(GLfloat, GLfloat, GLfloat); void glVertex3i(GLint, GLint, GLint); void glVertex3s(GLshort, GLshort, GLshort); void glVertex4d(GLdouble, GLdouble, GLdouble, GLdouble); void glVertex4f(GLfloat, GLfloat, GLfloat, GLfloat); void glVertex4i(GLint, GLint, GLint, GLint); void glVertex4s(GLshort, GLshort, GLshort, GLshort); // void glVertex2dv(const GLdouble*); // void glVertex2fv(const GLfloat*); // void glVertex2iv(const GLint*); // void glVertex2sv(const GLshort*); // void glVertex3dv(const GLdouble *v); // void glVertex3fv(const GLfloat *v); // void glVertex3iv(const GLint *v); // void glVertex3sv(const GLshort *v); // void glVertex4dv(const GLdouble *v); // void glVertex4fv(const GLfloat *v); // void glVertex4iv(const GLint *v); // void glVertex4sv(const GLshort *v); void glNormal3b(GLbyte, GLbyte, GLbyte); void glNormal3d(GLdouble, GLdouble, GLdouble); void glNormal3f(GLfloat, GLfloat, GLfloat); void glNormal3i(GLint, GLint, GLint); void glNormal3s(GLshort, GLshort, GLshort); // void glNormal3bv(const GLbyte*); // void glNormal3dv(const GLdouble*); // void glNormal3fv(const GLfloat*); // void glNormal3iv(const GLint*); // void glNormal3sv(const GLshort*); // void glIndexd(GLdouble); // void glIndexf(GLfloat); // void glIndexi(GLint); // void glIndexs(GLshort); // void glIndexub(GLubyte); /* 1.1 */ // void glIndexdv(const GLdouble*); // void glIndexfv(const GLfloat*); // void glIndexiv(const GLint*); // void glIndexsv(const GLshort*); // void glIndexubv(const GLubyte*); /* 1.1 */ void glColor3b(GLbyte, GLbyte, GLbyte); void glColor3d(GLdouble, GLdouble, GLdouble); void glColor3f(GLfloat, GLfloat, GLfloat); void glColor3i(GLint, GLint, GLint); void glColor3s(GLshort, GLshort, GLshort); void glColor3ub(GLubyte, GLubyte, GLubyte); void glColor3ui(GLuint, GLuint, GLuint); void glColor3us(GLushort, GLushort, GLushort); void glColor4b(GLbyte, GLbyte, GLbyte, GLbyte); void glColor4d(GLdouble, GLdouble, GLdouble, GLdouble); void glColor4f(GLfloat, GLfloat, GLfloat, GLfloat); void glColor4i(GLint, GLint, GLint, GLint); void glColor4s(GLshort, GLshort, GLshort, GLshort); void glColor4ub(GLubyte, GLubyte, GLubyte, GLubyte); void glColor4ui(GLuint, GLuint, GLuint, GLuint); void glColor4us(GLushort, GLushort, GLushort, GLushort); // void glColor3bv(const GLbyte*); // void glColor3dv(const GLdouble*); // void glColor3fv(const GLfloat*); // void glColor3iv(const GLint*); // void glColor3sv(const GLshort*); // void glColor3ubv(const GLubyte*); // void glColor3uiv(const GLuint*); // void glColor3usv(const GLushort*); // void glColor4bv(const GLbyte*); // void glColor4dv(const GLdouble*); // void glColor4fv(const GLfloat*); // void glColor4iv(const GLint*); // void glColor4sv(const GLshort*); // void glColor4ubv(const GLubyte*); // void glColor4uiv(const GLuint*); // void glColor4usv(const GLushort*); // void glColor4bv(const GLbyte*); // void glColor4dv(const GLdouble*); // void glColor4fv(const GLfloat*); // void glColor4iv(const GLint*); // void glColor4sv(const GLshort*); // void glColor4ubv(const GLubyte*); // void glColor4uiv(const GLuint*); // void glColor4usv(const GLushort*); void glTexCoord1d(GLdouble); void glTexCoord1f(GLfloat); void glTexCoord1i(GLint); void glTexCoord1s(GLshort); void glTexCoord2d(GLdouble, GLdouble); void glTexCoord2f(GLfloat, GLfloat); void glTexCoord2i(GLint, GLint); void glTexCoord2s(GLshort, GLshort); void glTexCoord3d(GLdouble, GLdouble, GLdouble); void glTexCoord3f(GLfloat, GLfloat, GLfloat); void glTexCoord3i(GLint, GLint, GLint); void glTexCoord3s(GLshort, GLshort, GLshort); void glTexCoord4d(GLdouble, GLdouble, GLdouble, GLdouble); void glTexCoord4f(GLfloat, GLfloat, GLfloat, GLfloat); void glTexCoord4i(GLint, GLint, GLint, GLint); void glTexCoord4s(GLshort, GLshort, GLshort, GLshort); // void glTexCoord1dv( const GLdouble*); // void glTexCoord1fv( const GLfloat*); // void glTexCoord1iv( const GLint*); // void glTexCoord1sv( const GLshort*); // void glTexCoord2dv( const GLdouble*); // void glTexCoord2fv( const GLfloat*); // void glTexCoord2iv( const GLint*); // void glTexCoord2sv( const GLshort*); // void glTexCoord3dv( const GLdouble*); // void glTexCoord3fv( const GLfloat*); // void glTexCoord3iv( const GLint*); // void glTexCoord3sv( const GLshort*); // void glTexCoord4dv( const GLdouble*); // void glTexCoord4fv( const GLfloat*); // void glTexCoord4iv( const GLint*); // void glTexCoord4sv( const GLshort*); void glRasterPos2d(GLdouble, GLdouble); void glRasterPos2f(GLfloat, GLfloat); void glRasterPos2i(GLint, GLint); void glRasterPos2s(GLshort, GLshort); void glRasterPos3d(GLdouble, GLdouble, GLdouble); void glRasterPos3f(GLfloat, GLfloat, GLfloat); void glRasterPos3i(GLint, GLint, GLint); void glRasterPos3s(GLshort, GLshort, GLshort); void glRasterPos4d(GLdouble, GLdouble, GLdouble, GLdouble); void glRasterPos4f(GLfloat, GLfloat, GLfloat, GLfloat ); void glRasterPos4i(GLint, GLint, GLint, GLint); void glRasterPos4s(GLshort, GLshort, GLshort, GLshort); // void glRasterPos2dv(const GLdouble*); // void glRasterPos2fv(const GLfloat*); // void glRasterPos2iv(const GLint*); // void glRasterPos2sv(const GLshort*); // void glRasterPos3dv(const GLdouble*); // void glRasterPos3fv(const GLfloat*); // void glRasterPos3iv(const GLint*); // void glRasterPos3sv(const GLshort*); // void glRasterPos4dv(const GLdouble*); // void glRasterPos4fv(const GLfloat*); // void glRasterPos4iv(const GLint*); // void glRasterPos4sv(const GLshort*); void glRectd(GLdouble, GLdouble, GLdouble, GLdouble); void glRectf(GLfloat, GLfloat, GLfloat, GLfloat); void glRecti(GLint, GLint, GLint, GLint); void glRects(GLshort, GLshort, GLshort, GLshort); // void glRectdv(const GLdouble*, const GLdouble*); // void glRectfv(const GLfloat*, const GLfloat*); // void glRectiv(const GLint*, const GLint*); // void glRectsv(const GLshort*, const GLshort*); /* * Vertex Arrays (1.1) */ // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/Qwt3D_Qt3_Module.sip000066400000000000000000000044711334664011000207160ustar00rootroot00000000000000// The SIP interface definition for the _Qwt3D module of PyQwt3D. // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. %Module Qwt3D._Qwt3D 0 %Import qt/qtmod.sip %Import qtgl/qtglmod.sip typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef void GLvoid; typedef /*signed*/ char GLbyte; /* 1-byte signed */ typedef short GLshort; /* 2-byte signed */ typedef int GLint; /* 4-byte signed */ typedef unsigned char GLubyte; /* 1-byte unsigned */ typedef unsigned short GLushort; /* 2-byte unsigned */ typedef unsigned int GLuint; /* 4-byte unsigned */ typedef int GLsizei; /* 4-byte signed */ typedef float GLfloat; /* single precision float */ typedef float GLclampf; /* single precision float in [0,1] */ typedef double GLdouble; /* double precision float */ typedef double GLclampd; /* double precision float in [0,1] */ %Include qwt3dmod.sip // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/Qwt3D_Qt4_Module.sip000066400000000000000000000046111334664011000207130ustar00rootroot00000000000000// The SIP interface definition for the _Qwt3D module of PyQwt3D. // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. %Module PyQt4.Qwt3D._Qwt3D 0 %Import QtCore/QtCoremod.sip %Import QtGui/QtGuimod.sip %Import QtOpenGL/QtOpenGLmod.sip // typedef unsigned int GLenum; //typedef unsigned char GLboolean; //typedef unsigned int GLbitfield; typedef void GLvoid; //typedef /*signed*/ char GLbyte; /* 1-byte signed */ //typedef short GLshort; /* 2-byte signed */ // typedef int GLint; /* 4-byte signed */ //typedef unsigned char GLubyte; /* 1-byte unsigned */ //typedef unsigned short GLushort; /* 2-byte unsigned */ // typedef unsigned int GLuint; /* 4-byte unsigned */ //typedef int GLsizei; /* 4-byte signed */ //typedef float GLfloat; /* single precision float */ //typedef float GLclampf; /* single precision float in [0,1] */ //typedef double GLdouble; /* double precision float */ //typedef double GLclampd; /* double precision float in [0,1] */ %Include qwt3dmod.sip // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/Qwt3D_Qt5_Module.sip000066400000000000000000000046111334664011000207140ustar00rootroot00000000000000// The SIP interface definition for the _Qwt3D module of PyQwt3D. // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. %Module PyQt5.Qwt3D._Qwt3D 0 %Import QtCore/QtCoremod.sip %Import QtGui/QtGuimod.sip %Import QtOpenGL/QtOpenGLmod.sip // typedef unsigned int GLenum; //typedef unsigned char GLboolean; //typedef unsigned int GLbitfield; typedef void GLvoid; //typedef /*signed*/ char GLbyte; /* 1-byte signed */ //typedef short GLshort; /* 2-byte signed */ // typedef int GLint; /* 4-byte signed */ //typedef unsigned char GLubyte; /* 1-byte unsigned */ //typedef unsigned short GLushort; /* 2-byte unsigned */ // typedef unsigned int GLuint; /* 4-byte unsigned */ //typedef int GLsizei; /* 4-byte signed */ //typedef float GLfloat; /* single precision float */ //typedef float GLclampf; /* single precision float in [0,1] */ //typedef double GLdouble; /* double precision float */ //typedef double GLclampd; /* double precision float in [0,1] */ %Include qwt3dmod.sip // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/STD_VECTOR_BASE000066400000000000000000000061701334664011000174320ustar00rootroot00000000000000 // DO NOT EDIT: this file is automagically generated by FILL. // // The SIP interface definition for %(VECTOR)s. // // Copyright (C) 2004-2006 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class %(VECTOR)s { %%TypeHeaderCode%(HEAD)s %%End // %%TypeHeaderCode public: %(VECTOR)s(); %(VECTOR)s(size_t); %(VECTOR)s(size_t, %(ITEM)s); %(VECTOR)s(const %(VECTOR)s &); size_t capacity() const; void clear(); bool empty() const; %(ITEM)s back(); %(ITEM)s front(); size_t max_size() const; void pop_back(); void push_back(%(ITEM)s); void reserve(size_t); void resize(size_t, %(ITEM)s & = 0); size_t size() const; void swap(%(VECTOR)s &); %(ITEM)s __getitem__(int); %%MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = (*sipCpp)[a0]; %%End int __len__() const; %%MethodCode sipRes = sipCpp -> size(); %%End void __setitem__(int, %(ITEM)s); %%MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = a1; %%End void __setitem__(SIP_PYSLICE, const %(VECTOR)s &); %%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 { %(VECTOR)s::const_iterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[start] = *it; start += step; ++it; } } } %%End }; // class %(VECTOR)s // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/STD_VECTOR_USER000066400000000000000000000062461334664011000175020ustar00rootroot00000000000000// DO NOT EDIT: this file is automagically generated by FILL. // // The SIP interface definition for %(VECTOR)s. // // Copyright (C) 2004-2006 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class %(VECTOR)s { %%TypeHeaderCode%(HEAD)s %%End // %%TypeHeaderCode public: %(VECTOR)s(); %(VECTOR)s(size_t); %(VECTOR)s(size_t, const %(ITEM)s &); %(VECTOR)s(const %(VECTOR)s &); size_t capacity() const; void clear(); bool empty() const; %(ITEM)s & back(); %(ITEM)s & front(); size_t max_size() const; void pop_back(); void push_back(const %(ITEM)s &); void reserve(size_t); void resize(size_t, const %(ITEM)s & = %(ITEM)s()); size_t size() const; void swap(%(VECTOR)s &); %(ITEM)s & __getitem__(int); %%MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = &(*sipCpp)[a0]; %%End int __len__() const; %%MethodCode sipRes = sipCpp -> size(); %%End void __setitem__(int, const %(ITEM)s &); %%MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = *a1; %%End void __setitem__(SIP_PYSLICE, const %(VECTOR)s &); %%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 { %(VECTOR)s::const_iterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[start] = *it; start += step; ++it; } } } %%End }; // class %(VECTOR)s // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/features.sip000066400000000000000000000027771334664011000175450ustar00rootroot00000000000000// The SIP feature definitions for PyQwt3D. // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. %Feature HAS_QT3 %Feature HAS_QT4 %Feature HAS_QT5 // Numerical Python extensions %Feature HAS_NUMARRAY %Feature HAS_NUMERIC %Feature HAS_NUMPY // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_autoscaler.sip000066400000000000000000000045701334664011000212040ustar00rootroot00000000000000// The SIP interface definition for: // - class AutoScaler // - class LinearAutoScaler // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class AutoScaler { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode protected: %ConvertToSubClassCode // traverse the inheritance tree left->right and bottom->up. if (dynamic_cast(sipCpp)) sipClass = sipClass_LinearAutoScaler; else if (dynamic_cast(sipCpp)) sipClass = sipClass_AutoScaler; else sipClass = 0; %End virtual AutoScaler* clone() const = 0 /Factory/; virtual int execute(double &, double &, double, double, int) = 0; virtual ~AutoScaler(); }; // class AutoScaler class LinearAutoScaler: AutoScaler { %TypeHeaderCode #include #include using namespace Qwt3D; %End // %TypeHeaderCode protected: LinearAutoScaler(); LinearAutoScaler(DoubleVector &); AutoScaler* clone() const /Factory/; int execute(double &, double &, double, double, int); }; // class LinearAutoScaler // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_axis.sip000066400000000000000000000064361334664011000200110ustar00rootroot00000000000000// The SIP interface definition for: // - class Axis // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class Axis: Drawable { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: Axis(); Axis(Triple, Triple); virtual ~Axis(); virtual void draw(); void setPosition(const Triple &, const Triple &); void position(Triple &, Triple &) const; Triple begin() const; Triple end() const; double length() const; void setTicLength(double, double); void ticLength(double &, double &); void setTicOrientation(double, double, double); void setTicOrientation(const Triple &); Triple ticOrientation() const; void setSymmetricTics(bool); void setLabelFont(const QString &, int, int = QFont::Normal, bool = false); void setLabelFont(const QFont); const QFont & labelFont() const; void setLabelString(const QString &); void setLabelPosition(const Triple &, ANCHOR); void setLabelColor(RGBA); void setLabel(bool); void adjustLabel(int); void setScaling(bool); bool scaling() const; void setScale(SCALETYPE); void setScale(Scale *); void setNumbers(bool); bool numbers() const; void setNumberColor(RGBA); RGBA numberColor() const; void setNumberFont( const QString &, int, int = QFont::Normal, bool = false); void setNumberFont(const QFont &); const QFont & numberFont() const; void setNumberAnchor(ANCHOR); void adjustNumbers(int); void setAutoScale(bool = true); bool autoScale() const; void setMajors(int); void setMinors(int); int majors() const; int minors() const; const TripleField & majorPositions() const; const TripleField & minorPositions() const; void setLineWidth(double, double = 0.9, double = 0.5); double lineWidth() const; double majLineWidth() const; double minLineWidth() const; void setLimits(double, double); void limits(double &, double &) const; void recalculateTics(); }; // class Axis // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_axisvector.sip000066400000000000000000000063331334664011000212300ustar00rootroot00000000000000// DO NOT EDIT: this file is automagically generated by FILL. // // The SIP interface definition for AxisVector. // // Copyright (C) 2004-2006 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class AxisVector { %TypeHeaderCode #include #include using namespace Qwt3D; typedef std::vector AxisVector; %End // %TypeHeaderCode public: AxisVector(); AxisVector(size_t); AxisVector(size_t, const Axis &); AxisVector(const AxisVector &); size_t capacity() const; void clear(); bool empty() const; Axis & back(); Axis & front(); size_t max_size() const; void pop_back(); void push_back(const Axis &); void reserve(size_t); void resize(size_t, const Axis & = Axis()); size_t size() const; void swap(AxisVector &); Axis & __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = &(*sipCpp)[a0]; %End int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End void __setitem__(int, const Axis &); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = *a1; %End void __setitem__(SIP_PYSLICE, const AxisVector &); %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 { AxisVector::const_iterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[start] = *it; start += step; ++it; } } } %End }; // class AxisVector // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_cell.sip000066400000000000000000000061061334664011000177560ustar00rootroot00000000000000 // DO NOT EDIT: this file is automagically generated by FILL. // // The SIP interface definition for Cell. // // Copyright (C) 2004-2006 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class Cell { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: Cell(); Cell(size_t); Cell(size_t, size_t); Cell(const Cell &); size_t capacity() const; void clear(); bool empty() const; size_t back(); size_t front(); size_t max_size() const; void pop_back(); void push_back(size_t); void reserve(size_t); void resize(size_t, size_t & = 0); size_t size() const; void swap(Cell &); size_t __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = (*sipCpp)[a0]; %End int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End void __setitem__(int, size_t); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = a1; %End void __setitem__(SIP_PYSLICE, const Cell &); %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 { Cell::const_iterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[start] = *it; start += step; ++it; } } } %End }; // class Cell // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_cellfield.sip000066400000000000000000000062311334664011000207610ustar00rootroot00000000000000// DO NOT EDIT: this file is automagically generated by FILL. // // The SIP interface definition for CellField. // // Copyright (C) 2004-2006 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class CellField { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: CellField(); CellField(size_t); CellField(size_t, const Cell &); CellField(const CellField &); size_t capacity() const; void clear(); bool empty() const; Cell & back(); Cell & front(); size_t max_size() const; void pop_back(); void push_back(const Cell &); void reserve(size_t); void resize(size_t, const Cell & = Cell()); size_t size() const; void swap(CellField &); Cell & __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = &(*sipCpp)[a0]; %End int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End void __setitem__(int, const Cell &); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = *a1; %End void __setitem__(SIP_PYSLICE, const CellField &); %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 { CellField::const_iterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[start] = *it; start += step; ++it; } } } %End }; // class CellField // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_color.sip000066400000000000000000000045051334664011000201560ustar00rootroot00000000000000// The SIP interface definition for: // - class Color // - class StandardColor // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class Color { %TypeHeaderCode #include #include using namespace Qwt3D; %End // %TypeHeaderCode public: virtual RGBA operator()(double, double, double) const = 0; virtual RGBA operator()(const Triple &) const; virtual ColorVector & createVector(ColorVector &); void destroy() const; protected: virtual ~Color(); }; // class Color class StandardColor: Color { %TypeHeaderCode #include #include using namespace Qwt3D; %End // %TypeHeaderCode public: StandardColor(Plot3D * /TransferThis/, unsigned = 100); virtual RGBA operator()(double, double, double) const; void setColorVector(const ColorVector &); void reset(unsigned = 100); void setAlpha(double); ColorVector & createVector(ColorVector &); //protected: // ColorVector colors_ /PyName=colors/; // Plot3D * data_ /PyName=data/; }; // class StandardColor // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_colorlegend.sip000066400000000000000000000043321334664011000213330ustar00rootroot00000000000000// The SIP interface definition for: // - class ColorLegend // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class ColorLegend: Drawable { %TypeHeaderCode #include #include using namespace Qwt3D; %End // %TypeHeaderCode public: enum SCALEPOSITION { Top, Bottom, Left, Right, }; enum ORIENTATION { BottomTop, LeftRight, }; ColorLegend(); void draw(); void setRelPosition(Tuple, Tuple); void setOrientation(ORIENTATION, SCALEPOSITION); void setLimits(double, double); void setMajors(int); void setMinors(int); void drawScale(bool); void drawNumbers(bool); void setAutoScale(bool); void setScale(Scale *); void setScale(SCALETYPE); void setTitleString(const QString &); void setTitleFont(const QString &, int, int = QFont::Normal, bool = false); ColorVector colors; }; // class ColorLegend // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_colorvector.sip000066400000000000000000000062571334664011000214070ustar00rootroot00000000000000// DO NOT EDIT: this file is automagically generated by FILL. // // The SIP interface definition for ColorVector. // // Copyright (C) 2004-2006 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class ColorVector { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: ColorVector(); ColorVector(size_t); ColorVector(size_t, const RGBA &); ColorVector(const ColorVector &); size_t capacity() const; void clear(); bool empty() const; RGBA & back(); RGBA & front(); size_t max_size() const; void pop_back(); void push_back(const RGBA &); void reserve(size_t); void resize(size_t, const RGBA & = RGBA()); size_t size() const; void swap(ColorVector &); RGBA & __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = &(*sipCpp)[a0]; %End int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End void __setitem__(int, const RGBA &); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = *a1; %End void __setitem__(SIP_PYSLICE, const ColorVector &); %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 { ColorVector::const_iterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[start] = *it; start += step; ++it; } } } %End }; // class ColorVector // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_coordsys.sip000066400000000000000000000054271334664011000207110ustar00rootroot00000000000000// The SIP interface definition for: // - class CoordinateSystem // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class CoordinateSystem: Drawable { %TypeHeaderCode #include #include using namespace Qwt3D; %End // %TypeHeaderCode public: CoordinateSystem( Triple = Triple(0,0,0), Triple = Triple(0,0,0), COORDSTYLE = BOX); ~CoordinateSystem(); void init(Triple = Triple(0,0,0), Triple = Triple(0,0,0)); void setStyle(COORDSTYLE, AXIS = X1, AXIS = Y1, AXIS = Z1); COORDSTYLE style() const; void setPosition(Triple, Triple); void setAxesColor(RGBA); void setNumberFont( const QString &, int, int = QFont::Normal, bool = false); void setNumberFont(const QFont &); void setNumberColor(RGBA); void setStandardScale(); void adjustNumbers(int); void adjustLabels(int); void setGridLinesColor(RGBA); void setLabelFont(const QString &, int, int = QFont::Normal, bool = false); void setLabelFont(const QFont &); void setLabelColor(RGBA); void setLineWidth(double, double = 0.9, double = 0.5); void setTicLength(double, double); void setAutoScale(bool = true); Triple first() const; Triple second() const; void setAutoDecoration(bool = true); bool autoDecoration() const; void setLineSmooth(bool = true); bool lineSmooth() const; void draw(); void setGridLines(bool, bool, int = NOSIDEGRID); int grids() const; AxisVector axes; }; // class CoordinateSystem // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_doublevector.sip000066400000000000000000000062521334664011000215360ustar00rootroot00000000000000 // DO NOT EDIT: this file is automagically generated by FILL. // // The SIP interface definition for DoubleVector. // // Copyright (C) 2004-2006 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class DoubleVector { %TypeHeaderCode #include typedef std::vector DoubleVector; %End // %TypeHeaderCode public: DoubleVector(); DoubleVector(size_t); DoubleVector(size_t, double); DoubleVector(const DoubleVector &); size_t capacity() const; void clear(); bool empty() const; double back(); double front(); size_t max_size() const; void pop_back(); void push_back(double); void reserve(size_t); void resize(size_t, double & = 0); size_t size() const; void swap(DoubleVector &); double __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = (*sipCpp)[a0]; %End int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End void __setitem__(int, double); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = a1; %End void __setitem__(SIP_PYSLICE, const DoubleVector &); %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 { DoubleVector::const_iterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[start] = *it; start += step; ++it; } } } %End }; // class DoubleVector // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_drawable.sip000066400000000000000000000050601334664011000206160ustar00rootroot00000000000000// The SIP interface definition for: // - class Drawable // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class Drawable { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: %ConvertToSubClassCode // traverse the inheritance tree left->right and bottom->up. if (dynamic_cast(sipCpp)) sipClass = sipClass_Axis; else if (dynamic_cast(sipCpp)) sipClass = sipClass_ColorLegend; else if (dynamic_cast(sipCpp)) sipClass = sipClass_CoordinateSystem; else if (dynamic_cast(sipCpp)) sipClass = sipClass_Label; else if (dynamic_cast(sipCpp)) sipClass = sipClass_Drawable; else sipClass = 0; %End virtual ~Drawable() = 0; virtual void draw(); virtual void saveGLState(); virtual void restoreGLState(); void attach(Drawable *); void detach(Drawable *); void detachAll(); virtual void setColor(double, double, double, double = 1); virtual void setColor(RGBA); Triple relativePosition(Triple); protected: void Enable(GLenum, GLboolean); Triple ViewPort2World(Triple, bool * = 0); Triple World2ViewPort(Triple, bool * = 0); }; // class Drawable // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_enrichment.sip000066400000000000000000000056631334664011000212020ustar00rootroot00000000000000// The SIP interface definition for: // - class Enrichment // - class VertexEnrichment // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class Enrichment { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: enum TYPE { VERTEXENRICHMENT, EDGEENRICHMENT, FACEENRICHMENT, VOXELENRICHMENT, }; %ConvertToSubClassCode // traverse the inheritance tree left->right and bottom->up. if (dynamic_cast(sipCpp)) sipClass = sipClass_Arrow; else if (dynamic_cast(sipCpp)) sipClass = sipClass_Cone; else if (dynamic_cast(sipCpp)) sipClass = sipClass_CrossHair; else if (dynamic_cast(sipCpp)) sipClass = sipClass_Dot; else if (dynamic_cast(sipCpp)) sipClass = sipClass_VertexEnrichment; else if (dynamic_cast(sipCpp)) sipClass = sipClass_Enrichment; else sipClass = 0; %End Enrichment(); virtual ~Enrichment(); virtual Enrichment * clone() const = 0 /Factory/; virtual void drawBegin(); virtual void drawEnd(); virtual void assign(const Plot3D &); virtual TYPE type() const = 0; public: // protected in QwtPlot3D, works because of a fake header const Plot3D *plot; }; // class Enrichment class VertexEnrichment: Enrichment { %TypeHeaderCode #include using namespace Qwt3D; %End public: VertexEnrichment(); virtual Enrichment * clone() const = 0 /Factory/; virtual void draw(const Triple &) = 0; virtual TYPE type() const; }; // class VertexEnrichment // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_enrichment_std.sip000066400000000000000000000056511334664011000220510ustar00rootroot00000000000000// The SIP interface definition for: // - class CrossHair // - class Dot // - class Cone // - class Arrow // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class CrossHair: VertexEnrichment { %TypeHeaderCode #include #include using namespace Qwt3D; %End // %TypeHeaderCode public: CrossHair(); CrossHair(double, double, bool, bool); Enrichment * clone() const; void configure(double, double, bool, bool); void drawBegin(); void drawEnd(); void draw(const Triple &); }; // class CrossHair class Dot: VertexEnrichment { %TypeHeaderCode #include #include using namespace Qwt3D; %End // %TypeHeaderCode public: Dot(); Dot(double, bool); Enrichment * clone() const; void configure(double, bool); void drawBegin(); void drawEnd(); void draw(const Triple &); }; // class Dot class Cone: VertexEnrichment { %TypeHeaderCode #include #include using namespace Qwt3D; %End // %TypeHeaderCode public: Cone(); Cone(double, unsigned); ~Cone(); Enrichment * clone() const; void configure(double, unsigned); void draw(const Triple &); }; // class Cone class Arrow: VertexEnrichment { %TypeHeaderCode #include #include using namespace Qwt3D; %End // %TypeHeaderCode public: Arrow(); ~Arrow(); Enrichment * clone() const; void configure(int, double, double, double); void setQuality(int); void draw(const Triple &); void setTop(Triple); void setColor(RGBA); }; // class Arrow // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_freevectorfield.sip000066400000000000000000000064541334664011000222150ustar00rootroot00000000000000// DO NOT EDIT: this file is automagically generated by FILL. // // The SIP interface definition for FreeVectorField. // // Copyright (C) 2004-2006 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class FreeVectorField { %TypeHeaderCode #include #include using namespace Qwt3D; %End // %TypeHeaderCode public: FreeVectorField(); FreeVectorField(size_t); FreeVectorField(size_t, const FreeVector &); FreeVectorField(const FreeVectorField &); size_t capacity() const; void clear(); bool empty() const; FreeVector & back(); FreeVector & front(); size_t max_size() const; void pop_back(); void push_back(const FreeVector &); void reserve(size_t); void resize(size_t, const FreeVector & = FreeVector()); size_t size() const; void swap(FreeVectorField &); FreeVector & __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = &(*sipCpp)[a0]; %End int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End void __setitem__(int, const FreeVector &); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = *a1; %End void __setitem__(SIP_PYSLICE, const FreeVectorField &); %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 { FreeVectorField::const_iterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[start] = *it; start += step; ++it; } } } %End }; // class FreeVectorField // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_function.sip000066400000000000000000000035441334664011000206670ustar00rootroot00000000000000// The SIP interface definition for: // - class Function // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class Function: GridMapping { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: Function(); Function(SurfacePlot &); Function(SurfacePlot *); virtual ~Function(); virtual double operator()(double, double) = 0; void setMinZ(double); void setMaxZ(double); virtual bool create(SurfacePlot &); virtual bool create(); void assign(SurfacePlot &); void assign(SurfacePlot *); }; // class Function // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_gridmapping.sip000066400000000000000000000035621334664011000213430ustar00rootroot00000000000000// The SIP interface definition for: // - class GridMapping // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class GridMapping: Mapping { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: GridMapping(); void setMesh(unsigned int, unsigned int); void setDomain(double, double, double, double); void restrictRange(const ParallelEpiped &); protected: //ParallelEpiped range_p; //SurfacePlot* plotwidget_p; //unsigned int umesh_p; //unsigned int vmesh_p; //double minu_p, maxu_p, minv_p, maxv_p; }; // class GridMapping // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_io.sip000066400000000000000000000061251334664011000174470ustar00rootroot00000000000000// The SIP interface definition for: // - class IO // - class PixmapWriter // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class IO { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: typedef bool (*Function)(Plot3D*, const QString &); class Functor { public: virtual ~Functor(); virtual IO::Functor * clone() const = 0 /Factory/; virtual bool operator()(Plot3D *, const QString &) = 0; %ConvertToSubClassCode // Traverse the inheritance tree left->right and bottom->up. // Beware: Functor is abstract, and NativeReader too because it overrides // the virtual functions privately. // FIXME: NativeReader if (dynamic_cast(sipCpp)) sipClass = sipClass_PixmapWriter; else if (dynamic_cast(sipCpp)) sipClass = sipClass_VectorWriter; else // FIXME: Functor sipClass = 0; %End // ConvertToSubClassCode }; // // FIXME: static bool defineInputHandler(const QString &, Function); // FIXME: static bool defineOutputHandler(const QString &, Function); static bool defineInputHandler(const QString &, const Functor &); static bool defineOutputHandler(const QString &, const Functor &); static bool save(Plot3D *, const QString &, const QString &); static bool load(Plot3D *, const QString &, const QString &); static QStringList inputFormatList(); static QStringList outputFormatList(); static IO::Functor * outputHandler(const QString &); static IO::Functor * inputHandler(const QString &); private: IO(); }; // class IO class PixmapWriter: IO::Functor { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: PixmapWriter(); void setQuality(int); }; // class PixmapWriter // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_io_gl2ps.sip000066400000000000000000000047531334664011000205630ustar00rootroot00000000000000// The SIP interface definition for: // - class VectorWriter // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class VectorWriter: IO::Functor { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: enum TEXTMODE { PIXEL, NATIVE, TEX, }; enum LANDSCAPEMODE { ON, OFF, AUTO, }; enum SORTMODE { NOSORT, SIMPLESORT, BSPSORT, }; VectorWriter(); void setLandscape(LANDSCAPEMODE); LANDSCAPEMODE landscape() const; void setTextMode(TEXTMODE, QString = QString::null); TEXTMODE textMode() const; void setSortMode(SORTMODE); SORTMODE sortMode() const; void setCompressed(bool); bool compressed() const; bool setFormat(const QString &); }; // class VectorWriter %ModuleHeaderCode #include using namespace Qwt3D; %End // %ModuleHeaderCode GLint setDeviceLineWidth(GLfloat); GLint setDevicePointSize(GLfloat); // FIXME: GLint drawDevicePixels( // GLsizei, GLsizei, GLenum, GLenum, const void *pixels); GLint drawDeviceText( const char *, const char *, int, Triple, RGBA, ANCHOR, double); void setDevicePolygonOffset(GLfloat, GLfloat); // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_io_reader.sip000066400000000000000000000030651334664011000207710ustar00rootroot00000000000000// The SIP interface definition for: // - class NativeReader // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class NativeReader: IO::Functor { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: NativeReader(); }; // class NativeReader // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_label.sip000066400000000000000000000040731334664011000201170ustar00rootroot00000000000000// The SIP interface definition for: // - class Label // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class Label: Drawable { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: Label(); Label(const QString &, int, int = QFont::Normal, bool = false); void setFont(const QString &, int, int = QFont::Normal, bool = false); void adjust(int); double gap() const; void setPosition(Triple, ANCHOR = BottomLeft); void setRelPosition(Tuple, ANCHOR); Triple first() const; Triple second() const; ANCHOR anchor() const; virtual void setColor(double, double, double, double = 1); virtual void setColor(RGBA); void setString(const QString &); void draw(); static void useDeviceFonts(bool); }; // class Label // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_mapping.sip000066400000000000000000000043021334664011000204660ustar00rootroot00000000000000// The SIP interface definition for: // - class Mapping // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class Mapping { %TypeHeaderCode #include #include #include #include class PyFunction; using namespace Qwt3D; %End // %TypeHeaderCode public: %ConvertToSubClassCode // traverse the inheritance tree left->right and bottom->up. if (dynamic_cast(sipCpp)) sipClass = sipClass_Function; else if (dynamic_cast(sipCpp)) sipClass = sipClass_ParametricSurface; else if (dynamic_cast(sipCpp)) sipClass = sipClass_GridMapping; else if (dynamic_cast(sipCpp)) sipClass = sipClass_Mapping; else sipClass = 0; %End // ConvertToSubClassCode virtual ~Mapping(); virtual QString name() const; }; // class Mapping // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_openglhelper.sip000066400000000000000000000036621334664011000215270ustar00rootroot00000000000000// The SIP interface definition for: // - class GLStateBewarer // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class GLStateBewarer { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: GLStateBewarer(GLenum, bool, bool = false); ~GLStateBewarer(); void turnOn(bool = false); void turnOff(bool = false); }; //const GLubyte * gl_error(); // FIXME: void SaveGlDeleteLists(GLuint &, GLsizei); // FIXME: void getMatrices(GLdouble *, GLdouble *, GLint *); bool ViewPort2World(double &, double &, double &, double, double, double); bool World2ViewPort(double &, double &, double &, double, double, double); // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_parametricsurface.sip000066400000000000000000000035671334664011000225470ustar00rootroot00000000000000// The SIP interface definition for: // - class ParametricSurface // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class ParametricSurface: GridMapping { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: ParametricSurface(); ParametricSurface(SurfacePlot &); ParametricSurface(SurfacePlot *); virtual Triple operator()(double, double) = 0; virtual bool create(SurfacePlot &); virtual bool create(); void assign(SurfacePlot &); void assign(SurfacePlot *); void setPeriodic(bool, bool); }; // class ParametricSurface // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_plot.sip000066400000000000000000000160731334664011000200210ustar00rootroot00000000000000// The SIP interface definition for: // - class Plot3D // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class Plot3D: QGLWidget { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: %ConvertToSubClassCode static struct class_graph { const char *name; sipWrapperType **type; int yes, no; } graph[] = { {sipName_Plot3D, &sipClass_Plot3D, 1, -1}, {sipName_SurfacePlot, &sipClass_SurfacePlot, -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 %If (HAS_QT3) Plot3D(QWidget * /TransferThis/ = 0, const char * = 0); %End // (HAS_QT3) %If (HAS_QT4) Plot3D(QWidget * /TransferThis/ = 0, const QGLWidget * = 0); %End // (HAS_QT4) %If (HAS_QT5) Plot3D(QWidget * /TransferThis/ = 0, const QGLWidget * = 0); %End // (HAS_QT5) virtual ~Plot3D(); void updateData(); void createCoordinateSystem(Triple, Triple); CoordinateSystem * coordinates(); ColorLegend * legend(); double xRotation() const; double yRotation() const; double zRotation() const; double xShift() const; double yShift() const; double zShift() const; double xViewportShift() const; double yViewportShift() const; double xScale() const; double yScale() const; double zScale() const; double zoom() const; bool ortho() const; void setPlotStyle(PLOTSTYLE); Enrichment * setPlotStyle(const Enrichment &); PLOTSTYLE plotStyle() const; Enrichment * userStyle() const; void setShading(SHADINGSTYLE); SHADINGSTYLE shading() const; void setIsolines(int); int isolines() const; void setSmoothMesh(bool); bool smoothDataMesh() const; void setBackgroundColor(RGBA); RGBA backgroundRGBAColor() const; void setMeshColor(RGBA); RGBA meshColor() const; void setMeshLineWidth(double); double meshLineWidth() const; void setDataColor(Color *); const Color * dataColor() const; virtual Enrichment * addEnrichment(const Enrichment &); virtual bool degrade(Enrichment *); ParallelEpiped hull() const; void showColorLegend(bool); void setCoordinateStyle(COORDSTYLE); void setPolygonOffset(double); double polygonOffset() const; void setTitlePosition(double, double = 0.5, ANCHOR = TopCenter); void setTitleFont(const QString &, int, int = QFont::Normal, bool = false); void setTitleColor(RGBA); void setTitle(const QString &); void assignMouse(MouseState, MouseState, MouseState, MouseState, MouseState, MouseState, MouseState, MouseState, MouseState); bool mouseEnabled() const; void assignKeyboard(KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState, KeyboardState); bool keyboardEnabled() const; void setKeySpeed(double, double, double); void keySpeed(double &, double &, double &) const; bool lightingEnabled() const; void illuminate(unsigned = 0); void blowout(unsigned = 0); void setMaterialComponent(GLenum, double, double, double, double = 1.0); void setMaterialComponent(GLenum, double); void setShininess(double); signals: void rotationChanged(double, double, double); void shiftChanged(double, double, double); void vieportShiftChanged(double, double); void scaleChanged(double, double, double); void zoomChanged(double); void projectionChanged(bool); public slots: void setRotation(double, double, double); void setShift(double, double, double); void setViewportShift(double, double); void setScale(double, double, double); void setZoom(double); void setOrtho(bool); void enableMouse(bool = true); void disableMouse(bool = true); void enableKeyboard(bool = true); void disableKeyboard(bool = true); void enableLighting(bool = true); void disableLighting(bool = true); void setLightRotation(double, double, double, unsigned = 0); void setLightShift(double, double, double, unsigned = 0); virtual bool savePixmap(const QString &, const QString &); virtual bool saveVector(const QString &, const QString &, VectorWriter::TEXTMODE, VectorWriter::SORTMODE); virtual bool save(const QString &, const QString &); protected: //typedef std::list EnrichmentList; //typedef EnrichmentList::iterator ELIT; //CoordinateSystem coordinates_p; //Color* datacolor_p; //Enrichment* userplotstyle_p; //EnrichmentList elist_p; //std::vector displaylists_p; //Qwt3D::Data* actualData_p; void initializeGL(); void paintGL(); void resizeGL(int, int); void mousePressEvent(QMouseEvent *); void mouseReleaseEvent(QMouseEvent *); void mouseMoveEvent(QMouseEvent *); void wheelEvent(QWheelEvent *); void keyPressEvent(QKeyEvent *); virtual void calculateHull() = 0; virtual void createData() = 0; virtual void createEnrichment(Enrichment &); virtual void createEnrichments(); void createCoordinateSystem(); void setHull(ParallelEpiped); bool initializedGL() const; enum OBJECTS { DataObject, LegendObject, NormalObject, DisplayListSize, }; }; // class Plot3D // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_portability.sip000066400000000000000000000052211334664011000213760ustar00rootroot00000000000000// The SIP interface definition for: // - class MouseState // - class KeyboardState // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. %If (HAS_QT3) typedef int MouseState; typedef int KeyboardState; %End // (HAS_QT3) %If (HAS_QT4) class MouseState { %TypeHeaderCode #include %End // %TypeHeaderCode public: MouseState(Qt::MouseButtons = Qt::NoButton, Qt::KeyboardModifiers = Qt::NoModifier); bool operator==(const MouseState& ms); bool operator!=(const MouseState& ms); }; // class MouseState class KeyboardState { public: KeyboardState(int = Qt::Key_unknown, Qt::KeyboardModifiers = Qt::NoModifier); bool operator==(const KeyboardState& ms); bool operator!=(const KeyboardState& ms); }; // class KeyboardState %End // (HAS_QT4) %If (HAS_QT5) class MouseState { %TypeHeaderCode #include %End // %TypeHeaderCode public: MouseState(Qt::MouseButtons = Qt::NoButton, Qt::KeyboardModifiers = Qt::NoModifier); bool operator==(const MouseState& ms); bool operator!=(const MouseState& ms); }; // class MouseState class KeyboardState { public: KeyboardState(int = Qt::Key_unknown, Qt::KeyboardModifiers = Qt::NoModifier); bool operator==(const KeyboardState& ms); bool operator!=(const KeyboardState& ms); }; // class KeyboardState %End // (HAS_QT5) // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_scale.sip000066400000000000000000000061401334664011000201240ustar00rootroot00000000000000// The SIP interface definition for: // - class Scale // - class LinearScale // - class LogScale // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class Scale { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode protected: %ConvertToSubClassCode // traverse the inheritance tree left->right and bottom->up. if (dynamic_cast(sipCpp)) sipClass = sipClass_LinearScale; else if (dynamic_cast(sipCpp)) sipClass = sipClass_LogScale; else if (dynamic_cast(sipCpp)) sipClass = sipClass_Scale; else sipClass = 0; %End Scale(); virtual ~Scale(); virtual QString ticLabel(unsigned int) const; virtual void setLimits(double, double); virtual void setMajors(int); virtual void setMinors(int); virtual void setMajorLimits(double, double); int majors() const; int minors() const; virtual Scale* clone() const = 0 /Factory/; virtual void calculate() = 0; virtual int autoscale(double &, double &, double, double, int); //std::vector majors_p, minors_p; //double start_p, stop_p; //int majorintervals_p, minorintervals_p; //double mstart_p, mstop_p; }; // class Scale class LinearScale: Scale { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode protected: int autoscale(double &, double &, double, double, int); Scale* clone() const /Factory/; void calculate(); //LinearAutoScaler autoscaler_p; }; // class LinearScale class LogScale: Scale { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode protected: QString ticLabel(unsigned int) const; void setMinors(int); LogScale(); Scale* clone() const /Factory/; void calculate(); }; // class LogScale // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_surfaceplot.sip000066400000000000000000000162711334664011000213720ustar00rootroot00000000000000// The SIP interface definition for: // - class SurfacePlot // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class SurfacePlot: Plot3D { %TypeHeaderCode #include using namespace Qwt3D; #ifdef PYQWT3D_DEBUG #include using namespace std; #endif %End // %TypeHeaderCode public: %If (HAS_QT3) SurfacePlot(QWidget * /TransferThis/ = 0, const char * = 0); %End // (HAS_QT3) %If (HAS_QT4) SurfacePlot(QWidget * /TransferThis/ = 0, const QGLWidget * = 0); %End // (HAS_QT4) %If (HAS_QT5) SurfacePlot(QWidget * /TransferThis/ = 0, const QGLWidget * = 0); %End // (HAS_QT5) ~SurfacePlot(); void updateNormals(); int resolution() const; SIP_PYTUPLE /*std::pair*/ facets() const; %MethodCode std::pair result = sipCpp -> SurfacePlot::facets(); sipRes = sipBuildResult(&sipIsErr, "(ii)", result.first, result.second); %End bool loadFromData(SIP_PYOBJECT /* Triple** */, /* unsigned int, unsigned int, */ bool = false, bool = false); %MethodCode double *array; unsigned int nx; unsigned int ny; unsigned int nz; PyObject *out; if (-1 == try_PyObject_to_PyArrayContiguousFloat3D( a0, &out, &array, &nx, &ny, &nz)) return 0; if (nz != 3) { PyErr_SetString( PyExc_ValueError, "expected is the third dimension == 3"); return 0; } // MSVC-6.0 does not like: new (foo)[bar]; Triple **data = new Triple * [nx]; for (unsigned int i=0; i( &array[i*ny*sizeof(Triple)/sizeof(double)]); sipRes = sipCpp -> SurfacePlot::loadFromData(data, nx, ny, a1, a2); delete [] data; Py_DECREF(out); %End bool loadFromData(SIP_PYOBJECT /* double** */, /* unsigned int, unsigned int, */ double, double, double, double); %MethodCode double *array; unsigned int nx; unsigned int ny; PyObject *out; #ifndef PYQWT3D_DEBUG if (-1 == try_PyObject_to_PyArrayContiguousFloat2D( a0, &out, &array, &nx, &ny)) return 0; // MSVC-6.0 does not like: new (foo)[bar]; double **data = new double * [nx]; for (unsigned int i=0; i SurfacePlot::loadFromData(data, nx, ny, a1, a2, a3, a4); #ifndef PYQWT3D_DEBUG delete [] data; Py_DECREF(out); #else delete [] data; delete [] array; cout << "Returning from Python wrapper code." << endl; cout << "When will we see the floating point exception?" << endl; #endif %End bool loadFromData(const TripleField &, const CellField &); /* -- deprecated -- bool createDataRepresentation(Triple**, unsigned int, unsigned int, bool = false, bool = false); bool createDataRepresentation(double** data, unsigned int, unsigned int, double, double, double, double); bool createDataRepresentation(const TripleField &, const CellField &); */ FLOORSTYLE floorStyle() const; void setFloorStyle(FLOORSTYLE); void showNormals(bool); bool normals() const; void setNormalLength(double); double normalLength() const; void setNormalQuality(int); int normalQuality() const; signals: void resolutionChanged(int); public slots: void setResolution(int); protected: //bool datanormals_p; //double normalLength_p; //int normalQuality_p; //int resolution_p; virtual void calculateHull(); virtual void createData(); virtual void createEnrichment(Enrichment &); virtual void createFloorData(); // FIXME: void createNormals(); missing C++ code? void createPoints(); void readIn(GridData &, SIP_PYOBJECT) [void (GridData &, Triple **, unsigned int, unsigned int)]; %MethodCode double *array; unsigned int nx; unsigned int ny; unsigned int nz; PyObject *out; if (-1 == try_PyObject_to_PyArrayContiguousFloat3D( a1, &out, &array, &nx, &ny, &nz)) return 0; if (nz != 3) { PyErr_SetString( PyExc_ValueError, "expected is the third dimension == 3"); return 0; } // MSVC-6.0 does not like: new (foo)[bar]; Triple **data = new Triple * [nx]; for (unsigned int i=0; i( &array[i*ny*sizeof(Triple)/sizeof(double)]); sipCpp -> sipProtect_readIn(*a0, data, nx, ny); delete [] data; Py_DECREF(out); %End void readIn(GridData &, SIP_PYOBJECT, double, double, double, double) [void (GridData &, double **, unsigned int, unsigned int, double, double, double, double)]; %MethodCode double *array; unsigned int nx; unsigned int ny; PyObject *out; if (-1 == try_PyObject_to_PyArrayContiguousFloat2D( a1, &out, &array, &nx, &ny)) return 0; // MSVC-6.0 does not like: new (foo)[bar]; double **data = new double * [nx]; for (unsigned int i=0; i sipProtect_readIn(*a0, data, nx, ny, a2, a3, a4, a5); delete [] data; Py_DECREF(out); %End void calcNormals(GridData &); void sewPeriodic(GridData &); }; // class SurfacePlot // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_triplefield.sip000066400000000000000000000063341334664011000213450ustar00rootroot00000000000000// DO NOT EDIT: this file is automagically generated by FILL. // // The SIP interface definition for TripleField. // // Copyright (C) 2004-2006 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. class TripleField { %TypeHeaderCode #include #include using namespace Qwt3D; %End // %TypeHeaderCode public: TripleField(); TripleField(size_t); TripleField(size_t, const Triple &); TripleField(const TripleField &); size_t capacity() const; void clear(); bool empty() const; Triple & back(); Triple & front(); size_t max_size() const; void pop_back(); void push_back(const Triple &); void reserve(size_t); void resize(size_t, const Triple & = Triple()); size_t size() const; void swap(TripleField &); Triple & __getitem__(int); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else sipRes = &(*sipCpp)[a0]; %End int __len__() const; %MethodCode sipRes = sipCpp -> size(); %End void __setitem__(int, const Triple &); %MethodCode int len = sipCpp -> size(); if (0 > (a0 = sipConvertFromSequenceIndex(a0, len))) sipIsErr = 1; else (*sipCpp)[a0] = *a1; %End void __setitem__(SIP_PYSLICE, const TripleField &); %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 { TripleField::const_iterator it = a1 -> begin(); for (int i = 0; i < slicelength; ++i) { (*sipCpp)[start] = *it; start += step; ++it; } } } %End }; // class TripleField // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3d_types.sip000066400000000000000000000146731334664011000202130ustar00rootroot00000000000000// The SIP interface definition for: // - enum PLOTSTYLE // - enum SHADINGSTYLE // - enum COORDINATESTYLE // - enum SCALETYPE // - enum FLOORSTYLE // - enum DATATYPE // - enum AXIS // - enum SIDE // - enum ANCHOR // - struct Tuple // - struct Triple // - struct ParallelEpiped // - struct FreeVector // - struct RGBA // - function GL2Qt // - function Qt2GL // - class Data // - class GridData // - class CellData // - function normalizedcross (FIXME: normalizedCross?) // - function dotProduct // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. %ModuleHeaderCode #include using namespace Qwt3D; %End // %ModuleHeaderCode enum PLOTSTYLE { NOPLOT, WIREFRAME, HIDDENLINE, FILLED, FILLEDMESH, POINTS, USER, }; // enum PLOTSTYLE enum SHADINGSTYLE { FLAT, GOURAUD, }; // enum SHADINGSTYLE enum COORDSTYLE { NOCOORD, BOX, FRAME, }; // enum COORDSTYLE enum SCALETYPE { LINEARSCALE, LOG10SCALE, USERSCALE, }; // enum SCALETYPE enum FLOORSTYLE { NOFLOOR, FLOORISO, FLOORDATA, }; // enum FLOORSTYLE enum DATATYPE { GRID, POLYGON, }; // enum DATATYPE enum AXIS { X1 = X1, X2 = X2, X3 = X3, X4 = X4, Y1 = Y1, Y2 = Y2, Y3 = Y3, Y4 = Y4, Z1 = Z1, Z2 = Z2, Z3 = Z3, Z4 = Z4, }; // enum AXIS enum SIDE { NOSIDEGRID = NOSIDEGRID, LEFT = LEFT, RIGHT = RIGHT, CEIL = CEIL, FLOOR = FLOOR, FRONT = FRONT, BACK = BACK, }; // enum SIDE enum ANCHOR { BottomLeft, BottomRight, BottomCenter, TopLeft, TopRight, TopCenter, CenterLeft, CenterRight, Center }; // enum ANCHOR struct Tuple { %TypeHeaderCode #include using namespace Qwt3D; %End double x; double y; Tuple(); Tuple(double, double); }; // struct Tuple struct Triple { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode double x; double y; double z; Triple(double = 0, double = 0, double = 0); Triple & operator+=(Triple); Triple & operator-=(Triple); Triple & operator*=(double); Triple & operator/=(double); Triple& operator*=(Triple); bool operator!=(Triple) const; bool operator==(Triple) const; double length() const; void normalize(); // Triple operator+(const Triple &, const Triple &); Triple __add__(const Triple &); // Triple operator-(const Triple &, const Triple &); Triple __sub__(const Triple &); // FIXME: Triple operator*(double, const Triple &); // Triple operator*(const Triple &, double); Triple __mul__(const Triple &); // Triple operator*(const Triple &, const Triple &); Triple __mul__(double); // FIXME: Triple operator/(double, const Triple &); // Triple operator/(const Triple &, double); Triple __div__(double); }; // struct Triple struct ParallelEpiped { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode Triple minVertex; Triple maxVertex; ParallelEpiped(); ParallelEpiped(Triple, Triple); }; // struct ParallelEpiped struct FreeVector { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode Triple base; Triple top; FreeVector(); FreeVector(Triple, Triple); }; // struct FreeVector // FIXME: templates struct RGBA { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode double r; double g; double b; double a; RGBA(); RGBA(double, double, double, double = 1); }; // struct RGBA QColor GL2Qt(GLdouble, GLdouble, GLdouble); RGBA Qt2GL(QColor); //typedef double *Vertex; //typedef std::vector DataRow; //typedef std::vector DataMatrix; class Data { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: DATATYPE datatype; Data(); virtual ~Data(); virtual void clear() = 0; virtual bool empty() const = 0; void setHull(const ParallelEpiped &); const ParallelEpiped & hull() const; //protected: // Qwt3D::ParallelEpiped hull_p; }; // class Data class GridData: Data { %TypeHeaderCode #include using namespace Qwt3D; %End // %TypeHeaderCode public: //DataMatrix vertices; //DataMatrix normals; GridData(); GridData(unsigned int, unsigned int); ~GridData(); int columns() const; int rows() const; void clear(); bool empty() const; void setSize(unsigned int, unsigned int); void setPeriodic(bool, bool); bool uperiodic() const; bool vperiodic() const; }; // class GridData class CellData: Data { %TypeHeaderCode #include #include #include using namespace Qwt3D; %End // %TypeHeaderCode public: CellField cells; TripleField nodes; TripleField normals; CellData(); ~CellData(); void clear(); bool empty() const; const Triple & operator()(unsigned, unsigned); %MethodCode sipRes = const_cast(&(sipCpp->operator()(a0, a1))); %End }; // class CellData Triple normalizedcross(const Triple &, const Triple &); double dotProduct(const Triple &, const Triple &); // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/qwt3dmod.sip000066400000000000000000000052641334664011000174630ustar00rootroot00000000000000// The SIP interface definition for the _Qwt3D module of PyQwt3D. // // Copyright (C) 2004-2008 Gerard Vermeulen // // This file is part of PyQwt3D. // // PyQwt3D 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. // // PyQwt3D 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 PyQwt3D; 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 PyQwt3D dynamically with non-free versions of Qt and PyQt, // and to distribute PyQwt3D 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 PyQwt3D is dynamically linked with non-free versions of Qt and PyQt, // PyQwt3D becomes a free plug-in for a non-free program. %Include features.sip %Include types.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 %End %PostInitialisationCode #ifdef HAS_NUMARRAY qwt3d_import_numarray(); #endif #ifdef HAS_NUMERIC qwt3d_import_numeric(); #endif #ifdef HAS_NUMPY qwt3d_import_numpy(); #endif %End // automagically generated %Include qwt3d_axisvector.sip %Include qwt3d_cell.sip %Include qwt3d_cellfield.sip %Include qwt3d_colorvector.sip %Include qwt3d_doublevector.sip %Include qwt3d_freevectorfield.sip %Include qwt3d_triplefield.sip // blood, sweat and tears %Include qwt3d_autoscaler.sip %Include qwt3d_axis.sip %Include qwt3d_color.sip %Include qwt3d_colorlegend.sip %Include qwt3d_coordsys.sip %Include qwt3d_drawable.sip %Include qwt3d_enrichment.sip %Include qwt3d_enrichment_std.sip %Include qwt3d_function.sip %Include qwt3d_gridmapping.sip %Include qwt3d_io.sip %Include qwt3d_io_gl2ps.sip %Include qwt3d_io_reader.sip %Include qwt3d_label.sip %Include qwt3d_mapping.sip %Include qwt3d_openglhelper.sip %Include qwt3d_parametricsurface.sip %Include qwt3d_plot.sip %Include qwt3d_portability.sip %Include qwt3d_scale.sip %Include qwt3d_surfaceplot.sip %Include qwt3d_types.sip // Local Variables: // mode: C++ // c-file-style: "stroustrup" // indent-tabs-mode: nil // End: PyQwt3D-pyqwt3d-0.1.8/sip/types.sip000066400000000000000000000004061334664011000170560ustar00rootroot00000000000000// Automagically generated by configure.py // Uncomment one of the following three lines // typedef unsigned int size_t; typedef unsigned long size_t; // typedef unsigned long long size_t; // Local Variables: // mode: C++ // c-file-style: "stroustrup" // End: PyQwt3D-pyqwt3d-0.1.8/unbieber.py000077500000000000000000000031061334664011000165520ustar00rootroot00000000000000#!/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=2, 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.replace('\r\n', '\n') newtext = newtext.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: ***