From b1bbcbc14fe6debc03625f698e8a904ca33d880b Mon Sep 17 00:00:00 2001 From: Dimitrios Eftaxiopoulos Date: Wed, 18 Apr 2012 19:01:26 +0300 Subject: [PATCH] Imported Upstream version 2.0 --- .kdev4/mathgl-2x.kdev4 | 61 ++++ CMakeLists.txt | 67 +++-- COPYING_LGPL | 165 ----------- ChangeLog | 2 +- ChangeLog.txt | 2 +- INSTALL | 7 +- Makefile.am | 5 - MathGL2.cbp | 208 -------------- bootstrap | 11 - clean-svn | 3 - config/autotroll.m4 | 431 ----------------------------- config/autotroll.mk | 81 ------ configure.ac | 327 ---------------------- examples/CMakeLists.txt | 2 +- examples/Makefile.am | 46 --- examples/fltk_example.cpp | 4 +- examples/full_test.cpp | 11 +- examples/glut_example.cpp | 2 +- examples/qt_example.cpp | 2 +- examples/wnd_samples.cpp | 4 +- examples/wx_example.cpp | 2 +- include/CMakeLists.txt | 16 +- include/Makefile.am | 14 - include/mgl/config.h.in | 77 ------ include/{mgl => mgl2}/addon.h | 0 include/{mgl => mgl2}/base.h | 13 +- include/{mgl => mgl2}/base_cf.h | 6 +- include/{mgl => mgl2}/canvas.h | 2 +- include/{mgl => mgl2}/canvas_cf.h | 2 +- include/{mgl => mgl2}/canvas_wnd.h | 2 +- include/{mgl => mgl2}/cont.h | 2 +- include/{mgl => mgl2}/data.h | 4 +- include/{mgl => mgl2}/data_cf.h | 2 +- include/{mgl => mgl2}/define.h | 7 +- include/{mgl => mgl2}/eval.h | 2 +- include/{mgl => mgl2}/evalc.h | 4 +- include/{mgl => mgl2}/fit.h | 2 +- include/{mgl => mgl2}/fltk.h | 5 +- include/{mgl => mgl2}/font.h | 2 +- include/{mgl => mgl2}/glut.h | 6 +- include/{mgl => mgl2}/mgl.h | 10 +- include/{mgl => mgl2}/mgl_cf.h | 24 +- include/{mgl => mgl2}/opengl.h | 2 +- include/{mgl => mgl2}/other.h | 2 +- include/{mgl => mgl2}/parser.h | 2 +- include/{mgl => mgl2}/plot.h | 2 +- include/{mgl => mgl2}/prim.h | 2 +- include/{mgl => mgl2}/qt.h | 4 +- include/{mgl => mgl2}/surf.h | 2 +- include/{mgl => mgl2}/type.h | 2 +- include/{mgl => mgl2}/vect.h | 2 +- include/{mgl => mgl2}/volume.h | 2 +- include/{mgl => mgl2}/window.h | 2 +- lang/CMakeLists.txt | 122 +++++--- lang/Makefile.am | 50 ---- lang/mgl.i.in | 21 +- lang/setup.py.in | 35 +-- mgllab/Makefile.am | 10 - mgllab/grid.cpp | 19 +- mgllab/mathgl.cpp | 2 +- mgllab/setup.cpp | 2 +- mgllab/udav.h | 4 +- src/CMakeLists.txt | 27 +- src/Makefile.am | 47 ---- src/addon.cpp | 4 +- src/axis.cpp | 12 +- src/base.cpp | 46 ++- src/base_cf.cpp | 14 +- src/canvas.cpp | 34 +-- src/canvas_cf.cpp | 4 +- src/cont.cpp | 32 +-- src/crust.cpp | 6 +- src/data.cpp | 8 +- src/data_io.cpp | 20 +- src/data_new.cpp | 2 +- src/data_op.cpp | 2 +- src/data_png.cpp | 2 +- src/eval.cpp | 14 +- src/evalc.cpp | 10 +- src/evalp.cpp | 4 +- src/exec.cpp | 2 +- src/export.cpp | 4 +- src/export_2d.cpp | 6 +- src/export_3d.cpp | 18 +- src/fit.cpp | 6 +- src/font.cpp | 4 +- src/opengl.cpp | 4 +- src/other.cpp | 40 +-- src/parser.cpp | 4 +- src/pde.cpp | 4 +- src/pixel.cpp | 14 +- src/plot.cpp | 22 +- src/prc.cpp | 4 +- src/prim.cpp | 14 +- src/surf.cpp | 14 +- src/tex_table.cpp | 2 +- src/vect.cpp | 22 +- src/volume.cpp | 20 +- texinfo/CMakeLists.txt | 37 ++- texinfo/Makefile.am | 42 --- texinfo/concept_en.texi | 4 +- texinfo/core_en.texi | 17 +- texinfo/core_ru.texi | 14 +- texinfo/data_en.texi | 4 +- texinfo/data_ru.texi | 4 +- texinfo/doc_en.texi | 134 +++++++++ texinfo/doc_ru.texi | 150 ++++++++++ texinfo/example_en.texi | 26 +- texinfo/example_ru.texi | 26 +- texinfo/mathgl_en.texi | 3 + texinfo/mgl_en.texi | 3 + texinfo/other_en.texi | 14 +- texinfo/other_ru.texi | 12 +- texinfo/overview_en.texi | 7 +- texinfo/overview_ru.texi | 8 +- texinfo/parse_en.texi | 2 +- texinfo/parse_ru.texi | 2 +- texinfo/toc_en.html | 2 +- texinfo/web_en.texi | 180 ++++++------ texinfo/widget_en.texi | 6 +- texinfo/widget_ru.texi | 14 +- todo.txt | 92 ------ udav/args_dlg.cpp | 2 +- udav/calc_dlg.cpp | 2 +- udav/dat_pnl.cpp | 6 +- udav/info_dlg.cpp | 4 +- udav/mem_pnl.cpp | 2 +- udav/newcmd_dlg.cpp | 2 +- udav/open_dlg.cpp | 2 +- udav/plot_pnl.cpp | 4 +- udav/qmglsyntax.cpp | 2 +- udav/src.pro | 68 ----- udav/style_dlg.cpp | 2 +- udav/text_pnl.cpp | 2 +- udav/udav_wnd.cpp | 4 +- utils/CMakeLists.txt | 2 +- utils/Makefile.am | 16 -- utils/mglconv.cpp | 4 +- utils/mglview.cpp | 4 +- widgets/CMakeLists.txt | 14 +- widgets/Makefile.am | 38 --- widgets/fltk.cpp | 2 +- widgets/glut.cpp | 2 +- widgets/qt.cpp | 2 +- widgets/window.cpp | 2 +- 145 files changed, 1065 insertions(+), 2352 deletions(-) create mode 100644 .kdev4/mathgl-2x.kdev4 delete mode 100644 COPYING_LGPL mode change 100644 => 120000 ChangeLog delete mode 100644 Makefile.am delete mode 100644 MathGL2.cbp delete mode 100755 bootstrap delete mode 100755 clean-svn delete mode 100644 config/autotroll.m4 delete mode 100644 config/autotroll.mk delete mode 100644 configure.ac delete mode 100644 examples/Makefile.am delete mode 100644 include/Makefile.am delete mode 100644 include/mgl/config.h.in rename include/{mgl => mgl2}/addon.h (100%) rename include/{mgl => mgl2}/base.h (96%) rename include/{mgl => mgl2}/base_cf.h (94%) rename include/{mgl => mgl2}/canvas.h (97%) rename include/{mgl => mgl2}/canvas_cf.h (98%) rename include/{mgl => mgl2}/canvas_wnd.h (97%) rename include/{mgl => mgl2}/cont.h (98%) rename include/{mgl => mgl2}/data.h (98%) rename include/{mgl => mgl2}/data_cf.h (98%) rename include/{mgl => mgl2}/define.h (95%) rename include/{mgl => mgl2}/eval.h (97%) rename include/{mgl => mgl2}/evalc.h (93%) rename include/{mgl => mgl2}/fit.h (98%) rename include/{mgl => mgl2}/fltk.h (96%) rename include/{mgl => mgl2}/font.h (97%) rename include/{mgl => mgl2}/glut.h (95%) rename include/{mgl => mgl2}/mgl.h (98%) rename include/{mgl => mgl2}/mgl_cf.h (83%) rename include/{mgl => mgl2}/opengl.h (96%) rename include/{mgl => mgl2}/other.h (98%) rename include/{mgl => mgl2}/parser.h (97%) rename include/{mgl => mgl2}/plot.h (98%) rename include/{mgl => mgl2}/prim.h (98%) rename include/{mgl => mgl2}/qt.h (96%) rename include/{mgl => mgl2}/surf.h (98%) rename include/{mgl => mgl2}/type.h (99%) rename include/{mgl => mgl2}/vect.h (98%) rename include/{mgl => mgl2}/volume.h (98%) rename include/{mgl => mgl2}/window.h (97%) delete mode 100644 lang/Makefile.am delete mode 100644 mgllab/Makefile.am delete mode 100644 src/Makefile.am delete mode 100644 texinfo/Makefile.am create mode 100644 texinfo/doc_en.texi create mode 100644 texinfo/doc_ru.texi delete mode 100644 todo.txt delete mode 100644 udav/src.pro delete mode 100644 utils/Makefile.am delete mode 100644 widgets/Makefile.am diff --git a/.kdev4/mathgl-2x.kdev4 b/.kdev4/mathgl-2x.kdev4 new file mode 100644 index 0000000..0cc27b3 --- /dev/null +++ b/.kdev4/mathgl-2x.kdev4 @@ -0,0 +1,61 @@ +[Buildset] +BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x12\x00m\x00a\x00t\x00h\x00g\x00l\x00-\x002\x00x) + +[CMake] +BuildDirs=/home/balakin/progr/sfnet/mathgl/mathgl-2x/build +CMakeDir=/usr/share/cmake-2.8/Modules +Current CMake Binary=file:///usr/bin/cmake +CurrentBuildDir=file:///home/balakin/progr/sfnet/mathgl/mathgl-2x/build +CurrentBuildType=Debug +CurrentInstallDir= +Extra Arguments= +ProjectRootRelative=./ + +[Launch] +Launch Configurations=Launch Configuration 0,Launch Configuration 1 + +[Launch][Launch Configuration 0] +Configured Launch Modes=execute +Configured Launchers=nativeAppLauncher +Name=fltk_example +Type=Native Application + +[Launch][Launch Configuration 0][Data] +Arguments=-test +Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x03\x00\x00\x00\x12\x00m\x00a\x00t\x00h\x00g\x00l\x00-\x002\x00x\x00\x00\x00\n\x00u\x00t\x00i\x00l\x00s\x00\x00\x00\x0e\x00m\x00g\x00l\x00c\x00o\x00n\x00v) +Dependency Action=Build +EnvironmentGroup=default +Executable=file:///home/balakin/progr/sfnet/mathgl/mathgl-2x/build/examples/mgl_fltk_example +External Terminal=konsole --noclose --workdir %workdir -e %exe +Project Target=mathgl-2x,utils,mglconv +Use External Terminal=false +Working Directory= +isExecutable=true + +[Launch][Launch Configuration 1] +Configured Launch Modes=execute +Configured Launchers=nativeAppLauncher +Name=udav +Type=Native Application + +[Launch][Launch Configuration 1][Data] +Arguments= +Debugger Shell= +Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x00) +Dependency Action=Nothing +Display Demangle Names=true +Display Static Members=false +EnvironmentGroup=default +Executable=file:///home/balakin/progr/sfnet/mathgl/mathgl-2x/build/udav/udav +External Terminal=konsole --noclose --workdir %workdir -e %exe +GDB Path= +Project Target= +Remote GDB Config Script= +Remote GDB Run Script= +Remote GDB Shell Script= +Use External Terminal=false +Working Directory= +isExecutable=true + +[Project] +VersionControlSupport=kdevsubversion diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ac5192..51c43c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 2.6) project( MathGL ) set(CMAKE_VERBOSE_MAKEFILE ON) +set(MathGL_VERSION_MAJOR 2) +set(MathGL_VERSION_MINOR 0) + option(enable-double "Enable double precision in MathGL library") option(enable-all "Enable all features") option(enable-langall "Enable all language interfaces") @@ -10,7 +13,7 @@ option(enable-ltdl "Enable loading modules support") option(enable-pthread "Enable POSIX threads support") option(enable-gsl "Enable gsl support") option(enable-jpeg "Enable jpeg support") -option(enable-u3d "Enable u3d support") +#option(enable-u3d "Enable u3d support") option(enable-pdf "Enable pdf support") option(enable-gif "Enable gif support") option(enable-hdf4 "Enable hdf4 support") @@ -121,43 +124,37 @@ else(enable-all OR enable-jpeg) set(MGL_HAVE_JPEG 0) endif(enable-all OR enable-jpeg) -#if((enable-all OR enable-u3d OR enable-pdf) AND (NOT enable-lgpl) ) -if((enable-u3d OR enable-pdf) AND (NOT enable-lgpl) ) - set(MGL_HAVE_U3D 1) - find_library(U3D_LIB IDTF) - if(NOT U3D_LIB) - message(STATUS "Couldn't find U3D libraries.") - endif(NOT U3D_LIB) - find_path(U3D_INCLUDE_DIR u3d/SceneConverterLib.h) - if(NOT U3D_INCLUDE_DIR) - message(STATUS "Couldn't find U3D headers.") - endif(NOT U3D_INCLUDE_DIR) - message(STATUS "Found U3D libraries at: ${U3D_LIB}") - message(STATUS "Found U3D headers: ${U3D_INCLUDE_DIR}") -#else((enable-u3d OR enable-pdf) AND (NOT enable-lgpl) ) -else((enable-all OR enable-u3d OR enable-pdf) AND (NOT enable-lgpl) ) - set(MGL_HAVE_U3D 0) -#endif((enable-u3d OR enable-pdf) AND (NOT enable-lgpl) ) -endif((enable-u3d OR enable-pdf) AND (NOT enable-lgpl) ) +# if(enable-u3d AND (NOT enable-lgpl) ) +# set(MGL_HAVE_U3D 1) +# find_library(U3D_LIB IDTF) +# if(NOT U3D_LIB) +# message(SEND_ERROR "Couldn't find U3D libraries.") +# endif(NOT U3D_LIB) +# find_path(U3D_INCLUDE_DIR u3d/SceneConverterLib.h) +# if(NOT U3D_INCLUDE_DIR) +# message(SEND_ERROR "Couldn't find U3D headers.") +# endif(NOT U3D_INCLUDE_DIR) +# message(STATUS "Found U3D libraries at: ${U3D_LIB}") +# message(STATUS "Found U3D headers: ${U3D_INCLUDE_DIR}") +# else(enable-u3d AND (NOT enable-lgpl) ) +# set(MGL_HAVE_U3D 0) +# endif(enable-u3d AND (NOT enable-lgpl) ) -#if((enable-all OR enable-pdf) AND (NOT enable-lgpl) ) -if((enable-pdf) AND (NOT enable-lgpl) ) +if((enable-all OR enable-pdf) AND (NOT enable-lgpl) ) set(MGL_HAVE_PDF 1) find_library(HPDF_LIB hpdf) if(NOT HPDF_LIB) - message(STATUS "Couldn't find libHaru.") + message(SEND_ERROR "Couldn't find libHaru.") endif(NOT HPDF_LIB) find_path(HPDF_INCLUDE_DIR hpdf_u3d.h) if(NOT HPDF_INCLUDE_DIR) - message(STATUS "Couldn't find headers of u3d-enabled version of libHaru.") + message(SEND_ERROR "Couldn't find headers of 3d-enabled version of libHaru.") endif(NOT HPDF_INCLUDE_DIR) - message(STATUS "Found libHaru library at: ${HPDF_LIB}") - message(STATUS "Found libHaru headers: ${HPDF_INCLUDE_DIR}") -#else((enable-all OR enable-pdf) AND (NOT enable-lgpl) ) -else((enable-pdf) AND (NOT enable-lgpl) ) +# message(STATUS "Found libHaru library at: ${HPDF_LIB}") +# message(STATUS "Found libHaru headers: ${HPDF_INCLUDE_DIR}") +else((enable-all OR enable-pdf) AND (NOT enable-lgpl) ) set(MGL_HAVE_PDF 0) -#endif((enable-all OR enable-pdf) AND (NOT enable-lgpl) ) -endif((enable-pdf) AND (NOT enable-lgpl) ) +endif((enable-all OR enable-pdf) AND (NOT enable-lgpl) ) if(enable-all OR enable-gif) set(MGL_HAVE_GIF 1) @@ -238,18 +235,18 @@ endif((enable-langall OR enable-python) AND (NOT enable-lgpl) ) if((enable-langall OR enable-octave) AND (NOT enable-lgpl) ) set(MGL_HAVE_OCTAVE 1) - find_path(OCTAVE_INCLUDE_DIR octave/oct.h) - if(NOT OCTAVE_INCLUDE_DIR) - message(SEND_ERROR "Couldn't find octave/oct.h needed for octave interfaces compiling.") - endif(NOT OCTAVE_INCLUDE_DIR) - find_program(oct_prog octave) + find_program(oct_prog octave-config) if(NOT oct_prog) - message(SEND_ERROR "Couldn't find octave needed for octave interfaces compiling.") + message(SEND_ERROR "Couldn't find octave-config needed for octave interfaces compiling.") endif(NOT oct_prog) find_program(oct_mk mkoctfile) if(NOT oct_mk) message(SEND_ERROR "Couldn't find mkoctfile needed for octave interfaces compiling.") endif(NOT oct_mk) + find_program(oct_tar tar) + if(NOT oct_tar) + message(SEND_ERROR "Couldn't find tar needed for octave interfaces creation.") + endif(NOT oct_tar) else((enable-langall OR enable-octave) AND (NOT enable-lgpl) ) set(MGL_HAVE_OCTAVE 0) endif((enable-langall OR enable-octave) AND (NOT enable-lgpl) ) diff --git a/COPYING_LGPL b/COPYING_LGPL deleted file mode 100644 index 65c5ca8..0000000 --- a/COPYING_LGPL +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser 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 -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 933ee82..0000000 --- a/ChangeLog +++ /dev/null @@ -1 +0,0 @@ -link ChangeLog.txt \ No newline at end of file diff --git a/ChangeLog b/ChangeLog new file mode 120000 index 0000000..74b6820 --- /dev/null +++ b/ChangeLog @@ -0,0 +1 @@ +ChangeLog.txt \ No newline at end of file diff --git a/ChangeLog.txt b/ChangeLog.txt index ec54935..fc4745f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1 +1 @@ -2.0.b Released 23 August 2011 +2.0 Released 12 April 2012 diff --git a/INSTALL b/INSTALL index 5a5b042..c999c40 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,10 @@ Installation is simple. Just execute: -./configure +cmake . +cmake . make make install Sometimes you also need to update yours library list. To do that just execute: -ldconfig \ No newline at end of file +ldconfig + +See MathGL documentation for more details. diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 9522f05..0000000 --- a/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -ACLOCAL_AMFLAGS = -I config -SUBDIRS = src widgets include lang examples utils - -clean-local: - find . -name '*~' -print0 | xargs -0 rm -f diff --git a/MathGL2.cbp b/MathGL2.cbp deleted file mode 100644 index 860e385..0000000 --- a/MathGL2.cbp +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - diff --git a/bootstrap b/bootstrap deleted file mode 100755 index 646732a..0000000 --- a/bootstrap +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh - -set -x -aclocal -I config -case `uname` in - Darwin) glibtoolize --force --copy ;; - *) libtoolize --force --copy ;; -esac -autoheader -automake --add-missing --copy -autoconf diff --git a/clean-svn b/clean-svn deleted file mode 100755 index f0ba47a..0000000 --- a/clean-svn +++ /dev/null @@ -1,3 +0,0 @@ -find . -name '.svn' -print0 | xargs -0 rm -rf -find . -name '*~' -print0 | xargs -0 rm -f -rm ./clean-svn diff --git a/config/autotroll.m4 b/config/autotroll.m4 deleted file mode 100644 index 832ef4d..0000000 --- a/config/autotroll.m4 +++ /dev/null @@ -1,431 +0,0 @@ -# Build Qt apps with the autotools (Autoconf/Automake). -# M4 macros. -# This file is part of AutoTroll. -# Copyright (C) 2006 Benoit Sigoure -# -# AutoTroll 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. - - # ------------- # - # DOCUMENTATION # - # ------------- # - -# Disclaimer: Never tested with anything else than Qt 4.2! Feedback welcome. -# Simply invoke AT_WITH_QT in your configure.ac. AT_WITH_QT can take -# arguments which are documented in depth below. The default arguments are -# equivalent to the default .pro file generated by qmake. -# -# Invoking AT_WITH_QT will do the following: -# - Add a --with-qt option to your configure -# - Find qmake, moc and uic and save them in the make variables $(QMAKE), -# $(MOC), $(UIC). -# - Save the path to Qt in $(QT_PATH) -# - Find the flags to use Qt, that is: -# * $(QT_DEFINES): -D's defined by qmake. -# * $(QT_CFLAGS): CFLAGS as defined by qmake (C?!) -# * $(QT_CXXFLAGS): CXXFLAGS as defined by qmake. -# * $(QT_INCPATH): -I's defined by qmake. -# * $(QT_CPPFLAGS): Same as $(QT_DEFINES) + $(QT_INCPATH) -# * $(QT_LFLAGS): LFLAGS defined by qmake. -# * $(QT_LDFLAGS): Same thing as $(QT_LFLAGS). -# * $(QT_LIBS): LIBS defined by qmake. -# -# You *MUST* invoke $(MOC) and/or $(UIC) where necessary. AutoTroll provides -# you with Makerules to ease this, here is a sample Makefile.am to use with -# AutoTroll which builds the code given in the chapter 7 of the Qt Tutorial: -# http://doc.trolltech.com/4.2/tutorial-t7.html -# -# ------------------------------------------------------------------------- -# include $(top_srcdir)/build-aux/autotroll.mk -# -# ACLOCAL_AMFLAGS = -I build-aux -# -# bin_PROGRAMS = lcdrange -# lcdrange_SOURCES = $(BUILT_SOURCES) lcdrange.cpp lcdrange.h main.cpp -# lcdrange_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS) -# lcdrange_CPPFLAGS = $(QT_CPPFLAGS) $(AM_CPPFLAGS) -# lcdrange_LDFLAGS = $(QT_LDFLAGS) $(LDFLAGS) -# lcdrange_LDADD = $(QT_LIBS) $(LDADD) -# -# BUILT_SOURCES = lcdrange.moc.cpp -# ------------------------------------------------------------------------- -# -# Note that your MOC, UIC and QRC files *MUST* be listed manually in -# BUILT_SOURCES. If you name them properly (eg: .moc.cc, .qrc.cc, .ui.cc -- of -# course you can use .cpp or .cxx or .C rather than .cc) AutoTroll will build -# them automagically for you (using implicit rules defined in autotroll.mk). - -m4_pattern_forbid([^AT_])dnl -m4_pattern_forbid([^_AT_])dnl - -# AT_WITH_QT([QT_modules], [QT_config], [QT_misc]) -# ------------------------------------------------ -# Enable Qt support and add an option --with-qt to the configure script. -# -# The QT_modules argument is optional and defines extra modules to enable or -# disable (it's equivalent to the QT variable in .pro files). Modules can be -# specified as follows: -# -# AT_WITH_QT => No argument -> No QT value. -# Qmake sets it to "core gui" by default. -# AT_WITH_QT([xml]) => QT += xml -# AT_WITH_QT([+xml]) => QT += xml -# AT_WITH_QT([-gui]) => QT -= gui -# AT_WITH_QT([xml -gui +sql svg]) => QT += xml sql svg -# QT -= gui -# -# The QT_config argument is also optional and follows the same convention as -# QT_modules. Instead of changing the QT variable, it changes the CONFIG -# variable, which is used to tweak configuration and compiler options. -# -# The last argument, QT_misc (also optional) will be copied as-is the .pro -# file used to guess how to compile Qt apps. You may use it to further tweak -# the build process of Qt apps if tweaking the QT or CONFIG variables isn't -# enough for you. -AC_DEFUN([AT_WITH_QT], -[ AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - AC_REQUIRE([AC_PROG_CXX]) - - test x"$TROLL" != x && echo 'ViM rox emacs.' - -dnl Memo: AC_ARG_WITH(package, help-string, [if-given], [if-not-given]) - AC_ARG_WITH([qt], - [AS_HELP_STRING([--with-qt], - [Path to Qt @<:@Look in PATH and /usr/local/Trolltech@:>@])], - [QT_PATH=$withval], [QT_PATH=]) - - # Find Qt. - if test -d /usr/local/Trolltech; then - # Try to find the latest version. - tmp_qt_paths=`echo /usr/local/Trolltech/*/bin | tr ' ' '\n' | sort -nr \ - | xargs | sed 's/ */:/g'` - fi - - # Find qmake. - AC_PATH_PROGS([QMAKE], [qmake-qt4${EXEEXT}], [missing], [$QT_DIR:$QT_PATH:$PATH:$tmp_qt_paths]) - if test x"$QMAKE" = xmissing; then - AC_PATH_PROGS([QMAKE], [qmake${EXEEXT}], [missing], [$QT_DIR:$QT_PATH:$PATH:$tmp_qt_paths]) - if test x"$QMAKE" = xmissing; then - AC_MSG_ERROR([Cannot find qmake in your PATH. Try using --with-qt.]) - fi - fi - - # Find moc (Meta Object Compiler). - AC_PATH_PROGS([MOC], [moc-qt4${EXEEXT}], [missing], [$QT_PATH:$PATH:$tmp_qt_paths]) - if test x"$MOC" = xmissing; then - AC_PATH_PROGS([MOC], [moc${EXEEXT}], [missing], [$QT_PATH:$PATH:$tmp_qt_paths]) - if test x"$MOC" = xmissing; then - AC_MSG_ERROR([Cannot find moc (Meta Object Compiler) in your PATH. Try using --with-qt.]) - fi - fi - - # Find uic (User Interface Compiler). - AC_PATH_PROGS([UIC], [uic-qt4${EXEEXT}], [missing], [$QT_PATH:$PATH:$tmp_qt_paths]) - if test x"$UIC" = xmissing; then - AC_PATH_PROGS([UIC], [uic${EXEEXT}], [missing], [$QT_PATH:$PATH:$tmp_qt_paths]) - if test x"$UIC" = xmissing; then - AC_MSG_ERROR([Cannot find uic (User Interface Compiler) in your PATH. Try using --with-qt.]) - fi - fi - - # Find rcc (Qt Resource Compiler). - AC_PATH_PROGS([RCC], [rcc-qt4${EXEEXT}], [false], [$QT_PATH:$PATH:$tmp_qt_paths]) - if test x"$RCC" = xfalse; then - AC_PATH_PROGS([RCC], [rcc${EXEEXT}], [false], [$QT_PATH:$PATH:$tmp_qt_paths]) - if test x"$RCC" = xfalse; then - AC_MSG_WARN([Cannot find rcc (Qt Resource Compiler) in your PATH. Try using --with-qt.]) - fi - fi - - # If we don't know the path to Qt, guess it from the path to qmake. - if test x"$QT_PATH" = x; then - QT_PATH=`dirname "$QMAKE"` - fi - if test x"$QT_PATH" = x; then - AC_MSG_ERROR([Cannot find the path to your Qt install. Use --with-qt.]) - fi - AC_SUBST([QT_PATH]) - - # Get ready to build a test-app with Qt. - - # Look for a writable temporary directory. - AC_ARG_VAR([TMPDIR], [A temporary directory with write access @<:@/tmp@:>@]) - if test x"$TMPDIR" = x || test ! -d "$TMPDIR" || test ! -w "$TMPDIR"; then - echo "$as_me:$LINENO: no TMPDIR or bad TMPDIR ($TMPDIR)" \ - >&AS_MESSAGE_LOG_FD - for i in /tmp /var/tmp; do - if test -d "$i" && test -w "$i"; then - TMPDIR=$i - export TMPDIR - echo "$as_me:$LINENO: setting TMPDIR=$TMPDIR" >&AS_MESSAGE_LOG_FD - break - fi - done - fi - - # Kludge!! QMake has a very strange behavior. For instance, if you - # install Qt under your $HOME and run QMake somewhere else under your - # $HOME, it will try to be clever and produce Makefiles with relative - # include paths. In order to avoid this, we will test QMake from a - # temporary directory (usually /tmp). Note that this problem was only - # observed with Qt 4. - my_configure_pwd=`pwd` - my_tmpdir="$TMPDIR/conftest$$.dir" - test -d "$my_tmpdir" || mkdir "$my_tmpdir" - if test -w "$my_tmpdir" && cd "$my_tmpdir" - then - : - else - AC_MSG_ERROR([Cannot cd to or write in $my_tmpdir]) - fi - cat >conftest.h <<_ASEOF -#include - -class Foo: public QObject -{ - Q_OBJECT; -public: - Foo(); - ~Foo() {} -public slots: - void setValue(int value); -signals: - void valueChanged(int newValue); -private: - int value_; -}; -_ASEOF - - cat >conftest.cpp <<_ASEOF -#include "conftest.h" -Foo::Foo() - : value_ (42) -{ - connect(this, SIGNAL(valueChanged(int)), this, SLOT(setValue(int))); -} - -void Foo::setValue(int value) -{ - value_ = value; -} - -int main() -{ - Foo f; -} -_ASEOF - if $QMAKE -project; then :; else - AC_MSG_ERROR([Calling $QMAKE -project failed.]) - fi - - # Find the .pro file generated by qmake. - pro_file='conftest.dir.pro' - test -f $pro_file || pro_file=`echo *.pro` - if test -f "$pro_file"; then :; else - AC_MSG_ERROR([Can't find the .pro file generated by Qmake.]) - fi - -dnl Tweak the value of QT in the .pro if have been the 1st arg. -m4_ifval([$1], [_AT_TWEAK_PRO_FILE([QT], [$1])]) - -dnl Tweak the value of CONFIG in the .pro if have been given a 2nd arg. -m4_ifval([$2], [_AT_TWEAK_PRO_FILE([CONFIG], [$2])]) - -m4_ifval([$3], -[ # Add the extra-settings the user wants to set in the .pro - echo "$3" >>"$pro_file" -]) - - echo "$as_me:$LINENO: Invoking $QMAKE on $pro_file" >&AS_MESSAGE_LOG_FD - sed 's/^/| /' "$pro_file" >&AS_MESSAGE_LOG_FD - - if $QMAKE; then :; else - AC_MSG_ERROR([Calling $QMAKE failed.]) - fi - # Try to compile a simple Qt app. - AC_CACHE_CHECK([whether we can build a simple Qt app], [at_cv_qt_build], - [at_cv_qt_build=ko - : ${MAKE=make} - - if $MAKE >&AS_MESSAGE_LOG_FD 2>&1; then - at_cv_qt_build='ok, looks like Qt 4' - else - echo "$as_me:$LINENO: Build failed, trying to #include \ -instead" >&AS_MESSAGE_LOG_FD - sed 's///' conftest.h > tmp.h && mv tmp.h conftest.h - if $MAKE >&AS_MESSAGE_LOG_FD 2>&1; then - at_cv_qt_build='ok, looks like Qt 3' - else - # Sometimes (such as on Debian) build will fail because Qt hasn't been - # installed in debug mode and qmake tries (by default) to build apps in - # debug mode => Try again in release mode. - echo "$as_me:$LINENO: Build failed, trying to enforce release mode" \ - >&AS_MESSAGE_LOG_FD - - _AT_TWEAK_PRO_FILE([CONFIG], [+release]) - - sed 's///' conftest.h > tmp.h && mv tmp.h conftest.h - if $MAKE >&AS_MESSAGE_LOG_FD 2>&1; then - at_cv_qt_build='ok, looks like Qt 4, release mode forced' - else - echo "$as_me:$LINENO: Build failed, trying to #include \ -instead" >&AS_MESSAGE_LOG_FD - sed 's///' conftest.h > tmp.h && mv tmp.h conftest.h - if $MAKE >&AS_MESSAGE_LOG_FD 2>&1; then - at_cv_qt_build='ok, looks like Qt 3, release mode forced' - else - at_cv_qt_build=ko - echo "$as_me:$LINENO: failed program was:" >&AS_MESSAGE_LOG_FD - sed 's/^/| /' conftest.h >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: failed program was:" >&AS_MESSAGE_LOG_FD - sed 's/^/| /' conftest.cpp >&AS_MESSAGE_LOG_FD - fi # if make with Qt3-style #include and release mode forced. - fi # if make with Qt4-style #include and release mode forced. - fi # if make with Qt3-style #include. - fi # if make with Qt4-style #include. - ])dnl end: AC_CACHE_CHECK(at_cv_qt_build) - - if test x"$at_cv_qt_build" = xko; then - AC_MSG_ERROR([Cannot build a test Qt program]) - fi - QT_VERSION_MAJOR=`echo "$at_cv_qt_build" | sed 's/^[^0-9]*//'` - AC_SUBST([QT_VERSION_MAJOR]) - - # This sed filter is applied after an expression of the form: /^FOO.*=/!d; - # It starts by removing the beginning of the line, removing references to - # SUBLIBS, removing unnecessary whitespaces at the beginning, and prefixes - # all variable uses by QT_. - qt_sed_filter='s///; - s/$(SUBLIBS)//g; - s/^ *//; - s/\$(\(@<:@A-Z_@:>@@<:@A-Z_@:>@*\))/$(QT_\1)/g' - - # Find the Makefile (qmake happens to generate a fake Makefile which invokes - # a Makefile.Debug or Makefile.Release). We we have both, we'll pick the - # Makefile.Release. The reason is that the main difference is that release - # uses -Os and debug -g. We can override -Os by passing another -O but we - # usually don't override -g. - if test -f Makefile.Release; then - at_mfile='Makefile.Release' - else - at_mfile='Makefile' - fi - if test -f $at_mfile; then :; else - cd "$my_configure_pwd" - AC_MSG_ERROR([Cannot find the Makefile generated by qmake.]) - fi - - # Find the DEFINES of Qt (should have been named CPPFLAGS). - AC_CACHE_CHECK([for the DEFINES to use with Qt], [at_cv_env_QT_DEFINES], - [at_cv_env_QT_DEFINES=`sed "/^DEFINES@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile`]) - AC_SUBST([QT_DEFINES], [$at_cv_env_QT_DEFINES]) - - # Find the CFLAGS of Qt (We can use Qt in C?!) - AC_CACHE_CHECK([for the CFLAGS to use with Qt], [at_cv_env_QT_CFLAGS], - [at_cv_env_QT_CFLAGS=`sed "/^CFLAGS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile`]) - AC_SUBST([QT_CFLAGS], [$at_cv_env_QT_CFLAGS]) - - # Find the CXXFLAGS of Qt. - AC_CACHE_CHECK([for the CXXFLAGS to use with Qt], [at_cv_env_QT_CXXFLAGS], - [at_cv_env_QT_CXXFLAGS=`sed "/^CXXFLAGS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile`]) - AC_SUBST([QT_CXXFLAGS], [$at_cv_env_QT_CXXFLAGS]) - - # Find the INCPATH of Qt. - AC_CACHE_CHECK([for the INCPATH to use with Qt], [at_cv_env_QT_INCPATH], - [at_cv_env_QT_INCPATH=`sed "/^INCPATH@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile`]) - AC_SUBST([QT_INCPATH], [$at_cv_env_QT_INCPATH]) - - AC_SUBST([QT_CPPFLAGS], ["$at_cv_env_QT_DEFINES $at_cv_env_QT_INCPATH"]) - - # Find the LFLAGS of Qt (Should have been named LDFLAGS) - AC_CACHE_CHECK([for the LDFLAGS to use with Qt], [at_cv_env_QT_LDFLAGS], - [at_cv_env_QT_LDFLAGS=`sed "/^LDFLAGS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile`]) - AC_SUBST([QT_LFLAGS], [$at_cv_env_QT_LDFLAGS]) - AC_SUBST([QT_LDFLAGS], [$at_cv_env_QT_LDFLAGS]) - - AC_MSG_CHECKING([whether host operating system is Darwin]) - at_darwin="no" - case $host_os in - darwin*) - at_darwin="yes" - ;; - esac - AC_MSG_RESULT([$at_darwin]) - - # Find the LIBS of Qt. - AC_CACHE_CHECK([for the LIBS to use with Qt], [at_cv_env_QT_LIBS], - [at_cv_env_QT_LIBS=`sed "/^LIBS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` - if test x$at_darwin = xyes; then - # Fix QT_LIBS: as of today Libtool (GNU Libtool 1.5.23a) doesn't handle - # -F properly. The "bug" has been fixed on 22 October 2006 - # by Peter O'Gorman but we provide backward compatibility here. - at_cv_env_QT_LIBS=`echo "$at_cv_env_QT_LIBS" \ - | sed 's/^-F/-Wl,-F/;s/ -F/ -Wl,-F/g'` - fi - ]) - AC_SUBST([QT_LIBS], [$at_cv_env_QT_LIBS]) - - cd "$my_configure_pwd" || echo 'WTF!' - rm -rf "$my_tmpdir" -]) - -# AT_REQUIRE_QT_VERSION(QT_version) -# --------------------------------- -# Check (using qmake) that Qt's version "matches" QT_version. -# Must be run AFTER AT_WITH_QT. Requires autoconf 2.60. -AC_DEFUN([AT_REQUIRE_QT_VERSION], -[ AC_PREREQ([2.60]) - if test x"$QMAKE" = x; then - AC_MSG_ERROR([\$QMAKE is empty. \ -Did you invoke AT@&t@_WITH_QT before AT@&t@_REQUIRE_QT_VERSION?]) - fi - AC_CACHE_CHECK([for Qt's version], [at_cv_QT_VERSION], - [echo "$as_me:$LINENO: Running $QMAKE --version:" >&AS_MESSAGE_LOG_FD - $QMAKE --version >&AS_MESSAGE_LOG_FD 2>&1 - qmake_version_sed=['/^.*\([0-9]\.[0-9]\.[0-9]\).*$/!d;s//\1/'] - at_cv_QT_VERSION=`$QMAKE --version 2>&1 | sed "$qmake_version_sed"`]) - if test x"$at_cv_QT_VERSION" = x; then - AC_MSG_ERROR([Cannot detect Qt's version.]) - fi - AC_SUBST([QT_VERSION], [$at_cv_QT_VERSION]) - AS_VERSION_COMPARE([$QT_VERSION], [$1], - [AC_MSG_ERROR([This package requires Qt $1 or above.])]) -]) - -# _AT_TWEAK_PRO_FILE(QT_VAR, VALUE) -# --------------------------- -# @internal. Tweak the variable QT_VAR in the .pro. -# VALUE is an IFS-separated list of value and each value is rewritten -# as follows: -# +value => QT_VAR += value -# -value => QT_VAR -= value -# value => QT_VAR += value -AC_DEFUN([_AT_TWEAK_PRO_FILE], -[ # Tweak the value of $1 in the .pro file for $2. - - qt_conf='' - for at_mod in $2; do - at_mod=`echo "$at_mod" | sed 's/^-//; tough - s/^+//; beef - :ough - s/^/$1 -= /;n - :eef - s/^/$1 += /'` - qt_conf="$qt_conf -$at_mod" - done - echo "$qt_conf" | sed 1d >>"$pro_file" -]) diff --git a/config/autotroll.mk b/config/autotroll.mk deleted file mode 100644 index 9e3ea22..0000000 --- a/config/autotroll.mk +++ /dev/null @@ -1,81 +0,0 @@ -# Makerules. -# This file is part of AutoTroll. -# Copyright (C) 2006 Benoit Sigoure. -# -# AutoTroll 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. - - # ------------- # - # DOCUMENTATION # - # ------------- # - -# See autotroll.m4 :) - - -SUFFIXES = .moc.cpp .moc.cc .moc.cxx .moc.C .h .hh \ - .ui .ui.h .ui.hh \ - .qrc .qrc.cpp .qrc.cc .qrc.cxx .qrc.C - -# --- # -# MOC # -# --- # - -.hh.moc.cpp: - $(MOC) $(QT_CPPFLAGS) $< -o $@ -.h.moc.cpp: - $(MOC) $(QT_CPPFLAGS) $< -o $@ - -.hh.moc.cc: - $(MOC) $(QT_CPPFLAGS) $< -o $@ -.h.moc.cc: - $(MOC) $(QT_CPPFLAGS) $< -o $@ - -.hh.moc.cxx: - $(MOC) $(QT_CPPFLAGS) $< -o $@ -.h.moc.cxx: - $(MOC) $(QT_CPPFLAGS) $< -o $@ - -.hh.moc.C: - $(MOC) $(QT_CPPFLAGS) $< -o $@ -.h.moc.C: - $(MOC) $(QT_CPPFLAGS) $< -o $@ - -# --- # -# UIC # -# --- # - -.ui.ui.hh: - $(UIC) $< -o $@ - -.ui.ui.h: - $(UIC) $< -o $@ - -# --- # -# RCC # -# --- # - -.qrc.qrc.cpp: - $(RCC) -name `echo "$<" | sed 's/\.qrc$$//'` $< -o $@ - -.qrc.qrc.cc: - $(RCC) -name `echo "$<" | sed 's/\.qrc$$//'` $< -o $@ - -.qrc.qrc.cxx: - $(RCC) -name `echo "$<" | sed 's/\.qrc$$//'` $< -o $@ - -.qrc.qrc.C: - $(RCC) -name `echo "$<" | sed 's/\.qrc$$//'` $< -o $@ - -DISTCLEANFILES = $(BUILT_SOURCES) diff --git a/configure.ac b/configure.ac deleted file mode 100644 index e1c27fe..0000000 --- a/configure.ac +++ /dev/null @@ -1,327 +0,0 @@ -AC_INIT([mathgl], [2.0], [mathgl.abalakin@gmail.com]) - -MGL_RELEASE=2.0 -AC_SUBST(MGL_RELEASE) - -AC_CONFIG_MACRO_DIR([config]) -AC_CONFIG_AUX_DIR(config) -AC_CONFIG_SRCDIR(src) -AC_CONFIG_HEADER(include/mgl/config.h) -AC_LANG([C++]) - -#MGL_RELEASE=1.4 -#AC_SUBST(MGL_RELEASE) - -# LT Version numbers, remember to change them just *before* a release. -# (Interfaces removed: CURRENT++, AGE=0, REVISION=0) -# (Interfaces added: CURRENT++, AGE++, REVISION=0) -# (No interfaces changed: REVISION++) -MGL_CURRENT=6 -MGL_REVISION=0 -MGL_AGE=0 -AC_SUBST(MGL_CURRENT) -AC_SUBST(MGL_REVISION) -AC_SUBST(MGL_AGE) - -AM_INIT_AUTOMAKE - -AC_PROG_CC -AC_PROG_CXX -AC_PROG_INSTALL - -AC_LIBTOOL_WIN32_DLL -AC_LIBTOOL_DLOPEN -AC_PROG_LIBTOOL - -AC_ARG_ENABLE(double, -[ --enable-double Turn on double precision in MathGL library], -[case "${enableval}" in - yes) double=true ;; - no) double=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-double) ;; -esac],[double=false]) - -if (test x$double = xtrue) ;then - AC_DEFINE([MGL_USE_DOUBLE],1,[This define enables double precision in MathGL]) -else - AC_DEFINE([MGL_USE_DOUBLE],0,[This define enables double precision in MathGL]) -fi - -AC_ARG_ENABLE(all, -[ --enable-all Turn on all features], -[case "${enableval}" in - yes) all=true ;; - no) all=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-all) ;; -esac],[all=false]) - -AC_ARG_ENABLE(langall, -[ --enable-langall Turn on all language interfaces], -[case "${enableval}" in - yes) langall=true ;; - no) langall=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-langall) ;; -esac],[langall=false]) - -AC_ARG_ENABLE(pthread, -[ --enable-pthread Turn on pthread support in MathGL library], -[case "${enableval}" in - yes) pthread=true ;; - no) pthread=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-pthread) ;; -esac],[pthread=true]) -AC_CHECK_HEADER(pthread.h,[(test x$all = xtrue || test x$pthread = xtrue) && PTHREAD_FLAGS=-DHAVE_PTHREAD AC_SUBST(PTHREAD_FLAGS)], - [(test x$all = xtrue || test x$pthread = xtrue) && echo "Please install posix threads headers" && exit]) - -AC_CHECK_LIB([pthread], [main], [(test x$all = xtrue || test x$pthread = xtrue) && PTHREAD_LIBS=-lpthread AC_SUBST(PTHREAD_LIBS)], - [(test x$all = xtrue || test x$pthread = xtrue) && echo "Please install posix threads library" && exit]) -AM_CONDITIONAL(USE_PTHREAD, test x$pthread = xtrue) - -AC_ARG_ENABLE(gsl, -[ --enable-gsl Turn on gsl functions], -[case "${enableval}" in - yes) gsl=true ;; - no) gsl=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-gsl) ;; -esac],[gsl=true]) - -if (test x$all = xtrue || test x$gsl = xtrue) ;then - GSL_PROG=gsl-config - AC_CHECK_PROG(GSL_FLAGS,$GSL_PROG,`$GSL_PROG --cflags`) - AC_CHECK_PROG(GSL_LIBS,$GSL_PROG,`$GSL_PROG --libs`) - if test "$GSL_LIBS" ;then - test_gsl=true - else - echo "Please install gsl headers and libraries and make sure that \ - path to $GSL_PROG exist in your PATH" - exit - fi -else - GSL_FLAGS=-DNO_GSL - AC_SUBST(GSL_FLAGS) -fi -AM_CONDITIONAL(USE_GSL, test x$test_gsl = xtrue) - -case "${host}" in - *darwin*) - GL_LIBS="-framework OpenGL" - AC_SUBST(GL_LIBS) - ;; - - *w32*) - GL_LIBS=opengl32 - AC_CHECK_HEADER([GL/gl.h],,[echo "Please install OpenGL headers (GL/gl.h)"; exit]) - AC_CHECK_LIB([${GL_LIBS}], [main], [GL_LIBS=-l${GL_LIBS} AC_SUBST(GL_LIBS)], - [echo "Please install OpenGL library (lib${GL_LIBS}.a)"; exit]) - ;; - - *) - GL_LIBS=GL - AC_CHECK_HEADER(GL/gl.h,,[echo "Please install OpenGL headers (GL/gl.h)"; exit]) - AC_CHECK_LIB([${GL_LIBS}], [main], [GL_LIBS=-l${GL_LIBS} AC_SUBST(GL_LIBS)], - [echo "Please install OpenGL library (lib${GL_LIBS}.a)"; exit]) - ;; - -esac -AM_CONDITIONAL(USE_GLUT, (test x$all = xtrue || test x$glut = xtrue)) - -case "${host}" in - *linux*) - ADDON_FLAGS=-DNO_COLOR_ARRAY - ;; - - *) - ;; -esac - -AC_ARG_ENABLE(hdf5, -[ --enable-hdf5 Turn on hdf5], -[case "${enableval}" in - yes) hdf5=true ;; - no) hdf5=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-hdf5) ;; -esac],[hdf5=false]) -AC_ARG_ENABLE(hdf5_18, -[ --enable-hdf5_18 Turn on hdf5 version 1.8], -[case "${enableval}" in - yes) hdf5_18=true ;; - no) hdf5_18=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-hdf5_18) ;; -esac],[hdf5_18=false]) -#AC_CHECK_HEADER(hdf5.h,[(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_FLAGS=-DHAVE_HDF5 AC_SUBST(HDF5_FLAGS)], -AC_CHECK_HEADER(hdf5.h,[(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_FLAGS=-DHAVE_HDF5 ], - [(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && echo "Please install hdf5 headers" && exit]) -if ((test x$all = xtrue || test x$hdf5 = xtrue) && test x$hdf5_18 = xfalse) ;then - HDF5_FLAGS="$HDF5_FLAGS -DH5_USE_16_API" - AC_SUBST(HDF5_FLAGS) -fi -AC_CHECK_LIB([hdf5], [main], [(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_LIBS=-lhdf5 AC_SUBST(HDF5_LIBS)], - [(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && echo "Please install hdf5 library" && exit]) -AM_CONDITIONAL(USE_HDF5, (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue)) - - -AC_ARG_ENABLE(hdf4, -[ --enable-hdf4 Turn on hdf4], -[case "${enableval}" in - yes) hdf4=true ;; - no) hdf4=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-hdf4) ;; -esac],[hdf4=false]) -AC_CHECK_HEADER(hdf/mfhdf.h,[(test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_FLAGS=-DHAVE_HDF4 ], - [(test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 headers" && exit]) - AC_SUBST(HDF4_FLAGS) -AC_CHECK_LIB([df], [main], [(test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_LIBS="-lmfhdf -ldf" AC_SUBST(HDF4_LIBS)], - [(test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 library" && exit]) -AM_CONDITIONAL(USE_HDF4, (test x$all = xtrue || test x$hdf4 = xtrue)) - -AC_CHECK_HEADER(png.h,,[echo "Please install png headers" && exit]) - -AC_CHECK_LIB([png], [main], [PNG_LIBS=-lpng AC_SUBST(PNG_LIBS)], - [echo "Please install png library" && exit]) - -AC_ARG_ENABLE(jpeg, -[ --enable-jpeg Turn on jpeg], -[case "${enableval}" in - yes) jpeg=true ;; - no) jpeg=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-jpeg) ;; -esac],[jpeg=false]) -AC_CHECK_HEADER(jpeglib.h,[(test x$all = xtrue || test x$jpeg = xtrue) && JPEG_FLAGS=-DHAVE_JPEG AC_SUBST(JPEG_FLAGS)], - [(test x$all = xtrue || test x$jpeg = xtrue) && echo "Please install jpeg headers" && exit]) - -AC_CHECK_LIB([jpeg], [main], [(test x$all = xtrue || test x$jpeg = xtrue) && JPEG_LIBS=-ljpeg AC_SUBST(JPEG_LIBS)], - [(test x$all = xtrue || test x$jpeg = xtrue) && echo "Please install jpeg library" && exit]) -AM_CONDITIONAL(USE_JPEG, (test x$all = xtrue || test x$jpeg = xtrue)) - -AC_ARG_ENABLE(u3d, -[ --enable-u3d Turn on u3d functions], -[case "${enableval}" in - yes) u3d=true ;; - no) u3d=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-u3d) ;; -esac],[u3d=false]) -AC_ARG_ENABLE(pdf, -[ --enable-pdf Turn on u3d and pdf functions], -[case "${enableval}" in - yes) pdf=true; u3d=true ;; - no) pdf=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-pdf) ;; -esac],[pdf=false]) -AS_IF([test "x$pdf" == xtrue], - [AC_CHECK_LIB([hpdf], [main], - [], - [AC_MSG_FAILURE( - [--enable-pdf was given, but test for libharu failed])] - )]) -AS_IF([test "x$pdf" == xtrue], - [AC_CHECK_HEADERS([hpdf.h], [], - [AC_MSG_FAILURE( - [--enable-pdf was given, but test for headers failed])] - )]) -AM_CONDITIONAL(USE_PDF, test x$pdf = xtrue) - -AS_IF([test "x$u3d" == xtrue], - [AC_CHECK_LIB([IDTF], [main], - [AC_SUBST([U3D_LIBS], ["-lIDTF -lm -ldl"]) - AC_DEFINE([HAVE_U3D], [1], - [Define if you have libIDTF]) - ], - [AC_MSG_FAILURE( - [--enable-u3d was given, but test for libIDTF failed])], - [-lm -ldl])]) -AS_IF([test "x$u3d" == xtrue], - [AC_CHECK_HEADERS([u3d/SceneConverterLib.h], [], - [AC_MSG_FAILURE( - [--enable-u3d was given, but test for headers failed])] - )]) -AM_CONDITIONAL(USE_U3D, test x$u3d = xtrue) - -AC_ARG_ENABLE(fltk, -[ --enable-fltk Turn on fltk], -[case "${enableval}" in - yes) fltk=true ;; - no) fltk=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-fltk) ;; -esac],[fltk=false]) -if (test x$all = xtrue || test x$fltk = xtrue) ;then - FLTK_PROG=fltk-config - AC_CHECK_PROG(FLTK_FLAGS,$FLTK_PROG,`$FLTK_PROG --cxxflags`) - AC_CHECK_PROG(FLTK_LIBS,$FLTK_PROG,`$FLTK_PROG --ldflags`) - if test "$FLTK_FLAGS" && test "$FLTK_LIBS" ;then - test_fltk=true - else - echo "Please install FLTK headers and libraries and make sure that \ - path to $FLTK_PROG exist in your PATH" - exit - fi -fi -AM_CONDITIONAL(USE_FLTK, test x$test_fltk = xtrue) - -AC_ARG_ENABLE(qt, -[ --enable-qt Turn on Qt], -[case "${enableval}" in - yes) qt=true ;; - no) qt=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt) ;; -esac],[qt=false]) -if (test x$all = xtrue || test x$qt = xtrue) ;then - AT_WITH_QT - AT_REQUIRE_QT_VERSION(4.3) - test_qt=true -fi -AM_CONDITIONAL(USE_QT, test x$test_qt = xtrue) - -AC_ARG_ENABLE(python, -[ --enable-python Turn on interface to python], -[case "${enableval}" in - yes) python=true ;; - no) python=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;; -esac],[python=false]) -if (test x$langall = xtrue || test x$python = xtrue) ;then - AC_CHECK_PROG(PYTHON_HEADERS,python-config,`python-config --cflags`) - AC_CHECK_PROG(HAVE_SWIG,swig$EXEEXT,true) - if (test "$PYTHON_HEADERS" && test "$HAVE_SWIG") ;then - test_python=true - AM_PATH_PYTHON() - else - echo Please install python-dev and swig packages - exit - fi -fi -AM_CONDITIONAL(USE_PYTHON, test x$test_python = xtrue ) - -AC_ARG_ENABLE(octave, -[ --enable-octave Turn on interface to octave], -[case "${enableval}" in - yes) octave=true ;; - no) octave=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-octave) ;; -esac],[octave=false]) -if (test x$langall = xtrue || test x$octave = xtrue) ;then - AC_CHECK_PROG([OCTAVE],[octave-config],[octave-config]) -# find Octave arch - AC_MSG_CHECKING([for Octave arch]) - OCTAVE_ARCH=`$OCTAVE -p CANONICAL_HOST_TYPE`-`$OCTAVE -p API_VERSION` - OCTAVE_INCFLAGS="-I`$OCTAVE -p OCTINCLUDEDIR`" - AC_MSG_RESULT([$OCTAVE_ARCH]) - AC_SUBST(OCTAVE_ARCH,[$OCTAVE_ARCH]) - AC_SUBST(OCTAVE_INCFLAGS,[$OCTAVE_INCFLAGS]) - test_octave=true -fi -AM_CONDITIONAL(USE_OCTAVE, test x$test_octave = xtrue ) - -AM_CXXFLAGS="$AM_CXXFLAGS -Wall $GSL_FLAGS" -AC_SUBST(AM_CXXFLAGS) - -AC_CONFIG_FILES([ -Makefile -src/Makefile -include/Makefile -widgets/Makefile -lang/Makefile -utils/Makefile -examples/Makefile -]) -AC_OUTPUT - diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index b9b65cc..d50216a 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -39,7 +39,7 @@ endif(MGL_HAVE_WX) if(MGL_HAVE_QT) include(${QT_USE_FILE}) - qt_wrap_cpp(mgl_qt_example MGL_MOC_EX_FILES ../include/mgl/qt.h) + qt_wrap_cpp(mgl_qt_example MGL_MOC_EX_FILES ../include/mgl2/qt.h) add_executable(mgl_qt_example wnd_samples.cpp qt_example.cpp ${MGL_MOC_EX_FILES}) target_link_libraries(mgl_qt_example mgl-wnd ${QT_LIBRARIES}) install( diff --git a/examples/Makefile.am b/examples/Makefile.am deleted file mode 100644 index 9d1485e..0000000 --- a/examples/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -AM_CXXFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include - -check_PROGRAMS = -bin_PROGRAMS = mgl_example -mgl_example_SOURCES = wnd_samples.cpp full_test.cpp -mgl_example_LDADD = $(top_builddir)/src/libmgl.la - -if USE_FLTK -bin_PROGRAMS += mgl_fltk_example -mgl_fltk_example_SOURCES = wnd_samples.cpp fltk_example.cpp -mgl_fltk_example_LDADD = $(FLTK_LIBS) $(top_builddir)/widgets/libmgl-wnd.la $(top_builddir)/src/libmgl.la -mgl_fltk_example_CXXFLAGS = $(FLTK_FLAGS) $(AM_CXXFLAGS) - -check_PROGRAMS += test -test_SOURCES = wnd_samples.cpp main.cpp -test_LDADD = $(FLTK_LIBS) $(top_builddir)/widgets/libmgl-wnd.la $(top_builddir)/src/libmgl.la -test_CXXFLAGS = $(FLTK_FLAGS) $(AM_CXXFLAGS) -endif - -#if USE_GLUT -#bin_PROGRAMS += mgl_glut_example -#mgl_glut_example_SOURCES = wnd_samples.cpp glut_example.cpp -#mgl_glut_example_LDADD = $(top_builddir)/widgets/libmgl-wnd.la $(top_builddir)/src/libmgl.la -#endif - -#if USE_WX -#bin_PROGRAMS += mgl_wx_example -#mgl_wx_example_LDADD = $(WX_LIBS) $(top_builddir)/widgets/libmgl-wnd.la $(top_builddir)/src/libmgl.la -#mgl_wx_example_CXXFLAGS = $(WX_FLAGS) $(AM_CXXFLAGS) -#mgl_wx_example_SOURCES = wnd_samples.cpp wx_example.cpp -#endif - -if USE_QT -include $(top_srcdir)/config/autotroll.mk -ACLOCAL_AMFLAGS = -I $(top_srcdir)/config/ - -bin_PROGRAMS += mgl_qt_example -mgl_qt_example_SOURCES = wnd_samples.cpp $(top_builddir)/include/mgl/qt.moc.cpp $(top_srcdir)/include/mgl/qt.h qt_example.cpp -mgl_qt_example_LDADD = $(QT_LIBS) $(top_builddir)/widgets/libmgl-wnd.la $(top_builddir)/src/libmgl.la -mgl_qt_example_LDFLAGS = $(QT_LDFLAGS) -mgl_qt_example_CPPFLAGS = $(QT_CPPFLAGS) $(AM_CPPFLAGS) -mgl_qt_example_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS) - -BUILT_SOURCES = $(top_builddir)/include/mgl/qt.moc.cpp -CLEANFILES = $(BUILT_SOURCES) -endif diff --git a/examples/fltk_example.cpp b/examples/fltk_example.cpp index 1f9d66a..0469d35 100644 --- a/examples/fltk_example.cpp +++ b/examples/fltk_example.cpp @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include -#include "mgl/mgl.h" -#include "mgl/fltk.h" +#include "mgl2/mgl.h" +#include "mgl2/fltk.h" //----------------------------------------------------------------------------- int test_wnd(mglGraph *gr); int sample(mglGraph *gr); diff --git a/examples/full_test.cpp b/examples/full_test.cpp index 04c7908..083569d 100644 --- a/examples/full_test.cpp +++ b/examples/full_test.cpp @@ -25,10 +25,8 @@ #include #include #include -#include "mgl/mgl.h" -#include "mgl/eval.h" -//#include -//#include "mgl/parser.h" +#include "mgl2/mgl.h" +#include "mgl2/eval.h" //----------------------------------------------------------------------------- void mgls_prepare1d(mglData *y, mglData *y1=0, mglData *y2=0, mglData *x1=0, mglData *x2=0); void mgls_prepare2d(mglData *a, mglData *b=0, mglData *v=0); @@ -1966,7 +1964,7 @@ void save(mglGraph *gr,const char *name,const char *suf="") int main(int argc,char **argv) { const char *suf = ""; - char name[256]=""; + char name[256]="", *tmp; int ch; // mglGraphIDTF u3d; mglGraph *gr = NULL; @@ -1977,7 +1975,8 @@ int main(int argc,char **argv) case 0: break; case 'w': width =atoi(optarg); break; case 'h': height=atoi(optarg); break; - case 'k': strcpy(name, optarg); break; + case 'k': strcpy(name, optarg); tmp=strchr(name,'.'); + if(tmp) *tmp=0; break; case 't': mglNumThr=atoi(optarg); break; case 'l': while(s->name[0]) { printf("%s ",s->name); s++; } diff --git a/examples/glut_example.cpp b/examples/glut_example.cpp index b4d6c97..91a54b7 100644 --- a/examples/glut_example.cpp +++ b/examples/glut_example.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include -#include "mgl/glut.h" +#include "mgl2/glut.h" //----------------------------------------------------------------------------- int test_wnd(mglGraph *gr); int sample(mglGraph *gr); diff --git a/examples/qt_example.cpp b/examples/qt_example.cpp index 84abfb7..fa0dcf7 100644 --- a/examples/qt_example.cpp +++ b/examples/qt_example.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include -#include "mgl/window.h" +#include "mgl2/window.h" //----------------------------------------------------------------------------- int test_wnd(mglGraph *gr); int sample(mglGraph *gr); diff --git a/examples/wnd_samples.cpp b/examples/wnd_samples.cpp index 97d0024..be1c4ae 100644 --- a/examples/wnd_samples.cpp +++ b/examples/wnd_samples.cpp @@ -22,8 +22,8 @@ #include #include //----------------------------------------------------------------------------- -#include "mgl/mgl.h" -#include "mgl/parser.h" +#include "mgl2/mgl.h" +#include "mgl2/parser.h" //----------------------------------------------------------------------------- void mgls_prepare1d(mglData *y, mglData *y1=0, mglData *y2=0, mglData *x1=0, mglData *x2=0); void mgls_prepare2d(mglData *a, mglData *b=0, mglData *v=0); diff --git a/examples/wx_example.cpp b/examples/wx_example.cpp index 59ded2c..7664c57 100644 --- a/examples/wx_example.cpp +++ b/examples/wx_example.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include -#include "mgl/wx.h" +#include "mgl2/wx.h" //----------------------------------------------------------------------------- #ifdef ENABLE_MGLGRAPHWX int test(mglGraph *gr, void *); diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 05f578e..08b063a 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,7 +1,7 @@ -configure_file(${MathGL_SOURCE_DIR}/include/config.h.in ${MathGL_BINARY_DIR}/include/mgl/config.h) +configure_file(${MathGL_SOURCE_DIR}/include/config.h.in ${MathGL_BINARY_DIR}/include/mgl2/config.h) -set(MGL_INCLUDE_PATH "${CMAKE_INSTALL_PREFIX}/include/mgl") -install(DIRECTORY mgl/ DESTINATION ${MGL_INCLUDE_PATH} +set(MGL_INCLUDE_PATH "${CMAKE_INSTALL_PREFIX}/include/mgl2") +install(DIRECTORY mgl2/ DESTINATION ${MGL_INCLUDE_PATH} PATTERN ".svn" EXCLUDE PATTERN "fltk.h" EXCLUDE PATTERN "glut.h" EXCLUDE @@ -12,16 +12,16 @@ install(DIRECTORY mgl/ DESTINATION ${MGL_INCLUDE_PATH} PATTERN "*.pas" PATTERN "*.h") -install(FILES ${MathGL_BINARY_DIR}/include/mgl/config.h DESTINATION ${MGL_INCLUDE_PATH}) +install(FILES ${MathGL_BINARY_DIR}/include/mgl2/config.h DESTINATION ${MGL_INCLUDE_PATH}) if(MGL_HAVE_FLTK) - install(FILES mgl/fltk.h DESTINATION ${MGL_INCLUDE_PATH}) + install(FILES mgl2/fltk.h DESTINATION ${MGL_INCLUDE_PATH}) endif(MGL_HAVE_FLTK) if(MGL_HAVE_GLUT) - install(FILES mgl/glut.h DESTINATION ${MGL_INCLUDE_PATH}) + install(FILES mgl2/glut.h DESTINATION ${MGL_INCLUDE_PATH}) endif(MGL_HAVE_GLUT) if(MGL_HAVE_WX) - install(FILES mgl/wx.h DESTINATION ${MGL_INCLUDE_PATH}) + install(FILES mgl2/wx.h DESTINATION ${MGL_INCLUDE_PATH}) endif(MGL_HAVE_WX) if(MGL_HAVE_QT) - install(FILES mgl/qt.h DESTINATION ${MGL_INCLUDE_PATH}) + install(FILES mgl2/qt.h DESTINATION ${MGL_INCLUDE_PATH}) endif(MGL_HAVE_QT) diff --git a/include/Makefile.am b/include/Makefile.am deleted file mode 100644 index 0d232e0..0000000 --- a/include/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -if USE_FLTK -FLTK_INC = mgl/fltk.h -endif -if USE_QT -QT_INC = mgl/qt.h -endif - -nobase_include_HEADERS = $(FLTK_INC) $(QT_INC) \ -mgl/base_cf.h mgl/opengl.h mgl/config.h mgl/data.h \ -mgl/fit.h mgl/plot.h mgl/vect.h \ -mgl/base.h mgl/canvas.h mgl/define.h mgl/font.h mgl/mgl.h \ -mgl/other.h mgl/prim.h mgl/volume.h \ -mgl/canvas_cf.h mgl/cont.h mgl/eval.h mgl/mgl_cf.h \ -mgl/parser.h mgl/surf.h mgl/window.h diff --git a/include/mgl/config.h.in b/include/mgl/config.h.in deleted file mode 100644 index 217c5a8..0000000 --- a/include/mgl/config.h.in +++ /dev/null @@ -1,77 +0,0 @@ -/* include/mgl/config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_HPDF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `hpdf' library (-lhpdf). */ -#undef HAVE_LIBHPDF - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define if you have libIDTF */ -#undef HAVE_U3D - -/* Define to 1 if you have the header file. */ -#undef HAVE_U3D_SCENECONVERTERLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* This define enables double precision in MathGL */ -#undef MGL_USE_DOUBLE - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION diff --git a/include/mgl/addon.h b/include/mgl2/addon.h similarity index 100% rename from include/mgl/addon.h rename to include/mgl2/addon.h diff --git a/include/mgl/base.h b/include/mgl2/base.h similarity index 96% rename from include/mgl/base.h rename to include/mgl2/base.h index c5d3de1..ba42576 100644 --- a/include/mgl/base.h +++ b/include/mgl2/base.h @@ -26,14 +26,14 @@ #ifndef _MSC_VER #include #endif -#include "mgl/define.h" +#include "mgl2/define.h" /*****************************************************************************/ #ifdef __cplusplus #include #include -#include "mgl/type.h" -#include "mgl/eval.h" -#include "mgl/font.h" +#include "mgl2/type.h" +#include "mgl2/eval.h" +#include "mgl2/font.h" //----------------------------------------------------------------------------- /// Abstract class for data array class mglDataA @@ -146,7 +146,8 @@ struct mglTexture void Clear() { n=0; } void Set(const char *cols, int smooth=0,float alpha=1); void GetC(float u,float v,mglPnt &p) const; - bool IsSame(const mglTexture &t) const; + inline bool IsSame(const mglTexture &t) const + { return n==t.n && !memcmp(col,t.col,512*sizeof(mglColor)); } void GetRGBA(unsigned char *f) const; // Write as BGRA for fastest export to TGA }; //----------------------------------------------------------------------------- @@ -162,7 +163,7 @@ struct mglColorID char id; mglColor col; }; -extern mglColorID mglColorIds[]; +extern mglColorID mglColorIds[31]; //----------------------------------------------------------------------------- /// Base class for canvas which handle all basic drawing class mglBase diff --git a/include/mgl/base_cf.h b/include/mgl2/base_cf.h similarity index 94% rename from include/mgl/base_cf.h rename to include/mgl2/base_cf.h index d3383d2..e6dfd21 100644 --- a/include/mgl/base_cf.h +++ b/include/mgl2/base_cf.h @@ -19,7 +19,7 @@ ***************************************************************************/ #ifndef _MGL_BASE_CF_H_ #define _MGL_BASE_CF_H_ -#include "mgl/base.h" +#include "mgl2/base.h" /*****************************************************************************/ #ifdef __cplusplus extern "C" { @@ -69,7 +69,11 @@ void mgl_set_rotated_text(HMGL graph, int enable); void mgl_load_font(HMGL gr, const char *name, const char *path); void mgl_copy_font(HMGL gr, HMGL gr_from); void mgl_restore_font(HMGL gr); +void mgl_set_color(char id, float r, float g, float b); +void mgl_set_def_sch(HMGL gr, const char *sch); /*****************************************************************************/ +void mgl_set_def_sch_(uintptr_t *gr, const char *sch,int); +void mgl_set_color_(char *id, float *r, float *g, float *b, int); int mgl_get_warn_(uintptr_t *gr); void mgl_set_warn_(uintptr_t *gr, int *code, const char *text,int); long mgl_use_graph_(uintptr_t *gr, int *inc); diff --git a/include/mgl/canvas.h b/include/mgl2/canvas.h similarity index 97% rename from include/mgl/canvas.h rename to include/mgl2/canvas.h index 6b15c6d..ee7a7f6 100644 --- a/include/mgl/canvas.h +++ b/include/mgl2/canvas.h @@ -19,7 +19,7 @@ ***************************************************************************/ #ifndef MGL_CANVAS_H #define MGL_CANVAS_H -#include "mgl/base.h" +#include "mgl2/base.h" //----------------------------------------------------------------------------- #ifndef MGL_STACK_ENTRY #define MGL_STACK_ENTRY 10 diff --git a/include/mgl/canvas_cf.h b/include/mgl2/canvas_cf.h similarity index 98% rename from include/mgl/canvas_cf.h rename to include/mgl2/canvas_cf.h index 8e80506..9585aad 100644 --- a/include/mgl/canvas_cf.h +++ b/include/mgl2/canvas_cf.h @@ -19,7 +19,7 @@ ***************************************************************************/ #ifndef MGL_CANVAS_CF_H #define MGL_CANVAS_CF_H -#include "mgl/base.h" +#include "mgl2/base.h" /*****************************************************************************/ #ifdef __cplusplus extern "C" { diff --git a/include/mgl/canvas_wnd.h b/include/mgl2/canvas_wnd.h similarity index 97% rename from include/mgl/canvas_wnd.h rename to include/mgl2/canvas_wnd.h index 34bf90c..e7b41e4 100644 --- a/include/mgl/canvas_wnd.h +++ b/include/mgl2/canvas_wnd.h @@ -21,7 +21,7 @@ #ifndef _MGL_CANVAS_WND_H_ #define _MGL_CANVAS_WND_H_ /*****************************************************************************/ -#include "mgl/window.h" +#include "mgl2/window.h" //----------------------------------------------------------------------------- /// Base class for windows containing MathGL graphics class mglCanvasWnd : public mglCanvas diff --git a/include/mgl/cont.h b/include/mgl2/cont.h similarity index 98% rename from include/mgl/cont.h rename to include/mgl2/cont.h index 0dc20ab..10250da 100644 --- a/include/mgl/cont.h +++ b/include/mgl2/cont.h @@ -19,7 +19,7 @@ ***************************************************************************/ #ifndef _MGL_CONT_H_ #define _MGL_CONT_H_ -#include "mgl/base.h" +#include "mgl2/base.h" /*****************************************************************************/ #ifdef __cplusplus extern "C" { diff --git a/include/mgl/data.h b/include/mgl2/data.h similarity index 98% rename from include/mgl/data.h rename to include/mgl2/data.h index 824fdf4..f1b35a3 100644 --- a/include/mgl/data.h +++ b/include/mgl2/data.h @@ -20,8 +20,8 @@ #ifndef _MGL_DATA_H_ #define _MGL_DATA_H_ /*****************************************************************************/ -#include "mgl/base.h" -#include "mgl/data_cf.h" +#include "mgl2/base.h" +#include "mgl2/data_cf.h" #ifdef __cplusplus //----------------------------------------------------------------------------- #include diff --git a/include/mgl/data_cf.h b/include/mgl2/data_cf.h similarity index 98% rename from include/mgl/data_cf.h rename to include/mgl2/data_cf.h index 3c6d6dd..fe3c1d8 100644 --- a/include/mgl/data_cf.h +++ b/include/mgl2/data_cf.h @@ -20,7 +20,7 @@ #ifndef _MGL_DATA_CF_H_ #define _MGL_DATA_CF_H_ /*****************************************************************************/ -#include "mgl/base.h" +#include "mgl2/base.h" /*****************************************************************************/ #if MGL_HAVE_GSL #include diff --git a/include/mgl/define.h b/include/mgl2/define.h similarity index 95% rename from include/mgl/define.h rename to include/mgl2/define.h index 4ce25bc..a0a3471 100644 --- a/include/mgl/define.h +++ b/include/mgl2/define.h @@ -60,11 +60,7 @@ const unsigned long mgl_nan[2] = {0xffffffff, 0x7fffffff}; //#define FLT_EPS 1.1920928955078125e-07 #define MGL_FLT_EPS (1.+1e-05) //----------------------------------------------------------------------------- -#ifndef isnan -#define isnan(a) ((a)!=(a)) -#endif -//----------------------------------------------------------------------------- -#include +#include "mgl2/config.h" //----------------------------------------------------------------------------- #if MGL_USE_DOUBLE typedef double mreal; @@ -94,6 +90,7 @@ typedef float mreal; //----------------------------------------------------------------------------- #define mgl_min(a,b) (((a)>(b)) ? (b) : (a)) #define mgl_max(a,b) (((a)>(b)) ? (a) : (b)) +#define mgl_isnan(a) ((a)!=(a)) //----------------------------------------------------------------------------- #define SMOOTH_NONE 0 #define SMOOTH_LINE_3 1 diff --git a/include/mgl/eval.h b/include/mgl2/eval.h similarity index 97% rename from include/mgl/eval.h rename to include/mgl2/eval.h index 988d112..7979613 100644 --- a/include/mgl/eval.h +++ b/include/mgl2/eval.h @@ -22,7 +22,7 @@ #define _MGL_EVAL_H_ //--------------------------------------------------------------------------- #include -#include "mgl/define.h" +#include "mgl2/define.h" /// types of errors #define MGL_ERR_LOG 1 #define MGL_ERR_ARC 2 diff --git a/include/mgl/evalc.h b/include/mgl2/evalc.h similarity index 93% rename from include/mgl/evalc.h rename to include/mgl2/evalc.h index 5b095c2..621e88a 100644 --- a/include/mgl/evalc.h +++ b/include/mgl2/evalc.h @@ -25,10 +25,10 @@ #ifndef dual #define dual std::complex ///< short name for complex numbers #endif -#include "mgl/eval.h" +#include "mgl2/eval.h" //--------------------------------------------------------------------------- /// Class for evaluating formula specified by the string -class mglFormulaC // îáúåêò äëÿ ââîäà è âû÷èñëåíèÿ ôîðìóë +class mglFormulaC // ������ ��� ����� � ���������� ������ { public: /// Evaluates the formula for 'x','r'=\a x, 'y','n'=\a y, 'z','t'=\a z, 'u'=\a u diff --git a/include/mgl/fit.h b/include/mgl2/fit.h similarity index 98% rename from include/mgl/fit.h rename to include/mgl2/fit.h index 1c7ba89..cd5ed0e 100644 --- a/include/mgl/fit.h +++ b/include/mgl2/fit.h @@ -19,7 +19,7 @@ ***************************************************************************/ #ifndef _MGL_FIT_H_ #define _MGL_FIT_H_ -#include "mgl/base.h" +#include "mgl2/base.h" /*****************************************************************************/ #ifdef __cplusplus extern "C" { diff --git a/include/mgl/fltk.h b/include/mgl2/fltk.h similarity index 96% rename from include/mgl/fltk.h rename to include/mgl2/fltk.h index d503ab3..dcbbbe7 100644 --- a/include/mgl/fltk.h +++ b/include/mgl2/fltk.h @@ -22,7 +22,7 @@ #define _MGL_FLTK_H_ /*****************************************************************************/ #ifdef __cplusplus -#include "mgl/canvas_wnd.h" +#include "mgl2/canvas_wnd.h" #if MGL_HAVE_FLTK //----------------------------------------------------------------------------- #ifdef __MWERKS__ @@ -75,6 +75,9 @@ public: /// Set popup menu pointer inline void set_popup(const Fl_Menu_Item *pmenu, Fl_Widget *wdg, void *v) { popup = pmenu; wpar = wdg; vpar = v; } + inline void zoom_region(float xx1,float xx2,float yy1, float yy2) + { x1=xx1; y1=yy1; x2=xx2; y2=yy2; } + protected: mglCanvas *gr; ///< pointer to grapher void *draw_par; ///< Parameters for drawing function mglCanvasWnd::DrawFunc. diff --git a/include/mgl/font.h b/include/mgl2/font.h similarity index 97% rename from include/mgl/font.h rename to include/mgl2/font.h index 0335616..a095db5 100644 --- a/include/mgl/font.h +++ b/include/mgl2/font.h @@ -22,7 +22,7 @@ #define _MGL_FONT_H_ #include -#include "mgl/define.h" +#include "mgl2/define.h" //----------------------------------------------------------------------------- #define MGL_FONT_BOLD 0x01000000 // This value is used binary #define MGL_FONT_ITAL 0x02000000 // This value is used binary diff --git a/include/mgl/glut.h b/include/mgl2/glut.h similarity index 95% rename from include/mgl/glut.h rename to include/mgl2/glut.h index 8060c50..5b48f32 100644 --- a/include/mgl/glut.h +++ b/include/mgl2/glut.h @@ -21,8 +21,8 @@ #ifndef _MGL_GLUT_H_ #define _MGL_GLUT_H_ #ifdef __cplusplus -#include "mgl/opengl.h" -#include "mgl/window.h" +#include "mgl2/opengl.h" +#include "mgl2/window.h" //----------------------------------------------------------------------------- extern "C" { #endif @@ -46,7 +46,7 @@ public: mglCanvasGLUT(int (*draw)(mglGraph *gr, void *p), const char *title, void *par=NULL, void (*reload)(int next, void *p)=NULL, bool maximize=false); virtual ~mglCanvasGLUT(); - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ñëóæåáíûå ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ��������� ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /// Create a window for plotting. Now implemeted only for GLUT. void Window(int argc, char **argv, int (*draw)(mglBase *gr, void *p), const char *title,void *par=NULL, diff --git a/include/mgl/mgl.h b/include/mgl2/mgl.h similarity index 98% rename from include/mgl/mgl.h rename to include/mgl2/mgl.h index 9546296..2f1434c 100644 --- a/include/mgl/mgl.h +++ b/include/mgl2/mgl.h @@ -20,11 +20,11 @@ #ifndef _MGL_H_ #define _MGL_H_ -#include "mgl/define.h" -#include "mgl/mgl_cf.h" -#include "mgl/data.h" +#include "mgl2/define.h" +#include "mgl2/mgl_cf.h" +#include "mgl2/data.h" #ifndef NO_OPENGL -#include "mgl/opengl.h" +#include "mgl2/opengl.h" #endif //----------------------------------------------------------------------------- /// Wrapper class for all graphics @@ -117,6 +117,8 @@ public: /// Set default palette inline void SetPalette(const char *colors) { mgl_set_palette(gr, colors); } + /// Set default color scheme + inline void SetDefScheme(const char *sch) { mgl_set_def_sch(gr, sch); } /// Get last warning code inline int GetWarn() { return mgl_get_warn(gr);} diff --git a/include/mgl/mgl_cf.h b/include/mgl2/mgl_cf.h similarity index 83% rename from include/mgl/mgl_cf.h rename to include/mgl2/mgl_cf.h index 98cf231..768a973 100644 --- a/include/mgl/mgl_cf.h +++ b/include/mgl2/mgl_cf.h @@ -20,17 +20,17 @@ #ifndef _MGL_CF_H_ #define _MGL_CF_H_ /*****************************************************************************/ -#include "mgl/base_cf.h" -#include "mgl/data_cf.h" -#include "mgl/cont.h" -#include "mgl/fit.h" -#include "mgl/plot.h" -#include "mgl/surf.h" -#include "mgl/volume.h" -#include "mgl/vect.h" -#include "mgl/prim.h" -#include "mgl/other.h" -#include "mgl/canvas_cf.h" -#include "mgl/addon.h" +#include "mgl2/base_cf.h" +#include "mgl2/data_cf.h" +#include "mgl2/cont.h" +#include "mgl2/fit.h" +#include "mgl2/plot.h" +#include "mgl2/surf.h" +#include "mgl2/volume.h" +#include "mgl2/vect.h" +#include "mgl2/prim.h" +#include "mgl2/other.h" +#include "mgl2/canvas_cf.h" +#include "mgl2/addon.h" /*****************************************************************************/ #endif diff --git a/include/mgl/opengl.h b/include/mgl2/opengl.h similarity index 96% rename from include/mgl/opengl.h rename to include/mgl2/opengl.h index 241c6c9..fcb7624 100644 --- a/include/mgl/opengl.h +++ b/include/mgl2/opengl.h @@ -21,7 +21,7 @@ #define MGL_CANVAS_GL_H /*****************************************************************************/ #ifdef __cplusplus -#include "mgl/canvas.h" +#include "mgl2/canvas.h" class mglCanvasGL : public mglCanvas { diff --git a/include/mgl/other.h b/include/mgl2/other.h similarity index 98% rename from include/mgl/other.h rename to include/mgl2/other.h index 1024609..835379e 100644 --- a/include/mgl/other.h +++ b/include/mgl2/other.h @@ -19,7 +19,7 @@ ***************************************************************************/ #ifndef _MGL_OTHER_H_ #define _MGL_OTHER_H_ -#include "mgl/base.h" +#include "mgl2/base.h" /*****************************************************************************/ #ifdef __cplusplus extern "C" { diff --git a/include/mgl/parser.h b/include/mgl2/parser.h similarity index 97% rename from include/mgl/parser.h rename to include/mgl2/parser.h index fae19c6..efcb7c0 100644 --- a/include/mgl/parser.h +++ b/include/mgl2/parser.h @@ -21,7 +21,7 @@ #define _MGL_PARSER_H_ #ifdef __cplusplus -#include "mgl/mgl.h" +#include "mgl2/mgl.h" #include //----------------------------------------------------------------------------- /// Structure for the command argument. diff --git a/include/mgl/plot.h b/include/mgl2/plot.h similarity index 98% rename from include/mgl/plot.h rename to include/mgl2/plot.h index 4c3fbef..593b082 100644 --- a/include/mgl/plot.h +++ b/include/mgl2/plot.h @@ -19,7 +19,7 @@ ***************************************************************************/ #ifndef _MGL_1D_H_ #define _MGL_1D_H_ -#include "mgl/base.h" +#include "mgl2/base.h" /*****************************************************************************/ #ifdef __cplusplus extern "C" { diff --git a/include/mgl/prim.h b/include/mgl2/prim.h similarity index 98% rename from include/mgl/prim.h rename to include/mgl2/prim.h index f27180a..848d28f 100644 --- a/include/mgl/prim.h +++ b/include/mgl2/prim.h @@ -19,7 +19,7 @@ ***************************************************************************/ #ifndef _MGL_PRIM_H_ #define _MGL_PRIM_H_ -#include "mgl/base.h" +#include "mgl2/base.h" /*****************************************************************************/ #ifdef __cplusplus extern "C" { diff --git a/include/mgl/qt.h b/include/mgl2/qt.h similarity index 96% rename from include/mgl/qt.h rename to include/mgl2/qt.h index 08f7bcb..7fbcae6 100644 --- a/include/mgl/qt.h +++ b/include/mgl2/qt.h @@ -22,7 +22,7 @@ /*****************************************************************************/ #ifdef __cplusplus //----------------------------------------------------------------------------- -#include "mgl/canvas_wnd.h" +#include "mgl2/canvas_wnd.h" #if MGL_HAVE_QT #include #include @@ -59,6 +59,8 @@ public: { draw = dr; } inline void setDraw(int (*draw)(mglGraph *gr)) { setDraw(mgl_draw_graph,(void*)draw); } + inline void zoomRegion(float xx1,float xx2,float yy1, float yy2) + { x1=xx1; y1=yy1; x2=xx2; y2=yy2; } int getPer() {return int(per);}; ///< Get perspective value int getPhi() {return int(phi);}; ///< Get Phi-angle value diff --git a/include/mgl/surf.h b/include/mgl2/surf.h similarity index 98% rename from include/mgl/surf.h rename to include/mgl2/surf.h index e810964..5565009 100644 --- a/include/mgl/surf.h +++ b/include/mgl2/surf.h @@ -19,7 +19,7 @@ ***************************************************************************/ #ifndef _MGL_SURF_H_ #define _MGL_SURF_H_ -#include "mgl/base.h" +#include "mgl2/base.h" /*****************************************************************************/ #ifdef __cplusplus extern "C" { diff --git a/include/mgl/type.h b/include/mgl2/type.h similarity index 99% rename from include/mgl/type.h rename to include/mgl2/type.h index 88c1ce9..d598b0f 100644 --- a/include/mgl/type.h +++ b/include/mgl2/type.h @@ -23,7 +23,7 @@ #ifndef _MSC_VER #include #endif -#include "mgl/define.h" +#include "mgl2/define.h" //----------------------------------------------------------------------------- const mreal Pi = M_PI; const mreal NaN = NAN; diff --git a/include/mgl/vect.h b/include/mgl2/vect.h similarity index 98% rename from include/mgl/vect.h rename to include/mgl2/vect.h index 878d75c..1821e08 100644 --- a/include/mgl/vect.h +++ b/include/mgl2/vect.h @@ -19,7 +19,7 @@ ***************************************************************************/ #ifndef _MGL_VECT_H_ #define _MGL_VECT_H_ -#include "mgl/base.h" +#include "mgl2/base.h" /*****************************************************************************/ #ifdef __cplusplus extern "C" { diff --git a/include/mgl/volume.h b/include/mgl2/volume.h similarity index 98% rename from include/mgl/volume.h rename to include/mgl2/volume.h index 6f69ac3..78e7fa4 100644 --- a/include/mgl/volume.h +++ b/include/mgl2/volume.h @@ -19,7 +19,7 @@ ***************************************************************************/ #ifndef _MGL_VOL_H_ #define _MGL_VOL_H_ -#include "mgl/base.h" +#include "mgl2/base.h" /*****************************************************************************/ #ifdef __cplusplus extern "C" { diff --git a/include/mgl/window.h b/include/mgl2/window.h similarity index 97% rename from include/mgl/window.h rename to include/mgl2/window.h index ba1d3f9..504f179 100644 --- a/include/mgl/window.h +++ b/include/mgl2/window.h @@ -21,7 +21,7 @@ #ifndef _MGL_WINDOW_H_ #define _MGL_WINDOW_H_ /*****************************************************************************/ -#include "mgl/mgl.h" +#include "mgl2/mgl.h" //----------------------------------------------------------------------------- /// Class for drawing in windows (like, mglCanvasFL, mglCanvasQT and so on) /// Make inherited class and redefine Draw() function if you don't want to use function pointers. diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt index 6b0617b..d6467f0 100644 --- a/lang/CMakeLists.txt +++ b/lang/CMakeLists.txt @@ -1,40 +1,94 @@ -if(MGL_HAVE_PYTHON) - configure_file(${MathGL_SOURCE_DIR}/lang/mgl.i.in ${MathGL_BINARY_DIR}/lang/mgl.i COPYONLY) - configure_file(${MathGL_SOURCE_DIR}/lang/numpy.i.in ${MathGL_BINARY_DIR}/lang/numpy.i COPYONLY) - SET(dep_libs mgl) -# if(MGL_HAVE_FLTK) - get_property(path_to_mglwnd TARGET mgl-wnd PROPERTY LOCATION) - file(TO_NATIVE_PATH ${path_to_mglwnd} MGL_LIB_WND) - SET(dep_libs ${dep_libs} mgl-wnd) -# endif(MGL_HAVE_FLTK) - get_property(path_to_mgl TARGET mgl PROPERTY LOCATION) - file(TO_NATIVE_PATH ${path_to_mgl} MGL_LIB) - file(TO_NATIVE_PATH ${MathGL_BINARY_DIR}/lang/mgl.i MGL_I) - file(TO_NATIVE_PATH ${MathGL_SOURCE_DIR}/include SRC_INC) - file(TO_NATIVE_PATH ${MathGL_BINARY_DIR}/include BIN_INC) - configure_file(${MathGL_SOURCE_DIR}/lang/setup.py.in ${MathGL_BINARY_DIR}/lang/setup.py) -# file(COPY ${CMAKE_SOURCE_DIR}/lang/mgl.i ${CMAKE_SOURCE_DIR}/lang/numpy.i DESTINATION ${CMAKE_BINARY_DIR}/lang) -# INCLUDE(${SWIG_USE_FILE}) -# INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) -# INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -# SET(CMAKE_SWIG_FLAGS "-c++") -# SET_SOURCE_FILES_PROPERTIES(mgl.i PROPERTIES CPLUSPLUS ON) -# SWIG_ADD_MODULE(mathgl python mgl.i ../include/mgl/type.h ../include/mgl/data.h ../include/mgl/mgl.h) -# SWIG_LINK_LIBRARIES(mathgl ${PYTHON_LIBRARIES}) +set(src_dep +${CMAKE_BINARY_DIR}/lang/mgl.i +${CMAKE_BINARY_DIR}/lang/numpy.i +) +set(src_imp_dep +${CMAKE_SOURCE_DIR}/include/mgl2/type.h +${CMAKE_SOURCE_DIR}/include/mgl2/data.h +${CMAKE_SOURCE_DIR}/include/mgl2/mgl.h +${CMAKE_SOURCE_DIR}/include/mgl2/window.h +) +configure_file(${MathGL_SOURCE_DIR}/lang/mgl.i.in ${MathGL_BINARY_DIR}/lang/mgl.i COPYONLY) +configure_file(${MathGL_SOURCE_DIR}/lang/numpy.i.in ${MathGL_BINARY_DIR}/lang/numpy.i COPYONLY) +file(TO_NATIVE_PATH ${MathGL_BINARY_DIR}/lang/mgl.i MGL_I) +file(TO_NATIVE_PATH ${MathGL_SOURCE_DIR}/include SRC_INC) +file(TO_NATIVE_PATH ${MathGL_BINARY_DIR}/include BIN_INC) -# add_custom_command(OUTPUT mgl_python.cpp mathgl.py -# COMMAND ${SWIG_EXECUTABLE} -python -c++ -I${CMAKE_SOURCE_DIR}/include -o mgl_python.cpp ${CMAKE_SOURCE_DIR}/lang/mgl.i -# MAIN_DEPENDENCY mgl.i -# IMPLICIT_DEPENDS CXX ../include/mgl/type.h ../include/mgl/data.h ../include/mgl/mgl.h -# ) +file(TO_NATIVE_PATH ${MathGL_BINARY_DIR}/src MGL_LINK_DIR) +file(TO_NATIVE_PATH ${MathGL_BINARY_DIR}/widgets MGL_WND_LINK_DIR) + +get_directory_property(DEF_LIST COMPILE_DEFINITIONS) +foreach(def_i ${DEF_LIST}) + if(MGL_DEF) + set(MGL_DEF ${MGL_DEF} -D${def_i}) + else(MGL_DEF) + set(MGL_DEF -D${def_i}) + endif(MGL_DEF) +endforeach() +SET(dep_libs mgl-wnd mgl) +if(MGL_HAVE_PYTHON) + configure_file(${MathGL_SOURCE_DIR}/lang/setup.py.in ${MathGL_BINARY_DIR}/lang/setup.py) add_custom_command(OUTPUT _mathgl.so mathgl.py - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/lang/setup.py build - DEPENDS ${dep_libs} ${CMAKE_BINARY_DIR}/lang/mgl.i ${CMAKE_BINARY_DIR}/lang/numpy.i - IMPLICIT_DEPENDS CXX ${CMAKE_SOURCE_DIR}/include/mgl/type.h ${CMAKE_SOURCE_DIR}/include/mgl/data.h ${CMAKE_SOURCE_DIR}/include/mgl/mgl.h ${CMAKE_SOURCE_DIR}/include/mgl/window.h - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/lang - ) + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/lang/setup.py + build build_ext + --include-dirs='${BIN_INC}:${SRC_INC}' +# --library-dirs='$:$' #commented out for compatibilty reason with old cmake + --library-dirs='${MGL_LINK_DIR}:${MGL_WND_LINK_DIR}' +# --libraries='mgl-wnd' + --swig ${SWIG_EXECUTABLE} + --swig-opts='-c++ -threads -I${BIN_INC} -I${SRC_INC} ${MGL_DEF}' + DEPENDS ${dep_libs} ${src_dep} + IMPLICIT_DEPENDS CXX ${src_imp_dep} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/lang + ) add_custom_target(mgl_python_module ALL DEPENDS _mathgl.so mathgl.py) install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/lang/setup.py install --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/lang )") - set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "setup.py;mgl_wrap.cpp;build;mathgl.pyc") + set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "mgl_wrap.cpp;build;mathgl.pyc") endif(MGL_HAVE_PYTHON) + +if(MGL_HAVE_OCTAVE) + execute_process(COMMAND ${oct_prog} -p CANONICAL_HOST_TYPE + OUTPUT_VARIABLE oct_host + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${oct_prog} -p API_VERSION + OUTPUT_VARIABLE oct_api + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${oct_prog} -p OCTINCLUDEDIR + OUTPUT_VARIABLE oct_inc + OUTPUT_STRIP_TRAILING_WHITESPACE) +message(STATUS "${oct_prog} ${oct_host} ${oct_api}") + set(oct_arch ${oct_host}-${oct_api}) + set(pkg_name mathgl) + file(MAKE_DIRECTORY ${MathGL_BINARY_DIR}/lang/${pkg_name}/inst/${oct_arch}) + + configure_file(${MathGL_SOURCE_DIR}/COPYING ${MathGL_BINARY_DIR}/lang/${pkg_name} COPYONLY) + configure_file(${MathGL_SOURCE_DIR}/lang/DESCRIPTION ${MathGL_BINARY_DIR}/lang/${pkg_name} COPYONLY) + configure_file(${MathGL_SOURCE_DIR}/lang/INDEX ${MathGL_BINARY_DIR}/lang/${pkg_name} COPYONLY) + configure_file(${MathGL_SOURCE_DIR}/lang/PKG_ADD_template ${MathGL_BINARY_DIR}/lang/${pkg_name}/PKG_ADD COPYONLY) + + add_custom_command(OUTPUT mgl_octave.cpp + COMMAND ${SWIG_EXECUTABLE} -octave -c++ ${MGL_DEF} + -I${BIN_INC} -I${SRC_INC} + -o mgl_octave.cpp ${MGL_I} + DEPENDS ${src_dep} + IMPLICIT_DEPENDS CXX ${src_imp_dep} + ) +# -L$ #commented out for compatibilty reason with old cmake +# -L$ #commented out for compatibilty reason with old cmake + add_custom_command(OUTPUT ${pkg_name}/inst/${oct_arch}/mathgl.oct + COMMAND ${oct_mk} ${MGL_DEF} + -I${oct_inc} -I${BIN_INC} -I${SRC_INC} + -L${MGL_LINK_DIR} + -L${MGL_WND_LINK_DIR} + -lmgl-wnd -lmgl + -o ${pkg_name}/inst/${oct_arch}/mathgl.oct mgl_octave.cpp + DEPENDS ${dep_libs} ${src_dep} mgl_octave.cpp + IMPLICIT_DEPENDS CXX ${src_imp_dep} + ) + add_custom_command(OUTPUT mathgl.tar.gz + COMMAND ${oct_tar} cpzvf mathgl.tar.gz ${pkg_name} + DEPENDS ${pkg_name}/inst/${oct_arch}/mathgl.oct + ) + add_custom_target(mgl_octave_module ALL DEPENDS mathgl.tar.gz) +endif(MGL_HAVE_OCTAVE) diff --git a/lang/Makefile.am b/lang/Makefile.am deleted file mode 100644 index bc4461e..0000000 --- a/lang/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -AM_CXXFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include - -CLEANFILES = -BUILT_SOURCES = - -if USE_PYTHON -python_PYTHON = mathgl.py -pyexec_LTLIBRARIES = _mathgl.la -_mathgl_la_SOURCES = mgl_python.cpp -_mathgl_la_CXXFLAGS = $(PYTHON_HEADERS) $(AM_CXXFLAGS) -_mathgl_la_LIBADD = $(top_builddir)/src/libmgl.la -#_mathgl_la_LIBADD = $(top_builddir)/widgets/libmgl-qt.la -_mathgl_la_LDFLAGS = -avoid-version -module - -CLEANFILES += mgl_python.cpp mathgl.py -BUILT_SOURCES += mathgl.py mgl_python.cpp - -mgl_python.cpp mathgl.py: $(srcdir)/mgl.i $(top_srcdir)/include/mgl/data.h $(top_srcdir)/include/mgl/mgl.h - swig -python -c++ -I$(top_srcdir)/include -I$(top_builddir)/include -o mgl_python.cpp $(srcdir)/mgl.i -#mathgl.py: $(top_srcdir)/lang/mgl.i $(top_srcdir)/include/mgl/mgl_c.h $(top_srcdir)/include/mgl/mgl_w.h -# swig -python -c++ -I$(top_srcdir)/include -o mgl_python.cpp $(top_srcdir)/lang/mgl.i -endif - - -if USE_OCTAVE - -CLEANFILES += mgl_octave.cpp mathgl.oct mathgl.tar.gz - -PKG_NAME = mathgl -PKG_OCT_FILES = mathgl.oct -PKG_OTHER_FILES = $(top_srcdir)/COPYING $(srcdir)/DESCRIPTION $(srcdir)/INDEX $(srcdir)/PKG_ADD_template -octavedir=$(pkgdatadir)/octave -dist_octave_DATA = mathgl.tar.gz -mathgl.tar.gz: $(PKG_OCT_FILES) $(PKG_OTHER_FILES) - mkdir -p $(PKG_NAME) - mkdir -p $(PKG_NAME)/inst/$(OCTAVE_ARCH) - cp -rf $(PKG_OTHER_FILES) $(PKG_NAME) - mv $(PKG_NAME)/PKG_ADD_template $(PKG_NAME)/PKG_ADD - cp -rf $(PKG_OCT_FILES) $(PKG_NAME)/inst/$(OCTAVE_ARCH) - tar cpzvf $@ $(PKG_NAME) - rm -rf $(PKG_NAME) - -MY_MKOCTFILE=$(CXX) -O0 -g -shared $(OCTAVE_INCFLAGS) - -mgl_octave.cpp: $(srcdir)/mgl.i $(top_srcdir)/include/mgl/data.h $(top_srcdir)/include/mgl/mgl.h - swig -octave -c++ -I$(top_srcdir)/include -I$(top_builddir)/include -o mgl_octave.cpp $(srcdir)/mgl.i -mathgl.oct: mgl_octave.cpp - $(MY_MKOCTFILE) -o $@ $^ -fPIC -I$(top_srcdir)/include -I$(top_builddir)/include -L$(top_builddir)/src/.libs/ -lmgl -endif - diff --git a/lang/mgl.i.in b/lang/mgl.i.in index f7dd192..bbf1e4f 100644 --- a/lang/mgl.i.in +++ b/lang/mgl.i.in @@ -20,6 +20,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + %module mathgl #ifdef SWIGOCTAVE %feature("autodoc", 1); @@ -36,11 +37,11 @@ %{ #define SWIG_FILE_WITH_INIT -//#include "mgl/config.h" -#include "mgl/type.h" -#include "mgl/data.h" -#include "mgl/mgl.h" -#include "mgl/window.h" +//#include "mgl2/config.h" +#include "mgl2/type.h" +#include "mgl2/data.h" +#include "mgl2/mgl.h" +#include "mgl2/window.h" %} #if MGL_USE_DOUBLE @@ -88,11 +89,11 @@ import_array(); %apply (int DIM1, int DIM2, int DIM3, double* IN_ARRAY3) {(int rows, int cols, int slc, const double* d)}; #endif -//%include "mgl/config.h" -%include "mgl/type.h" -%include "mgl/data.h" -%include "mgl/mgl.h" -%include "mgl/window.h" +//%include "mgl2/config.h" +%include "mgl2/type.h" +%include "mgl2/data.h" +%include "mgl2/mgl.h" +%include "mgl2/window.h" %extend mglData { float __getitem__( int i) { return self->GetVal(i); }; diff --git a/lang/setup.py.in b/lang/setup.py.in index f7bc2bd..05edce4 100644 --- a/lang/setup.py.in +++ b/lang/setup.py.in @@ -1,28 +1,23 @@ from distutils.core import setup, Extension import os -try: - source_dir="${SRC_INC}" - binary_dir="${BIN_INC}" - mgl_i="${MGL_I}" - mgl_lib="${MGL_LIB}" - mgl_lib_wnd="${MGL_LIB_WND}" -except KeyError: - source_dir="." - binary_dir="." -# mgl_dir="src/.libs/libmgl.so" +mgl_i="${MGL_I}" +dep_libs="${dep_libs}" +d_l=[] +for i in dep_libs.split(';'): + d_l.append(i) +def_list="${DEF_LIST}" +defs=[] +for i in def_list.split(';'): + k=i.split('=') + if len(k)==1: defs.append((i,None)) + else: defs.append((k[0],k[1])) mgl_module = Extension('_mathgl', - sources=[mgl_i], - include_dirs=[binary_dir, source_dir], - swig_opts=[ -# "-outdir %s/lang" % binary_dir, - '-c++', - '-threads', - "-I%s" % binary_dir, - "-I%s" % source_dir], - extra_objects=[mgl_lib,mgl_lib_wnd] - ) + sources=[mgl_i], + define_macros=defs, + libraries=d_l +) setup ( name = "mathgl", diff --git a/mgllab/Makefile.am b/mgllab/Makefile.am deleted file mode 100644 index d0cea0f..0000000 --- a/mgllab/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/ - -bin_PROGRAMS = udav - -udav_SOURCES = \ -animate.cpp editor.cpp grid.cpp mathgl.cpp setup.cpp \ -data.cpp main.cpp option.cpp table.cpp help.cpp - -udav_LDADD = $(MGL_LIBS) $(FLTK_LIBS) -udav_CPPFLAGS = -O2 -DDOC_DIR=\"$(docdir)/\" diff --git a/mgllab/grid.cpp b/mgllab/grid.cpp index d4909c9..9702382 100644 --- a/mgllab/grid.cpp +++ b/mgllab/grid.cpp @@ -22,21 +22,6 @@ #include #include -/* -#ifdef _MSC_VER -#define _USE_MATH_DEFINES -#include -const unsigned long mgl_nan[2] = {0xffffffff, 0x7fffffff}; -#define NANd (*(double*)mgl_nan) -#define NANf (*(float*)&(mgl_nan[1])) -#define NAN NANf -#define isnan _isnan -#define isfinite _finite -#define copysignf _copysign -#define chdir _chdir -#endif -*/ - #include #include "udav.h" //----------------------------------------------------------------------------- @@ -82,7 +67,7 @@ void Fl_Data_Table::draw_cell(TableContext context, int R, int C, int X, int Y, fl_push_clip(X+3, Y+3, W-6, H-6); fl_font(FL_HELVETICA, 14); fl_color(FL_BLACK); - if(isnan(data[C+nx*R])) strcpy(s,"nan"); + if(mgl_isnan(data[C+nx*R])) strcpy(s,"nan"); else sprintf(s,"%g",data[C+nx*R]); fl_draw(s, X+3, Y+3, W-6, H-6, FL_ALIGN_RIGHT); break; @@ -114,7 +99,7 @@ void Fl_Data_Table::cell_click() find_cell(CONTEXT_CELL, R, C, XX, YY, WW, HH); input->resize(XX,YY,WW,HH); char s[32]; - if(isnan(data[C+nx*R])) strcpy(s,"nan"); + if(mgl_isnan(data[C+nx*R])) strcpy(s,"nan"); else sprintf(s,"%g",data[C+nx*R]); input->value(s); input->show(); input->take_focus(); diff --git a/mgllab/mathgl.cpp b/mgllab/mathgl.cpp index 4a373d0..483c9db 100644 --- a/mgllab/mathgl.cpp +++ b/mgllab/mathgl.cpp @@ -15,7 +15,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include "mgl/mgl.h" +#include "mgl2/mgl.h" #include "udav.h" //----------------------------------------------------------------------------- #include "xpm/alpha.xpm" diff --git a/mgllab/setup.cpp b/mgllab/setup.cpp index 4de08e9..01a20c5 100644 --- a/mgllab/setup.cpp +++ b/mgllab/setup.cpp @@ -14,7 +14,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include "mgl2/mgl.h" #include #include #include diff --git a/mgllab/udav.h b/mgllab/udav.h index 532e9ef..737483e 100644 --- a/mgllab/udav.h +++ b/mgllab/udav.h @@ -59,8 +59,8 @@ #define UDAV_THIN_UP_BOX FL_GTK_THIN_UP_BOX #endif //----------------------------------------------------------------------------- -#include "mgl/parser.h" -#include "mgl/fltk.h" +#include "mgl2/parser.h" +#include "mgl2/fltk.h" //----------------------------------------------------------------------------- extern mglParse *Parse; extern Fl_Menu_Item colors[]; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1dd1072..1acfd73 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,14 +7,14 @@ plot.cpp prim.cpp surf.cpp tex_table.cpp vect.cpp volume.cpp evalc.cpp #window.c ) set(mgl_hdr -../include/mgl/base_cf.h ../include/mgl/fit.h ../include/mgl/plot.h -../include/mgl/base.h ../include/mgl/prim.h ../include/mgl/canvas_cf.h -../include/mgl/font.h ../include/mgl/canvas.h ../include/mgl/surf.h -../include/mgl/mgl_cf.h ../include/mgl/type.h ${MathGL_BINARY_DIR}/include/mgl/config.h -../include/mgl/cont.h ../include/mgl/mgl.h ../include/mgl/vect.h -../include/mgl/data.h ../include/mgl/volume.h ../include/mgl/data_cf.h -../include/mgl/define.h ../include/mgl/other.h ../include/mgl/eval.h -../include/mgl/parser.h ../include/mgl/addon.h ../include/mgl/evalc.h ) +../include/mgl2/base_cf.h ../include/mgl2/fit.h ../include/mgl2/plot.h +../include/mgl2/base.h ../include/mgl2/prim.h ../include/mgl2/canvas_cf.h +../include/mgl2/font.h ../include/mgl2/canvas.h ../include/mgl2/surf.h +../include/mgl2/mgl_cf.h ../include/mgl2/type.h ${MathGL_BINARY_DIR}/include/mgl2/config.h +../include/mgl2/cont.h ../include/mgl2/mgl.h ../include/mgl2/vect.h +../include/mgl2/data.h ../include/mgl2/volume.h ../include/mgl2/data_cf.h +../include/mgl2/define.h ../include/mgl2/other.h ../include/mgl2/eval.h +../include/mgl2/parser.h ../include/mgl2/addon.h ../include/mgl2/evalc.h ) set(prc_src prc/PRCbitStream.cc prc/PRCdouble.cc prc/oPRCFile.cc prc/writePRC.cc prc.cpp @@ -30,7 +30,7 @@ include_directories(prc) if(MGL_HAVE_OPENGL) set(mgl_src ${mgl_src} opengl.cpp ) - set(mgl_hdr ${mgl_hdr} ../include/mgl/opengl.h ) + set(mgl_hdr ${mgl_hdr} ../include/mgl2/opengl.h ) endif(MGL_HAVE_OPENGL) add_library(mgl SHARED ${mgl_src} ${mgl_hdr}) @@ -49,12 +49,13 @@ if(MGL_HAVE_U3D) target_link_libraries(mgl ${U3D_LIB}) target_link_libraries(mgl-static ${U3D_LIB}) include_directories(${U3D_INCLUDE_DIR}) - if(MGL_HAVE_PDF) - include_directories(${HPDF_INCLUDE_DIR}) - target_link_libraries(mgl ${HPDF_LIB}) - endif(MGL_HAVE_PDF) endif(MGL_HAVE_U3D) +if(MGL_HAVE_PDF) + include_directories(${HPDF_INCLUDE_DIR}) + target_link_libraries(mgl ${HPDF_LIB}) +endif(MGL_HAVE_PDF) + if(MGL_HAVE_PTHREAD) target_link_libraries(mgl ${CMAKE_THREAD_LIBS_INIT}) endif(MGL_HAVE_PTHREAD) diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index f64eeda..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,47 +0,0 @@ -AM_CXXFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include - -lib_LTLIBRARIES = libmgl.la - - -libmgl_la_LIBADD = $(PNG_LIBS) $(GL_LIBS) -libmgl_la_LDFLAGS = -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) - -libmgl_la_CXXFLAGS = \ - -DMOD_LIB_DIR=\"$(libdir)/mgl/\" $(HDF5_FLAGS) $(HDF4_FLAGS) $(JPEG_FLAGS) \ - $(PNG_FLAGS) $(FLTK_FLAGS) $(ADDON_FLAGS) $(AM_CXXFLAGS) $(PTHREAD_FLAGS) - -if USE_PTHREAD -libmgl_la_LIBADD += $(PTHREAD_LIBS) -endif - -if USE_GSL -libmgl_la_LIBADD += $(GSL_LIBS) -endif - -if USE_HDF4 -libmgl_la_LIBADD += $(HDF4_LIBS) -endif - -if USE_HDF5 -libmgl_la_LIBADD += $(HDF5_LIBS) -endif - -if USE_JPEG -libmgl_la_LIBADD += $(JPEG_LIBS) -endif - -if USE_U3D -libmgl_la_LIBADD += $(U3D_LIBS) -endif - -libmgl_la_SOURCES = \ -addon.cpp axis.cpp base_cf.cpp base.cpp canvas_cf.cpp canvas.cpp cont.cpp crust.cpp \ -data.cpp data_io.cpp data_new.cpp data_op.cpp data_png.cpp def_font.cpp export_2d.cpp \ -export_3d.cpp eval.cpp evalp.cpp exec.cpp export.cpp fit.cpp font.cpp other.cpp evalc.cpp \ -parser.cpp pde.cpp pixel.cpp plot.cpp prim.cpp surf.cpp tex_table.cpp vect.cpp volume.cpp \ -opengl.cpp - -#if USE_OPENGL -#libmgl_la_SOURCES += opengl.cpp -#libmgl_la_LIBADD += -#endif \ No newline at end of file diff --git a/src/addon.cpp b/src/addon.cpp index 861263b..b771942 100644 --- a/src/addon.cpp +++ b/src/addon.cpp @@ -25,8 +25,8 @@ #include #endif #include -#include "mgl/addon.h" -#include "mgl/data.h" +#include "mgl2/addon.h" +#include "mgl2/data.h" //--------------------------------------------------------------------------- void mgl_strcls(char *str) { diff --git a/src/axis.cpp b/src/axis.cpp index 1738163..c7dea0a 100644 --- a/src/axis.cpp +++ b/src/axis.cpp @@ -21,9 +21,9 @@ #include #include #include -#include "mgl/data.h" -#include "mgl/canvas.h" -#include "mgl/prim.h" +#include "mgl2/data.h" +#include "mgl2/canvas.h" +#include "mgl2/prim.h" //----------------------------------------------------------------------------- #define islog(a, b) (((a)>0 && (b)>10*(a)) || ((b)<0 && (a)<10*(b))) #define sign(a) ((a)<0 ? -1:1) @@ -266,7 +266,7 @@ void mglCanvas::SetTickTime(char dir, float d, const char *t) if(aa.ch=='z') aa.v0 = aa.org.z; wchar_t buf[64]; - float v, v0 = isnan(aa.o) ? aa.v0 : aa.o, v1; + float v, v0 = mgl_isnan(aa.o) ? aa.v0 : aa.o, v1; if(aa.v2>aa.v1) { v1 = aa.v2; v0 = v0 - aa.dv*floor((v0-aa.v1)/aa.dv+1e-3); } else @@ -425,7 +425,7 @@ void mglCanvas::LabelTicks(mglAxis &aa) if((TuneTicks&1)==0 && kind==2) kind=0; if((TuneTicks&2)==0 && kind!=2) kind=0; - v0 = isnan(aa.o) ? aa.v0 : aa.o; + v0 = mgl_isnan(aa.o) ? aa.v0 : aa.o; if(aa.v2>aa.v1) { v1 = aa.v2; v0 = v0 - aa.dv*floor((v0-aa.v1)/aa.dv+1e-3); } else @@ -501,7 +501,7 @@ void mglCanvas::DrawAxis(mglAxis &aa, bool text, char arr,const char *stl) } k2 = aa.txt.size(); - float v, u, v0 = isnan(aa.o) ? aa.v0 : aa.o; + float v, u, v0 = mgl_isnan(aa.o) ? aa.v0 : aa.o; if(k2>0) for(i=0;i -#include "mgl/base.h" -#include "mgl/define.h" +#include "mgl2/base.h" +#include "mgl2/define.h" //----------------------------------------------------------------------------- char *mgl_strdup(const char *s) { @@ -117,7 +117,7 @@ void mglBase::SetWarn(int code, const char *who) long mglBase::AddPnt(mglPoint p, float c, mglPoint n, float a, int scl) { if(scl>0) ScalePoint(p,n,!(scl&2)); - if(isnan(p.x)) return -1; + if(mgl_isnan(p.x)) return -1; a = (a>=0 && a<=1) ? a : AlphaDef; c = (c>=0) ? c:CDef; @@ -139,6 +139,7 @@ long mglBase::AddPnt(mglPoint p, float c, mglPoint n, float a, int scl) txt.GetC(c,a,q); // RGBA color if(!get(MGL_ENABLE_ALPHA)) { q.a=1; if(txt.Smooth!=2) q.ta=1; } + if(q.ta<0.005) q.ta = 0.005; // bypass OpenGL/OBJ/PRC bug if(scl&8 && scl>0) q.a=a; // bypass palette for enabling alpha in Error() if(!get(MGL_ENABLE_LIGHT) && !(scl&4)) q.u=q.v=NAN; MGL_PUSH(Pnt,q,mutexPnt); return Pnt.size()-1; @@ -148,7 +149,7 @@ long mglBase::CopyNtoC(long from, float c) { if(from<0) return -1; mglPnt p=Pnt[from]; - if(!isnan(c)) { p.c=c; p.t=0; Txt[long(c)].GetC(c,0,p); } + if(!mgl_isnan(c)) { p.c=c; p.t=0; Txt[long(c)].GetC(c,0,p); } MGL_PUSH(Pnt,p,mutexPnt); return Pnt.size()-1; } //----------------------------------------------------------------------------- @@ -249,7 +250,7 @@ void mglBase::SetFBord(float x,float y,float z) bool mglBase::ScalePoint(mglPoint &p, mglPoint &n, bool use_nan) const { float &x=p.x, &y=p.y, &z=p.z; - if(isnan(x) || isnan(y) || isnan(z)) { x=NAN; return false; } + if(mgl_isnan(x) || mgl_isnan(y) || mgl_isnan(z)) { x=NAN; return false; } float x1,y1,z1,x2,y2,z2; x1 = x>0?x*MGL_FLT_EPS:x/MGL_FLT_EPS; x2 = x<0?x*MGL_FLT_EPS:x/MGL_FLT_EPS; y1 = y>0?y*MGL_FLT_EPS:y/MGL_FLT_EPS; y2 = y<0?y*MGL_FLT_EPS:y/MGL_FLT_EPS; @@ -280,7 +281,7 @@ bool mglBase::ScalePoint(mglPoint &p, mglPoint &n, bool use_nan) const if(fx) { x1 = fx->Calc(x,y,z); n.x *= fx->CalcD('x',x,y,z); } if(fy) { y1 = fy->Calc(x,y,z); n.y *= fy->CalcD('y',x,y,z); } if(fz) { z1 = fz->Calc(x,y,z); n.z *= fz->CalcD('z',x,y,z); } - if(isnan(x1) || isnan(y1) || isnan(z1)) { x=NAN; return false; } + if(mgl_isnan(x1) || mgl_isnan(y1) || mgl_isnan(z1)) { x=NAN; return false; } x = (2*x1 - FMin.x - FMax.x)/(FMax.x - FMin.x); y = (2*y1 - FMin.y - FMax.y)/(FMax.y - FMin.y); @@ -326,12 +327,12 @@ void mglBase::SetRanges(mglPoint m1, mglPoint m2) else { Min.c=Min.z;Max.c=Max.z;} // if(AutoOrg) { - if(Org.xMax.x && !isnan(Org.x)) Org.x = Max.x; - if(Org.yMax.y && !isnan(Org.y)) Org.y = Max.y; - if(Org.zMax.z && !isnan(Org.z)) Org.z = Max.z; + if(Org.xMax.x && !mgl_isnan(Org.x)) Org.x = Max.x; + if(Org.yMax.y && !mgl_isnan(Org.y)) Org.y = Max.y; + if(Org.zMax.z && !mgl_isnan(Org.z)) Org.z = Max.z; } CutMin = mglPoint(0,0,0); CutMax = mglPoint(0,0,0); RecalcBorder(); @@ -354,8 +355,8 @@ void mglBase::CRange(const mglDataA &a,bool add, float fact) Min.c = v1dv ? v2:dv; } - if(Org.cMax.c && !isnan(Org.c)) Org.c = Max.c; + if(Org.cMax.c && !mgl_isnan(Org.c)) Org.c = Max.c; RecalcCRange(); } //----------------------------------------------------------------------------- @@ -376,8 +377,8 @@ void mglBase::XRange(const mglDataA &a,bool add,float fact) Min.x = v1dv ? v2:dv; } - if(Org.xMax.x && !isnan(Org.x)) Org.x = Max.x; + if(Org.xMax.x && !mgl_isnan(Org.x)) Org.x = Max.x; RecalcBorder(); } //----------------------------------------------------------------------------- @@ -398,8 +399,8 @@ void mglBase::YRange(const mglDataA &a,bool add,float fact) Min.y = v1dv ? v2:dv; } - if(Org.yMax.y && !isnan(Org.y)) Org.y = Max.y; + if(Org.yMax.y && !mgl_isnan(Org.y)) Org.y = Max.y; RecalcBorder(); } //----------------------------------------------------------------------------- @@ -420,8 +421,8 @@ void mglBase::ZRange(const mglDataA &a,bool add,float fact) Min.z = v1dv ? v2:dv; } - if(Org.zMax.z && !isnan(Org.z)) Org.z = Max.z; + if(Org.zMax.z && !mgl_isnan(Org.z)) Org.z = Max.z; RecalcBorder(); } //----------------------------------------------------------------------------- @@ -520,7 +521,7 @@ void mglBase::ClearEq() //----------------------------------------------------------------------------- // Colors ids //----------------------------------------------------------------------------- -mglColorID mglColorIds[] = {{'k', mglColor(0,0,0)}, +mglColorID mglColorIds[31] = {{'k', mglColor(0,0,0)}, {'r', mglColor(1,0,0)}, {'R', mglColor(0.5,0,0)}, {'g', mglColor(0,1,0)}, {'G', mglColor(0,0.5,0)}, {'b', mglColor(0,0,1)}, {'B', mglColor(0,0,0.5)}, @@ -634,9 +635,6 @@ void mglTexture::GetC(float u,float v,mglPnt &p) const p.a = (s[0].a*(1-u)+s[2].a*u)*v + (s[1].a*(1-u)+s[3].a*u)*(1-v); // for alpha use inverted } //----------------------------------------------------------------------------- -bool mglTexture::IsSame(const mglTexture &t) const -{ return n==t.n && !memcmp(col,t.col,514*sizeof(mglColor)); } -//----------------------------------------------------------------------------- long mglBase::AddTexture(const char *cols, int smooth) { mglTexture t(cols,smooth); diff --git a/src/base_cf.cpp b/src/base_cf.cpp index 64d37a5..1cb734f 100644 --- a/src/base_cf.cpp +++ b/src/base_cf.cpp @@ -17,12 +17,24 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "mgl/base_cf.h" +#include "mgl2/base_cf.h" //----------------------------------------------------------------------------- // // C interfaces // //----------------------------------------------------------------------------- +void mgl_set_color(char id, float r, float g, float b) +{ + register size_t i; + for(i=0;mglColorIds[i].id;i++) if(mglColorIds[i].id==id) mglColorIds[i].col = mglColor(r,g,b); +} +void mgl_set_color_(char *id, float *r, float *g, float *b, int) { mgl_set_color(*id,*r,*g,*b); } +//----------------------------------------------------------------------------- +void mgl_set_def_sch(HMGL gr, const char *sch) { gr->SetDefScheme(sch); } +void mgl_set_def_sch_(uintptr_t *gr, const char *sch,int l) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + _GR_->SetDefScheme(s); delete []s; } +//----------------------------------------------------------------------------- const char *mgl_get_mess(HMGL gr) { return gr->Mess.c_str(); } int mgl_get_warn(HMGL gr) { return gr->GetWarn(); } void mgl_set_warn(HMGL gr, int code, const char *txt) diff --git a/src/canvas.cpp b/src/canvas.cpp index 69f8a46..ac931da 100644 --- a/src/canvas.cpp +++ b/src/canvas.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include #include -#include "mgl/canvas.h" +#include "mgl2/canvas.h" //----------------------------------------------------------------------------- mglCanvas::mglCanvas(int w, int h) : mglBase() { @@ -181,7 +181,7 @@ float mglCanvas::FindOptOrg(char dir, int ind) const float mglCanvas::GetOrgX(char dir) const { float res = Org.x; - if(isnan(res)) + if(mgl_isnan(res)) { if(strchr("xyz",dir)) res = FindOptOrg(dir,0); else if(dir=='t') res = Min.x; @@ -193,7 +193,7 @@ float mglCanvas::GetOrgX(char dir) const float mglCanvas::GetOrgY(char dir) const { float res = Org.y; - if(isnan(res)) + if(mgl_isnan(res)) { if(strchr("xyz",dir)) res = FindOptOrg(dir,1); else if(dir=='t') res = Min.y; @@ -205,7 +205,7 @@ float mglCanvas::GetOrgY(char dir) const float mglCanvas::GetOrgZ(char dir) const { float res = Org.z; - if(isnan(res)) + if(mgl_isnan(res)) { if(strchr("xyz",dir)) res = FindOptOrg(dir,2); else if(dir=='t') res = Min.z; @@ -221,7 +221,7 @@ float mglCanvas::GetOrgZ(char dir) const a.n1 = p; a.n4 = type; add_prim(a); } void mglCanvas::mark_plot(long p, char type, float size) { - if(p<0 || isnan(Pnt[p].x)) return; + if(p<0 || mgl_isnan(Pnt[p].x)) return; long pp=p; mglDrawReg d; d.set(this,1,1,0); if(size>=0) size *= MarkSize; @@ -236,7 +236,7 @@ void mglCanvas::mark_plot(long p, char type, float size) void mglCanvas::line_plot(long p1, long p2) { if(PDef==0) return; - if(p1<0 || p2<0 || isnan(Pnt[p1].x) || isnan(Pnt[p2].x)) return; + if(p1<0 || p2<0 || mgl_isnan(Pnt[p1].x) || mgl_isnan(Pnt[p2].x)) return; mglDrawReg dd; dd.set(this,1,1,0); long pp1=p1,pp2=p2; float pw = fabs(PenWidth),d; @@ -253,7 +253,7 @@ void mglCanvas::line_plot(long p1, long p2) a.n3 = p3; add_prim(a);} void mglCanvas::trig_plot(long p1, long p2, long p3) { - if(p1<0 || p2<0 || p3<0 || isnan(Pnt[p1].x) || isnan(Pnt[p2].x) || isnan(Pnt[p3].x)) return; + if(p1<0 || p2<0 || p3<0 || mgl_isnan(Pnt[p1].x) || mgl_isnan(Pnt[p2].x) || mgl_isnan(Pnt[p3].x)) return; long pp1=p1,pp2=p2,pp3=p3; mglDrawReg d; d.set(this,1,1,0); if(TernAxis&4) for(int i=0;i<4;i++) @@ -267,10 +267,10 @@ void mglCanvas::trig_plot(long p1, long p2, long p3) a.n3 = p3; a.n4 = p4; add_prim(a); } void mglCanvas::quad_plot(long p1, long p2, long p3, long p4) { - if(p1<0 || isnan(Pnt[p1].x)) { trig_plot(p4,p2,p3); return; } - if(p2<0 || isnan(Pnt[p2].x)) { trig_plot(p1,p4,p3); return; } - if(p3<0 || isnan(Pnt[p3].x)) { trig_plot(p1,p2,p4); return; } - if(p4<0 || isnan(Pnt[p4].x)) { trig_plot(p1,p2,p3); return; } + if(p1<0 || mgl_isnan(Pnt[p1].x)) { trig_plot(p4,p2,p3); return; } + if(p2<0 || mgl_isnan(Pnt[p2].x)) { trig_plot(p1,p4,p3); return; } + if(p3<0 || mgl_isnan(Pnt[p3].x)) { trig_plot(p1,p2,p4); return; } + if(p4<0 || mgl_isnan(Pnt[p4].x)) { trig_plot(p1,p2,p3); return; } long pp1=p1,pp2=p2,pp3=p3,pp4=p4; mglDrawReg d; d.set(this,1,1,0); if(TernAxis&4) for(int i=0;i<4;i++) @@ -282,7 +282,7 @@ void mglCanvas::quad_plot(long p1, long p2, long p3, long p4) //----------------------------------------------------------------------------- float mglCanvas::text_plot(long p,const wchar_t *text,const char *font,float size,float sh,float col,bool rot) { - if(p<0 || isnan(Pnt[p].x)) return 0; + if(p<0 || mgl_isnan(Pnt[p].x)) return 0; if(size<0) size *= -FontSize; if(!font) font=""; @@ -320,7 +320,7 @@ float mglCanvas::text_plot(long p,const wchar_t *text,const char *font,float siz shift *= h; B.z= q.z; if(ll==0) { Pop(); return 0; } - if(isnan(ll) || !get(MGL_ENABLE_RTEXT)) + if(mgl_isnan(ll) || !get(MGL_ENABLE_RTEXT)) { fscl = fsize; ftet = 0; B.x = q.x; B.y= q.y - shift; @@ -663,7 +663,7 @@ void mglCanvas::Legend(const std::vector &leg, float x, float y, const long n=leg.size(), iw, ih; if(n<1) { SetWarn(mglWarnLeg); return; } static int cgid=1; StartGroup("Legend",cgid++); - if(ll<=0 || isnan(ll)) ll=0.1; + if(ll<=0 || mgl_isnan(ll)) ll=0.1; ll *=font_factor; if(size<0) size = -size*FontSize; // setup font and parse absolute coordinates @@ -778,8 +778,10 @@ void mglCanvas::StartAutoGroup (const char *lbl) if(lbl==NULL) { id=1; return; } if(ObjId<0) { ObjId = -id; id++; } register size_t len = Grp.size(); - if(ObjId>=0 &&len>0 && ObjId!=Grp[len-1].Id) - MGL_PUSH(Grp,mglGroup(lbl,ObjId),mutexGrp); + if(ObjId>=0 && len>0 && ObjId!=Grp[len-1].Id) + { MGL_PUSH(Grp,mglGroup(lbl,ObjId),mutexGrp); } + else if(ObjId<0) + { MGL_PUSH(Grp,mglGroup(lbl,ObjId),mutexGrp); } } //----------------------------------------------------------------------------- void mglCanvas::EndGroup() { LoadState(); } diff --git a/src/canvas_cf.cpp b/src/canvas_cf.cpp index 6e8b393..dc9044c 100644 --- a/src/canvas_cf.cpp +++ b/src/canvas_cf.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "mgl/canvas.h" -#include "mgl/canvas_cf.h" +#include "mgl2/canvas.h" +#include "mgl2/canvas_cf.h" //----------------------------------------------------------------------------- #undef _GR_ #define _GR_ ((mglCanvas *)(*gr)) diff --git a/src/cont.cpp b/src/cont.cpp index 32f3a61..ad5e025 100644 --- a/src/cont.cpp +++ b/src/cont.cpp @@ -19,10 +19,10 @@ ***************************************************************************/ #include #include -#include "mgl/surf.h" -#include "mgl/cont.h" -#include "mgl/data.h" -#include "mgl/eval.h" +#include "mgl2/surf.h" +#include "mgl2/cont.h" +#include "mgl2/data.h" +#include "mgl2/eval.h" //----------------------------------------------------------------------------- // // Text printing along a curve @@ -431,7 +431,7 @@ void mgl_cont_val(HMGL gr, HCDT v, HCDT z, const char *sch, const char *opt) void mgl_cont_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?7:long(r+0.5); + long Num = mgl_isnan(r)?7:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"Cont"); return; } mglData v(Num); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(Num+1); @@ -441,7 +441,7 @@ void mgl_cont_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *o void mgl_cont(HMGL gr, HCDT z, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?7:long(r+0.5); + long Num = mgl_isnan(r)?7:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"Cont"); return; } mglData v(Num); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(Num+1); @@ -631,7 +631,7 @@ void mgl_contf_val(HMGL gr, HCDT v, HCDT z, const char *sch, const char *opt) void mgl_contf_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?7:long(r+0.5); + long Num = mgl_isnan(r)?7:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"Cont"); return; } mglData v(Num+2); v.Fill(gr->Min.c, gr->Max.c); mgl_contf_xy_val(gr,&v,x,y,z,sch,0); @@ -640,7 +640,7 @@ void mgl_contf_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char * void mgl_contf(HMGL gr, HCDT z, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?7:long(r+0.5); + long Num = mgl_isnan(r)?7:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"Cont"); return; } mglData v(Num+2); v.Fill(gr->Min.c, gr->Max.c); mgl_contf_val(gr,&v,z,sch,0); @@ -848,7 +848,7 @@ void mgl_contv_val(HMGL gr, HCDT v, HCDT z, const char *sch, const char *opt) void mgl_contv_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?7:long(r+0.5); + long Num = mgl_isnan(r)?7:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"Cont"); return; } mglData v(Num); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(Num+1); @@ -858,7 +858,7 @@ void mgl_contv_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char * void mgl_contv(HMGL gr, HCDT z, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?7:long(r+0.5); + long Num = mgl_isnan(r)?7:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"Cont"); return; } mglData v(Num); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(Num+1); @@ -1011,7 +1011,7 @@ void mgl_cont3_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sVal, const c void mgl_cont3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, float sVal, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?7:long(r+0.5); + long Num = mgl_isnan(r)?7:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"Cont3"); return; } mglData v(Num); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(Num+1); @@ -1021,7 +1021,7 @@ void mgl_cont3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, flo void mgl_cont3(HMGL gr, HCDT a, const char *sch, float sVal, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?7:long(r+0.5); + long Num = mgl_isnan(r)?7:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"Cont3"); return; } mglData v(Num); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(Num+1); @@ -1183,7 +1183,7 @@ void mgl_contf3_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sVal, const void mgl_contf3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, float sVal, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?7:long(r+0.5); + long Num = mgl_isnan(r)?7:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"ContF3"); return; } mglData v(Num+2); v.Fill(gr->Min.c, gr->Max.c); mgl_contf3_xyz_val(gr,&v,x,y,z,a,sch,sVal,0); @@ -1192,7 +1192,7 @@ void mgl_contf3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, fl void mgl_contf3(HMGL gr, HCDT a, const char *sch, float sVal, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?7:long(r+0.5); + long Num = mgl_isnan(r)?7:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"ContF3"); return; } mglData v(Num+2); v.Fill(gr->Min.c, gr->Max.c); mgl_contf3_val(gr,&v,a,sch,sVal,0); @@ -1403,7 +1403,7 @@ void mgl_axial_val(HMGL gr, HCDT v, HCDT a, const char *sch, const char *opt) void mgl_axial_xy(HMGL gr, HCDT x, HCDT y, HCDT a, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?3:long(r+0.5); + long Num = mgl_isnan(r)?3:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"Axial"); return; } mglData v(Num); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(Num+1); @@ -1413,7 +1413,7 @@ void mgl_axial_xy(HMGL gr, HCDT x, HCDT y, HCDT a, const char *sch, const char * void mgl_axial(HMGL gr, HCDT a, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long Num = isnan(r)?3:long(r+0.5); + long Num = mgl_isnan(r)?3:long(r+0.5); if(Num<1) { gr->SetWarn(mglWarnCnt,"Axial"); return; } mglData v(Num); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(Num+1); diff --git a/src/crust.cpp b/src/crust.cpp index c8242e2..f7cf7fb 100644 --- a/src/crust.cpp +++ b/src/crust.cpp @@ -19,8 +19,8 @@ ***************************************************************************/ #include #include -#include "mgl/other.h" -#include "mgl/data.h" +#include "mgl2/other.h" +#include "mgl2/data.h" //----------------------------------------------------------------------------- // // TriPlot series @@ -296,7 +296,7 @@ void mgl_tricont_xyzcv(HMGL gr, HCDT v, HCDT nums, HCDT x, HCDT y, HCDT z, HCDT void mgl_tricont_xyzc(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long n = (isnan(r) || r<=0) ? 7:long(r+0.5); + long n = (mgl_isnan(r) || r<=0) ? 7:long(r+0.5); mglData v(n); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(n+1); mgl_tricont_xyzcv(gr,&v,nums,x,y,z,a,sch,0); diff --git a/src/data.cpp b/src/data.cpp index 6644c06..0f7e4ce 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -20,8 +20,8 @@ #include #include #include -#include "mgl/data.h" -#include "mgl/eval.h" +#include "mgl2/data.h" +#include "mgl2/eval.h" int mglNumThr=0; void mglFillP(long x,long y, const mreal *a,long nx,long ny,mreal _p[4][4]); @@ -93,7 +93,7 @@ double mgl_ipow(double x,int n) double t; if(n==2) return x*x; if(n==1) return x; - if(n<0) return 1/mgl_ipow(x,-n); + if(n<0) return 1./mgl_ipow(x,-n); if(n==0) return 1; t = mgl_ipow(x,n/2); t = t*t; if(n%2==1) t *= x; @@ -1256,7 +1256,7 @@ void mgl_omod(mreal *a, mreal da, int nx, int n) for(i=1;i #endif -#include "mgl/data.h" -#include "mgl/eval.h" +#include "mgl2/data.h" +#include "mgl2/eval.h" #if MGL_HAVE_HDF5 #include @@ -431,9 +431,9 @@ float mgl_data_max(HCDT d) register long nn=d->GetNN(); const mglData *b = dynamic_cast(d); if(b) for(long i=0;ia[i]; if(!isnan(v)) m = m>v ? m:v; } + { v = b->a[i]; if(!mgl_isnan(v)) m = m>v ? m:v; } else for(long i=0;ivthr(i); if(!isnan(v)) m = m>v ? m:v; } + { v = d->vthr(i); if(!mgl_isnan(v)) m = m>v ? m:v; } return m; } float mgl_data_max_(uintptr_t *d) { return mgl_data_max(_DT_); } @@ -444,9 +444,9 @@ float mgl_data_min(HCDT d) register long nn=d->GetNN(); const mglData *b = dynamic_cast(d); if(b) for(long i=0;ia[i]; if(!isnan(v)) m = ma[i]; if(!mgl_isnan(v)) m = mvthr(i); if(!isnan(v)) m = mvthr(i); if(!mgl_isnan(v)) m = mvthr(ii); - if(!isnan(v) && m < v) + if(!mgl_isnan(v) && m < v) { m=v; *i=ii%nx; *j=(ii/nx)%ny; *k=ii/(nx*ny); } } return m; @@ -474,7 +474,7 @@ float mgl_data_min_int(HCDT d, long *i, long *j, long *k) for(long ii=0;iivthr(ii); - if(!isnan(v) && m > v) + if(!mgl_isnan(v) && m > v) { m=v; *i=ii%nx; *j=(ii/nx)%ny; *k=ii/(nx*ny); } } return m; @@ -567,7 +567,7 @@ void *mgl_fill_x(void *par) } void mgl_data_fill(HMDT d, float x1,float x2,char dir) { - if(isnan(x2)) x2=x1; + if(mgl_isnan(x2)) x2=x1; if(dir<'x' || dir>'z') dir='x'; long par[2]={d->nx,d->ny}; mreal b[2]={x1,x2-x1}; @@ -587,7 +587,7 @@ void mgl_data_norm(HMDT d, float v1,float v2,long sym,long dim) else s = dim*d->ny; for(i=s;ia[i] ? a2 : a[i]); } if(a1==a2) { if(a1!=0) a1=0.; else a2=1; } diff --git a/src/data_new.cpp b/src/data_new.cpp index b691a9a..126dbb8 100644 --- a/src/data_new.cpp +++ b/src/data_new.cpp @@ -22,7 +22,7 @@ #include #include -#include "mgl/data.h" +#include "mgl2/data.h" #if MGL_HAVE_GSL #include diff --git a/src/data_op.cpp b/src/data_op.cpp index 97f740b..4e1808e 100644 --- a/src/data_op.cpp +++ b/src/data_op.cpp @@ -22,5 +22,5 @@ #include #include -#include "mgl/data.h" +#include "mgl2/data.h" //----------------------------------------------------------------------------- diff --git a/src/data_png.cpp b/src/data_png.cpp index 8236372..74f79d5 100644 --- a/src/data_png.cpp +++ b/src/data_png.cpp @@ -20,7 +20,7 @@ #include #include #include -#include "mgl/data.h" +#include "mgl2/data.h" //----------------------------------------------------------------------------- long mgl_col_dif(unsigned char *c1,unsigned char *c2,bool sum) { diff --git a/src/eval.cpp b/src/eval.cpp index 80a928e..8942c9e 100644 --- a/src/eval.cpp +++ b/src/eval.cpp @@ -23,7 +23,7 @@ #include #include -#include "mgl/eval.h" +#include "mgl2/eval.h" #if MGL_HAVE_GSL #include @@ -541,21 +541,21 @@ mreal mglFormula::CalcIn(const mreal *a1) const else return (Kod==EQ_A) ? a1[int(Res)] : Res; } double a = Left->CalcIn(a1); - if(!isnan(a)) + if(!mgl_isnan(a)) { if(KodCalcIn(a1); - return !isnan(b) ? f2[Kod-EQ_LT](a,b) : NAN; + return !mgl_isnan(b) ? f2[Kod-EQ_LT](a,b) : NAN; } else if(KodCalcIn(a1); - if(isnan(b)) return NAN; + if(mgl_isnan(b)) return NAN; gsl_sf_elljac_e(a,b, &sn, &cn, &dn); switch(Kod) { @@ -655,19 +655,19 @@ mreal mglFormula::CalcDIn(int id, const mreal *a1) const if(KodCalcIn(a1), d = Left->CalcDIn(id,a1); - if(!isnan(a) && !isnan(d)) + if(!mgl_isnan(a) && !mgl_isnan(d)) { if(KodCalcIn(a1), c = Right->CalcDIn(id,a1); - return !isnan(b) ? (d?f21[Kod-EQ_LT](a,b)*d:0) + (c?f22[Kod-EQ_LT](a,b)*c:0) : NAN; + return !mgl_isnan(b) ? (d?f21[Kod-EQ_LT](a,b)*d:0) + (c?f22[Kod-EQ_LT](a,b)*c:0) : NAN; } else if(KodCalcIn(a1); - if(isnan(b)) return NAN; + if(mgl_isnan(b)) return NAN; gsl_sf_elljac_e(a,b, &sn, &cn, &dn); switch(Kod) // At this moment parse only differentiation or argument NOT mu !!! { diff --git a/src/evalc.cpp b/src/evalc.cpp index d0728a6..ca2d613 100644 --- a/src/evalc.cpp +++ b/src/evalc.cpp @@ -21,9 +21,9 @@ #include #include #include -#include "mgl/evalc.h" -#include "mgl/addon.h" -#include "mgl/data.h" +#include "mgl2/evalc.h" +#include "mgl2/addon.h" +#include "mgl2/data.h" #if MGL_HAVE_GSL #include #endif @@ -259,12 +259,12 @@ dual mglFormulaC::CalcIn(const dual *a1) const if(Kod==EQ_NUM) return Res; dual a = Left->CalcIn(a1); - if(isnan(a.real()) || isnan(a.imag())) return NAN; + if(mgl_isnan(a.real()) || mgl_isnan(a.imag())) return NAN; if(KodCalcIn(a1); - if(isnan(b.real()) || isnan(b.imag())) return NAN; + if(mgl_isnan(b.real()) || mgl_isnan(b.imag())) return NAN; return f2[Kod-EQ_ADD](a,b); } else return f1[Kod-EQ_SIN](a); diff --git a/src/evalp.cpp b/src/evalp.cpp index e3e0891..68648ed 100644 --- a/src/evalp.cpp +++ b/src/evalp.cpp @@ -21,7 +21,7 @@ #include #include #include -#include "mgl/parser.h" +#include "mgl2/parser.h" #if MGL_HAVE_GSL #include #include @@ -261,7 +261,7 @@ mglData mglFormulaCalc(const wchar_t *string, mglParser *arg) else if(!wcscmp(p,L"sa")) { d.Momentum('a',x,y,z,k);v=z; } else if(!wcscmp(p,L"ka")) { d.Momentum('a',x,y,z,k);v=k; } // if this is valid suffix when finish parsing (it can be float number) - if(!isnan(v)) { res.a[0] = v; delete []str; return res; } + if(!mgl_isnan(v)) { res.a[0] = v; delete []str; return res; } } for(n=0;n=len) // this is number or variable diff --git a/src/exec.cpp b/src/exec.cpp index 865413c..9d00f59 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -26,7 +26,7 @@ #include #endif -#include "mgl/parser.h" +#include "mgl2/parser.h" #define iint(x) floor((x)+0.5) wchar_t *mgl_str_copy(const char *s); //----------------------------------------------------------------------------- diff --git a/src/export.cpp b/src/export.cpp index 3cfec52..bb10541 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -25,8 +25,8 @@ #include #include -#include "mgl/canvas.h" -#include "mgl/canvas_cf.h" +#include "mgl2/canvas.h" +#include "mgl2/canvas_cf.h" #if MGL_HAVE_JPEG extern "C" { diff --git a/src/export_2d.cpp b/src/export_2d.cpp index 11e9f98..963a769 100644 --- a/src/export_2d.cpp +++ b/src/export_2d.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "mgl/canvas.h" -#include "mgl/canvas_cf.h" +#include "mgl2/canvas.h" +#include "mgl2/canvas_cf.h" #include #include #include @@ -889,7 +889,7 @@ void mgl_write_tex(HMGL gr, const char *fname,const char *descr) else if(q.type==6) // text { const mglText &t = gr->GetPtx(q.n3); - float ftet = isnan(p1.v)||isnan(p1.u) ? 0:-180*atan2(p1.v,p1.u)/M_PI; + float ftet = mgl_isnan(p1.v)||mgl_isnan(p1.u) ? 0:-180*atan2(p1.v,p1.u)/M_PI; int f,a; mglGetStyle(t.stl.c_str(), &f, &a); std::string ss=cname; if((a&3)==2) ss.append(",west"); if((a&3)==0) ss.append(",east"); diff --git a/src/export_3d.cpp b/src/export_3d.cpp index 84281f4..f0ffc02 100644 --- a/src/export_3d.cpp +++ b/src/export_3d.cpp @@ -20,8 +20,8 @@ #include #include #include -#include "mgl/canvas.h" -#include "mgl/canvas_cf.h" +#include "mgl2/canvas.h" +#include "mgl2/canvas_cf.h" #undef _GR_ #define _GR_ ((mglCanvas *)(*gr)) #define _Gr_ ((mglCanvas *)(gr)) @@ -262,10 +262,10 @@ void mgl_write_obj(HMGL gr, const char *fname,const char *descr, int use_png) fprintf(fp,"# Created by MathGL library\n# Title: %s\n",(descr && *descr) ? descr : fname); for(i=0;iGetPntNum());i++) { - mglPnt pp = gr->GetPnt(i); + const mglPnt &pp = gr->GetPnt(i); fprintf(fp,"v %g %g %g\n",pp.x,pp.y,pp.z); fprintf(fp,"vt %g %g\n",1-pp.ta,pp.c/ntxt); -// if(isnan(pp.u)) fprintf(fp,"vn 0 0 0\n"); +// if(mgl_isnan(pp.u)) fprintf(fp,"vn 0 0 0\n"); // else fprintf(fp,"vn %g %g %g\n",pp.u,pp.v,pp.w); } // primitive definition in groups @@ -379,7 +379,7 @@ void mgl_write_xyz(HMGL gr, const char *fname,const char *descr) fprintf(fp,"# List of Vertices, with (x,y,z) coordinates.\n"); for(i=0;iGetPntNum();i++) { - mglPnt pp = gr->GetPnt(i); + const mglPnt &pp = gr->GetPnt(i); fprintf(fp,"%g %g %g\n",pp.x,pp.y,pp.z); } fclose(fp); @@ -395,7 +395,7 @@ void mgl_write_xyz(HMGL gr, const char *fname,const char *descr) fprintf(ff,"# Indices of vertices to connect for faces\n"); for(i=0;iGetPrmNum();i++) { - const mglPrim q=gr->GetPrm(i); + const mglPrim &q=gr->GetPrm(i); if(q.type==1) fprintf(fp,"%ld %ld\n",q.n1+1,q.n2+1); if(q.type==2) fprintf(ff,"%ld %ld %ld\n",q.n1+1,q.n2+1,q.n3+1); if(q.type==3) fprintf(ff,"%ld %ld %ld\n%ld %ld %ld\n",q.n1+1,q.n2+1,q.n3+1,q.n4+1,q.n2+1,q.n3+1); @@ -412,7 +412,7 @@ void mgl_write_off(HMGL gr, const char *fname,const char *descr, int colored) register long i,nf=0; for(i=0;iGetPrmNum();i++) // find number of faces { - const mglPrim q=gr->GetPrm(i); + const mglPrim &q=gr->GetPrm(i); if(q.type==2 || q.type==3) nf++; } if(nf<=0) return; // nothing to do @@ -427,7 +427,7 @@ void mgl_write_off(HMGL gr, const char *fname,const char *descr, int colored) fprintf(fp,"%ld %ld 0\n",gr->GetPntNum(), nf); for(i=0;iGetPntNum();i++) { - mglPnt pp = gr->GetPnt(i); + const mglPnt &pp = gr->GetPnt(i); if(colored) fprintf(fp,"%g %g %g %g %g %g %g\n", pp.x, pp.y, pp.z, pp.r, pp.g, pp.b, pp.a); else fprintf(fp,"%g %g %g\n", pp.x, pp.y, pp.z); @@ -754,7 +754,7 @@ void mglCanvas::WriteXGL(const char *fname,const char *descr) fprintf(fp,"\n%g, %g, %g\n",AmbBr, AmbBr, AmbBr); register unsigned long i,j; if(get(MGL_ENABLE_LIGHT)) for(i=0;i<10;i++) - if(light[i].n && isnan(light[i].r.x)) + if(light[i].n && mgl_isnan(light[i].r.x)) { fprintf(fp, "\n%g, %g, %g\n", light[i].d.x, light[i].d.y, light[i].d.z); fprintf(fp, "%g, %g, %g\n\n", light[i].c.r, light[i].c.g, light[i].c.b); diff --git a/src/fit.cpp b/src/fit.cpp index a2c08c3..f9f541b 100644 --- a/src/fit.cpp +++ b/src/fit.cpp @@ -18,9 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include -#include "mgl/fit.h" -#include "mgl/eval.h" -#include "mgl/data.h" +#include "mgl2/fit.h" +#include "mgl2/eval.h" +#include "mgl2/data.h" #if MGL_HAVE_GSL #include diff --git a/src/font.cpp b/src/font.cpp index d9d996e..d20e14b 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -29,8 +29,8 @@ #include #endif -#include "mgl/base.h" -#include "mgl/font.h" +#include "mgl2/base.h" +#include "mgl2/font.h" //----------------------------------------------------------------------------- extern unsigned mgl_numg, mgl_cur; extern float mgl_fact; diff --git a/src/opengl.cpp b/src/opengl.cpp index d6c7e92..301b9a4 100644 --- a/src/opengl.cpp +++ b/src/opengl.cpp @@ -6,7 +6,7 @@ #else #include #endif -#include "mgl/opengl.h" +#include "mgl2/opengl.h" #include //----------------------------------------------------------------------------- /// Create mglGraph object in OpenGL mode. @@ -83,7 +83,7 @@ void mglCanvasGL::AddLight(int n,mglPoint r,mglPoint d,char cc, float br,float / GLenum lght[8] = {GL_LIGHT0,GL_LIGHT1,GL_LIGHT2,GL_LIGHT3,GL_LIGHT4, GL_LIGHT5,GL_LIGHT6,GL_LIGHT7}; float amb[4], pos[4],dif[4],dir[4]; - bool inf = isnan(r.x); + bool inf = mgl_isnan(r.x); if(n<0 || n>7) { SetWarn(mglWarnLId); return; } if(c.Valid()) { diff --git a/src/other.cpp b/src/other.cpp index f98dd11..8725be3 100644 --- a/src/other.cpp +++ b/src/other.cpp @@ -17,11 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "mgl/other.h" -#include "mgl/surf.h" -#include "mgl/cont.h" -#include "mgl/eval.h" -#include "mgl/data.h" +#include "mgl2/other.h" +#include "mgl2/surf.h" +#include "mgl2/cont.h" +#include "mgl2/eval.h" +#include "mgl2/data.h" #include //----------------------------------------------------------------------------- // @@ -31,7 +31,7 @@ void mgl_dens_x(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) { register long i,j,k,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); - if(isnan(sv)) sv = gr->GetOrgX('x'); + if(mgl_isnan(sv)) sv = gr->GetOrgX('x'); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"DensX"); return; } if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"DensX"); return; } mglData xx,yy,zz,aa; @@ -59,7 +59,7 @@ void mgl_dens_x(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) void mgl_dens_y(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) { register long i,j,k,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); - if(isnan(sv)) sv = gr->GetOrgX('x'); + if(mgl_isnan(sv)) sv = gr->GetOrgX('x'); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"DensY"); return; } if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"DensY"); return; } mglData xx,yy,zz,aa; @@ -87,7 +87,7 @@ void mgl_dens_y(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) void mgl_dens_z(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) { register long i,j,k,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); - if(isnan(sv)) sv = gr->GetOrgX('x'); + if(mgl_isnan(sv)) sv = gr->GetOrgX('x'); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"DensZ"); return; } if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"DensZ"); return; } mglData xx,yy,zz,aa; @@ -136,7 +136,7 @@ void mgl_cont_gen(HMGL gr, float val, HCDT a, HCDT x, HCDT y, HCDT z, float c, i void mgl_cont_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const char *opt) { register long i,j,k,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); - if(isnan(sv)) sv = gr->GetOrgX('x'); + if(mgl_isnan(sv)) sv = gr->GetOrgX('x'); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContX"); return; } if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContX"); return; } gr->SaveState(opt); @@ -174,7 +174,7 @@ void mgl_cont_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const ch void mgl_cont_y_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const char *opt) { register long i,j,k,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); - if(isnan(sv)) sv = gr->GetOrgX('x'); + if(mgl_isnan(sv)) sv = gr->GetOrgX('x'); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContY"); return; } if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContY"); return; } gr->SaveState(opt); @@ -212,7 +212,7 @@ void mgl_cont_y_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const ch void mgl_cont_z_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const char *opt) { register long i,j,k,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); - if(isnan(sv)) sv = gr->GetOrgX('x'); + if(mgl_isnan(sv)) sv = gr->GetOrgX('x'); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContZ"); return; } if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContZ"); return; } gr->SaveState(opt); @@ -249,7 +249,7 @@ void mgl_cont_z_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const ch void mgl_cont_x(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) { float r = gr->SaveState(opt); - long Num = (isnan(r) || r<=0) ? 7:long(r+0.5); + long Num = (mgl_isnan(r) || r<=0) ? 7:long(r+0.5); mglData v(Num); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(Num+1); mgl_cont_x_val(gr,&v,a,sch,sv,0); @@ -258,7 +258,7 @@ void mgl_cont_x(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) void mgl_cont_y(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) { float r = gr->SaveState(opt); - long Num = (isnan(r) || r<=0) ? 7:long(r+0.5); + long Num = (mgl_isnan(r) || r<=0) ? 7:long(r+0.5); mglData v(Num); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(Num+1); mgl_cont_y_val(gr,&v,a,sch,sv,0); @@ -267,7 +267,7 @@ void mgl_cont_y(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) void mgl_cont_z(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) { float r = gr->SaveState(opt); - long Num = (isnan(r) || r<=0) ? 7:long(r+0.5); + long Num = (mgl_isnan(r) || r<=0) ? 7:long(r+0.5); mglData v(Num); for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i+1)/(Num+1); mgl_cont_z_val(gr,&v,a,sch,sv,0); @@ -311,7 +311,7 @@ void mgl_contf_gen(HMGL gr, float v1, float v2, HCDT a, HCDT x, HCDT y, HCDT z, void mgl_contf_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const char *opt) { register long i,j,k,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); - if(isnan(sv)) sv = gr->GetOrgX('x'); + if(mgl_isnan(sv)) sv = gr->GetOrgX('x'); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContFX"); return; } if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContFX"); return; } gr->SaveState(opt); @@ -346,7 +346,7 @@ void mgl_contf_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const c void mgl_contf_y_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const char *opt) { register long i,j,k,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); - if(isnan(sv)) sv = gr->GetOrgX('x'); + if(mgl_isnan(sv)) sv = gr->GetOrgX('x'); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContFY"); return; } if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContFY"); return; } gr->SaveState(opt); @@ -381,7 +381,7 @@ void mgl_contf_y_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const c void mgl_contf_z_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const char *opt) { register long i,j,k,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); - if(isnan(sv)) sv = gr->GetOrgX('x'); + if(mgl_isnan(sv)) sv = gr->GetOrgX('x'); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContFZ"); return; } if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContFZ"); return; } gr->SaveState(opt); @@ -415,7 +415,7 @@ void mgl_contf_z_val(HMGL gr, HCDT v, HCDT a, const char *sch, float sv, const c void mgl_contf_x(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) { float r = gr->SaveState(opt); - long Num = (isnan(r) || r<=0) ? 7:long(r+0.5); + long Num = (mgl_isnan(r) || r<=0) ? 7:long(r+0.5); mglData v(Num); v.Fill(gr->Min.c, gr->Max.c); mgl_contf_x_val(gr,&v,a,sch,sv,0); } @@ -423,7 +423,7 @@ void mgl_contf_x(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) void mgl_contf_y(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) { float r = gr->SaveState(opt); - long Num = (isnan(r) || r<=0) ? 7:long(r+0.5); + long Num = (mgl_isnan(r) || r<=0) ? 7:long(r+0.5); mglData v(Num); v.Fill(gr->Min.c, gr->Max.c); mgl_contf_y_val(gr,&v,a,sch,sv,0); } @@ -431,7 +431,7 @@ void mgl_contf_y(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) void mgl_contf_z(HMGL gr, HCDT a, const char *sch, float sv, const char *opt) { float r = gr->SaveState(opt); - long Num = (isnan(r) || r<=0) ? 7:long(r+0.5); + long Num = (mgl_isnan(r) || r<=0) ? 7:long(r+0.5); mglData v(Num); v.Fill(gr->Min.c, gr->Max.c); mgl_contf_z_val(gr,&v,a,sch,sv,0); } diff --git a/src/parser.cpp b/src/parser.cpp index 9eb01bc..7015d6c 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -21,8 +21,8 @@ #include #include //----------------------------------------------------------------------------- -#include "mgl/parser.h" -#include "mgl/canvas_cf.h" +#include "mgl2/parser.h" +#include "mgl2/canvas_cf.h" //----------------------------------------------------------------------------- #ifdef WIN32 #include diff --git a/src/pde.cpp b/src/pde.cpp index 343902d..97cdfcf 100644 --- a/src/pde.cpp +++ b/src/pde.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "mgl/data.h" +#include "mgl2/data.h" #include #define dual std::complex #define GAMMA 0.1 @@ -213,7 +213,7 @@ HMDT mgl_ray_trace(const char *ham, float x0, float y0, float z0, float px, floa k3[2] = eqs.CalcD(var,'v'); k3[5] = -eqs.CalcD(var,'z'); // ty = cy/(k2*h); k3+=k2; md->H(ty,k2); var['t'-'a']=k*dt+dt; for(i=0;i<6;i++) - { var[v[i]-'a'] = x[i]+k2[i]*dt; k3[i] += k2[i]; } + { var[v[i]-'a'] = x[i]+k3[i]*dt; k3[i] += k2[i]; } k2[0] = eqs.CalcD(var,'p'); k2[3] = -eqs.CalcD(var,'x'); k2[1] = eqs.CalcD(var,'q'); k2[4] = -eqs.CalcD(var,'y'); k2[2] = eqs.CalcD(var,'v'); k2[5] = -eqs.CalcD(var,'z'); diff --git a/src/pixel.cpp b/src/pixel.cpp index dedecde..a74e384 100644 --- a/src/pixel.cpp +++ b/src/pixel.cpp @@ -20,7 +20,7 @@ #include #include #include -#include "mgl/canvas.h" +#include "mgl2/canvas.h" //----------------------------------------------------------------------------- void mglCanvas::SetSize(int w,int h) { @@ -96,7 +96,7 @@ long mglCanvas::ProjScale(int nf, long id) { const mglPnt &p0=Pnt[id]; mglPoint pp(p0.x,p0.y,p0.z), nn(p0.u,p0.v,p0.w); - if(isnan(pp.x)) return -1; + if(mgl_isnan(pp.x)) return -1; mglPoint q=pp/(2*B.pf), p, n=nn; register float w=B1.b[0]/2, h=B1.b[4]/2, d=B1.b[8]/2, xx=B1.x-w/2, yy=B1.y-h/2; if(TernAxis&1) // usual ternary axis @@ -470,15 +470,15 @@ unsigned char* mglCanvas::col2int(const mglPnt &p,unsigned char *r) register float b0=0,b1=0,b2=0, ar,ag,ab; ar = ag = ab = AmbBr; -// if(get(MGL_ENABLE_LIGHT) && !isnan(p.u)) - if(!isnan(p.u)) +// if(get(MGL_ENABLE_LIGHT) && !mgl_isnan(p.u)) + if(!mgl_isnan(p.u)) { float d0,d1,d2,nn; register long i; for(i=0;i<10;i++) { if(!light[i].n) continue; - if(isnan(light[i].q.x)) // source at infinity + if(mgl_isnan(light[i].q.x)) // source at infinity { nn = 2*(p.u*light[i].p.x+p.v*light[i].p.y+p.w*light[i].p.z) / (p.u*p.u+p.v*p.v+p.w*p.w+1e-6); @@ -648,7 +648,7 @@ void mglCanvas::quad_draw(long k1, long k2, long k3, long k4, mglDrawReg *d) if(u*(1.f-u)<0.f || v*(1.f-v)<0.f) continue; // second root bad } p = p1+d1*u+d2*v+d3*(u*v); - if(isnan(p.u) && !isnan(p.v)) + if(mgl_isnan(p.u) && !mgl_isnan(p.v)) { p.u = nr.x; p.v = nr.y; p.w = nr.z; } pnt_plot(i,j,p.z,col2int(p,r)); } @@ -698,7 +698,7 @@ void mglCanvas::trig_draw(long k1, long k2, long k3, bool anorm, mglDrawReg *d) if(Quality&2) // slow but accurate { p = p1+d1*u+d2*v; - if(isnan(p.u) && !isnan(p.v) && anorm) + if(mgl_isnan(p.u) && !mgl_isnan(p.v) && anorm) { p.u = nr.x; p.v = nr.y; p.w = nr.z; } pnt_plot(i,j,p.z,col2int(p,r)); } diff --git a/src/plot.cpp b/src/plot.cpp index 3089778..b9bfd24 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "mgl/plot.h" -#include "mgl/eval.h" -#include "mgl/data.h" +#include "mgl2/plot.h" +#include "mgl2/eval.h" +#include "mgl2/data.h" #include //----------------------------------------------------------------------------- // @@ -30,7 +30,7 @@ void mgl_fplot(HMGL gr, const char *eqY, const char *pen, const char *opt) { if(eqY==0 || eqY[0]==0) return; // nothing to plot float r = gr->SaveState(opt); - long n = (isnan(r) || r<=0) ? 100:long(r+0.5); + long n = (mgl_isnan(r) || r<=0) ? 100:long(r+0.5); float *x = (float *)malloc(n*sizeof(float)); float *y = (float *)malloc(n*sizeof(float)); @@ -72,7 +72,7 @@ void mgl_fplot(HMGL gr, const char *eqY, const char *pen, const char *opt) void mgl_fplot_xyz(HMGL gr, const char *eqX, const char *eqY, const char *eqZ, const char *pen, const char *opt) { float r = gr->SaveState(opt); - long n = (isnan(r) || r<=0) ? 100:long(r+0.5); + long n = (mgl_isnan(r) || r<=0) ? 100:long(r+0.5); float *x = (float *)malloc(n*sizeof(float)); float *y = (float *)malloc(n*sizeof(float)); @@ -148,7 +148,7 @@ void mgl_radar(HMGL gr, HCDT a, const char *pen, const char *opt) if(n<2) { gr->SetWarn(mglWarnLow,"Radar"); return; } mglData x(n+1,ny), y(n+1,ny); float m=a->Minimal(), r=gr->SaveState(opt); - if(isnan(r) || r<0) r = m<0 ? -m:0; + if(mgl_isnan(r) || r<0) r = m<0 ? -m:0; register long i,j; for(j=0;jSetPenPal(pen,&pal); gr->Reserve(2*n*m); - long s=gr->AddTexture(pen,1); +// long s=gr->AddTexture(pen,1); for(j=0;jNextColor(pal); @@ -514,7 +514,7 @@ void mgl_area_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char *opt) bool wire = pen && strchr(pen,'#'); gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); - long s=gr->AddTexture(pen,1); +// long s=gr->AddTexture(pen,1); for(j=0;jNextColor(pal); @@ -586,7 +586,7 @@ void mgl_region_xy(HMGL gr, HCDT x, HCDT y1, HCDT y2, const char *pen, const cha bool sh = pen && strchr(pen,'!'); gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); - long s=gr->AddTexture(pen,1); +// long s=gr->AddTexture(pen,1); for(j=0;jNextColor(pal); @@ -1075,7 +1075,7 @@ void mgl_boxplot_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char *opt) { if(gr->Stop) { delete []d; return; } register long mm,k; - for(mm=j=0;jv(i,j))) + for(mm=j=0;jv(i,j))) { d[mm]=y->v(i,j); mm++; } if(m==0) { b[i]=NAN; break; } qsort(d, mm, sizeof(float), mgl_cmp_flt); @@ -1614,7 +1614,7 @@ void mgl_tape_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, const char * if(n<2) { gr->SetWarn(mglWarnLow,"Tape"); return; } static int cgid=1; gr->StartGroup("Tape",cgid++); float ll, rr = gr->SaveState(opt); - if(rr==0 || isnan(rr)) rr = mgl_norm(gr->Max-gr->Min)*gr->BarWidth/25; + if(rr==0 || mgl_isnan(rr)) rr = mgl_norm(gr->Max-gr->Min)*gr->BarWidth/25; m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); m = z->GetNy() > m ? z->GetNy() : m; gr->SetPenPal(pen,&pal); gr->Reserve(4*n*m); mglPoint p1,p2,q1,q2,l,nn,qn=mglPoint(NAN,NAN); diff --git a/src/prc.cpp b/src/prc.cpp index 4e93b10..3074d10 100644 --- a/src/prc.cpp +++ b/src/prc.cpp @@ -20,8 +20,8 @@ #include #include #include -#include "mgl/canvas.h" -#include "mgl/canvas_cf.h" +#include "mgl2/canvas.h" +#include "mgl2/canvas_cf.h" #include "oPRCFile.h" #include diff --git a/src/prim.cpp b/src/prim.cpp index 61badd0..a32494e 100644 --- a/src/prim.cpp +++ b/src/prim.cpp @@ -19,9 +19,9 @@ ***************************************************************************/ #include #include -#include "mgl/canvas.h" -#include "mgl/prim.h" -#include "mgl/data.h" +#include "mgl2/canvas.h" +#include "mgl2/prim.h" +#include "mgl2/data.h" //----------------------------------------------------------------------------- // // Mark & Curve series @@ -51,7 +51,7 @@ void mgl_ball_(uintptr_t *gr, mreal *x,mreal *y,mreal *z) void mgl_line(HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2, const char *pen,int n) { static int cgid=1; gr->StartGroup("Line",cgid++); - if(isnan(z1) || isnan(z2)) z1=z2=gr->Min.z; + if(mgl_isnan(z1) || mgl_isnan(z2)) z1=z2=gr->Min.z; mglPoint p1(x1,y1,z1), p2(x2,y2,z2), p=p1,nn=mglPoint(NAN); gr->SetPenPal(pen); n = (n<2) ? 2 : n; @@ -139,8 +139,8 @@ void mgl_face(HMGL gr, float x0, float y0, float z0, float x1, float y1, float z gr->SetPenPal(stl,&pal); float c1,c2,c3,c4,zz=(gr->Min.z+gr->Max.z)/2; c1=c2=c3=c4=gr->CDef; - if(isnan(z0)) z0 = zz; if(isnan(z1)) z1 = zz; - if(isnan(z2)) z2 = zz; if(isnan(z3)) z3 = zz; + if(mgl_isnan(z0)) z0 = zz; if(mgl_isnan(z1)) z1 = zz; + if(mgl_isnan(z2)) z2 = zz; if(mgl_isnan(z3)) z3 = zz; mglPoint p1(x0,y0,z0), p2(x1,y1,z1), p3(x2,y2,z2), p4(x3,y3,z3); if(gr->GetNumPal(pal)>=4) { c2=gr->NextColor(pal); c3=gr->NextColor(pal); c4=gr->NextColor(pal); } @@ -714,7 +714,7 @@ void mgl_labelw_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const wchar_t *text, const if(x->GetNx()!=n || z->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Label"); return; } if(n<2) { gr->SetWarn(mglWarnLow,"Label"); return; } - float size=gr->SaveState(opt); if(isnan(size)) size=-0.7; + float size=gr->SaveState(opt); if(mgl_isnan(size)) size=-0.7; static int cgid=1; gr->StartGroup("Label",cgid++); m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); m = z->GetNy() > m ? z->GetNy() : m; diff --git a/src/surf.cpp b/src/surf.cpp index 051907e..c4e83a9 100644 --- a/src/surf.cpp +++ b/src/surf.cpp @@ -17,10 +17,10 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "mgl/define.h" -#include "mgl/surf.h" -#include "mgl/data.h" -#include "mgl/eval.h" +#include "mgl2/define.h" +#include "mgl2/surf.h" +#include "mgl2/data.h" +#include "mgl2/eval.h" //----------------------------------------------------------------------------- void mgl_mesh_plot(mglBase *gr, long *pos, long n, long m, int how) { @@ -47,7 +47,7 @@ void mgl_fsurf(HMGL gr, const char *eqZ, const char *sch, const char *opt) { // TODO: Add strong function variation analisys ??? if(eqZ==0 || eqZ[0]==0) return; // nothing to plot float r = gr->SaveState(opt); - long n = (isnan(r) || r<=0) ? 100:long(r+0.5); + long n = (mgl_isnan(r) || r<=0) ? 100:long(r+0.5); mglData z(n,n); mglFormula *eq = new mglFormula(eqZ); register int i,j; @@ -65,7 +65,7 @@ void mgl_fsurf_xyz(HMGL gr, const char *eqX, const char *eqY, const char *eqZ, c { // TODO: Add strong function variation analisys ??? if(eqZ==0 || eqZ[0]==0) return; // nothing to plot float r = gr->SaveState(opt); - long n = (isnan(r) || r<=0) ? 100:long(r+0.5); + long n = (mgl_isnan(r) || r<=0) ? 100:long(r+0.5); mglData x(n,n), y(n,n), z(n,n); if(n<=0) n=100; mglFormula *ex, *ey, *ez; @@ -434,7 +434,7 @@ void mgl_dens_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *o if(gr->Stop) { delete []pos; return; } p = mglPoint(GetX(x,i,j,k).x, GetY(y,i,j,k).x, zVal); zz = z->v(i,j,k); c = gr->GetC(ss,zz); - if(isnan(zz)) p.x = NAN; + if(mgl_isnan(zz)) p.x = NAN; pos[i+n*j] = gr->AddPnt(p,c,s); } mgl_surf_plot(gr,pos,n,m); diff --git a/src/tex_table.cpp b/src/tex_table.cpp index 190db63..03c6560 100644 --- a/src/tex_table.cpp +++ b/src/tex_table.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "mgl/font.h" +#include "mgl2/font.h" /// Table of LaTeX symbols and its UTF8 codes. This array MUST BE sorted!!! mglTeXsymb mgl_tex_symb[] = { diff --git a/src/vect.cpp b/src/vect.cpp index 70c387f..6dd2462 100644 --- a/src/vect.cpp +++ b/src/vect.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "mgl/vect.h" -#include "mgl/eval.h" -#include "mgl/data.h" +#include "mgl2/vect.h" +#include "mgl2/eval.h" +#include "mgl2/data.h" #include //----------------------------------------------------------------------------- // @@ -32,7 +32,7 @@ void mgl_traj_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, co if(n<2) { gr->SetWarn(mglWarnLow,"Traj"); return; } if(n!=x->GetNx() || z->GetNx()!=n || y->GetNx()!=n || ay->GetNx()!=n || az->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Traj"); return; } - float len=gr->SaveState(opt); if(isnan(len)) len = 0; + float len=gr->SaveState(opt); if(mgl_isnan(len)) len = 0; static int cgid=1; gr->StartGroup("Traj",cgid++); register long i, j; @@ -198,7 +198,7 @@ void mgl_vect_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, co bool both = x->GetNx()*x->GetNy()*x->GetNz()==n*m*l && y->GetNx()*y->GetNy()*y->GetNz()==n*m*l && z->GetNx()*z->GetNy()*z->GetNz()==n*m*l; if(!(both || (x->GetNx()==n && y->GetNx()==m && z->GetNx()==l))) { gr->SetWarn(mglWarnDim,"Vect"); return; } - + gr->SaveState(opt); static int cgid=1; gr->StartGroup("Vect3",cgid++); bool dot = sch && strchr(sch,'.'); @@ -343,7 +343,7 @@ void mgl_flow_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, con bool both = x->GetNx()==n && y->GetNx()==n && x->GetNy()==m && y->GetNy()==m; if(!(both || (x->GetNx()==n && y->GetNx()==m))) { gr->SetWarn(mglWarnDim,"Flow"); return; } float r = gr->SaveState(opt); - long num = isnan(r)?5:long(r+0.5); + long num = mgl_isnan(r)?5:long(r+0.5); static int cgid=1; gr->StartGroup("Flow",cgid++); long ss = gr->AddTexture(sch); @@ -568,7 +568,7 @@ void mgl_flow_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, co if(!(both || (x->GetNx()==n && y->GetNx()==m && z->GetNx()==l))) { gr->SetWarn(mglWarnDim,"Flow"); return; } float r = gr->SaveState(opt); - long num = isnan(r)?3:long(r+0.5); + long num = mgl_isnan(r)?3:long(r+0.5); static int cgid=1; gr->StartGroup("Flow3",cgid++); bool cnt=!(sch && strchr(sch,'#')); long ss = gr->AddTexture(sch); @@ -786,7 +786,7 @@ void flowr(mglBase *gr, float zVal, float u, float v, const mglData &x, const mg mglPoint dx(1/fabs(gr->Max.x-gr->Min.x),1/fabs(gr->Max.y-gr->Min.y),1/fabs(gr->Max.z-gr->Min.z)); float dt = 0.5/(ax.nx > ax.ny ? ax.nx : ax.ny),e,f,g,ff[4],gg[4],h,s=1; - float ss = 4/mgl_ipow(gr->Max.c - gr->Min.c,2); + float ss = 4./mgl_ipow(gr->Max.c - gr->Min.c,2); if(u<0 || v<0) { dt = -dt; u = -u; v = -v; s = -1;} register long k=0,m; bool end = false; @@ -864,7 +864,7 @@ void mgl_pipe_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, flo bool both = x->GetNx()==n && y->GetNx()==n && x->GetNy()==m && y->GetNy()==m; if(!(both || (x->GetNx()==n && y->GetNx()==m))) { gr->SetWarn(mglWarnDim,"Pipe"); return; } float r = gr->SaveState(opt); - long num = isnan(r)?5:long(r+0.5); + long num = mgl_isnan(r)?5:long(r+0.5); static int cgid=1; gr->StartGroup("Pipe",cgid++); long ss = gr->AddTexture(sch); @@ -940,7 +940,7 @@ void flowr(mglBase *gr, float u, float v, float w, const mglData &x, const mglDa nn = (ax.nx > ax.ny ? ax.nx : ax.ny); nn = (nn > ax.nz ? nn : ax.nz); float dt = 0.2/nn, e,f,g,ee[4],ff[4],gg[4],h,s=1,u1,v1,w1; - float ss = 4/mgl_ipow(gr->Max.c - gr->Min.c,2); + float ss = 4./mgl_ipow(gr->Max.c - gr->Min.c,2); if(u<0 || v<0 || w<0) { dt = -dt; u = -u; v = -v; w = -w; s = -1;} @@ -1027,7 +1027,7 @@ void mgl_pipe_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, co if(!(both || (x->GetNx()==n && y->GetNx()==m && z->GetNx()==l))) { gr->SetWarn(mglWarnDim,"Pipe"); return; } float r = gr->SaveState(opt); - long num = isnan(r)?3:long(r+0.5); + long num = mgl_isnan(r)?3:long(r+0.5); static int cgid=1; gr->StartGroup("Pipe3",cgid++); if(sch && strchr(sch,'i')) r0 = -fabs(r0); diff --git a/src/volume.cpp b/src/volume.cpp index 0bce8f0..2533ff5 100644 --- a/src/volume.cpp +++ b/src/volume.cpp @@ -17,10 +17,10 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "mgl/define.h" -#include "mgl/volume.h" -#include "mgl/data.h" -#include "mgl/eval.h" +#include "mgl2/define.h" +#include "mgl2/volume.h" +#include "mgl2/data.h" +#include "mgl2/eval.h" #include //----------------------------------------------------------------------------- // @@ -334,7 +334,7 @@ void mgl_surf3_val(HMGL gr, float val, HCDT a, const char *sch, const char *opt) void mgl_surf3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long num = isnan(r)?3:long(r+0.5); + long num = mgl_isnan(r)?3:long(r+0.5); for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); @@ -345,7 +345,7 @@ void mgl_surf3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, con void mgl_surf3(HMGL gr, HCDT a, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long num = isnan(r)?3:long(r+0.5); + long num = mgl_isnan(r)?3:long(r+0.5); for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); @@ -489,7 +489,7 @@ void mgl_surf3a_val(HMGL gr, float val, HCDT a, HCDT b, const char *sch, const c void mgl_surf3a_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long num = isnan(r)?3:long(r+0.5); + long num = mgl_isnan(r)?3:long(r+0.5); if(b->GetNx()==num && b->GetNy()==1 && b->GetNz()==1) { float v,a0=gr->AlphaDef; @@ -511,7 +511,7 @@ void mgl_surf3a_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char void mgl_surf3a(HMGL gr, HCDT a, HCDT b, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long num = isnan(r)?3:long(r); + long num = mgl_isnan(r)?3:long(r); if(b->GetNx()==num && b->GetNy()==1 && b->GetNz()==1) { float v,a0=gr->AlphaDef; @@ -667,7 +667,7 @@ void mgl_surf3c_val(HMGL gr, float val, HCDT a, HCDT b, const char *sch, const c void mgl_surf3c_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long num = isnan(r)?3:long(r+0.5); + long num = mgl_isnan(r)?3:long(r+0.5); for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); @@ -678,7 +678,7 @@ void mgl_surf3c_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char void mgl_surf3c(HMGL gr, HCDT a, HCDT b, const char *sch, const char *opt) { float r = gr->SaveState(opt); - long num = isnan(r)?3:long(r+0.5); + long num = mgl_isnan(r)?3:long(r+0.5); for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); diff --git a/texinfo/CMakeLists.txt b/texinfo/CMakeLists.txt index 62e94b5..9b6fc34 100644 --- a/texinfo/CMakeLists.txt +++ b/texinfo/CMakeLists.txt @@ -3,23 +3,39 @@ # new files and destination for html docs. if(MGL_HAVE_DOC) + set(MGL_PNG alpha.png area.png aspect.png axial.png axis.png barh.png bars.png belt.png boxplot.png + box.png boxs.png candle.png chart.png cloud.png colorbar.png combined.png cones.png conta.png contd.png + contfa.png contf.png contf_xyz.png cont.png contv.png cont_xyz.png curvcoor.png cut.png dat_diff.png + dat_extra.png densa.png dens.png dens_xyz.png dew.png dots.png error.png fall.png fit.png flow.png + fog.png grad.png hist.png inplot.png label.png legend.png loglog.png map.png mark.png mesh.png mirror.png + molecule.png parser.png pde.png pipe.png plot.png primitives.png qo2d.png radar.png region.png schemes.png + several_light.png stem.png step.png stereo.png stfa.png style.png surf3a.png surf3c.png surf3.png + surfa.png surfc.png surf.png tape.png tens.png ternary.png textmark.png text.png ticks.png tile.png + tiles.png torus.png traj.png triplot.png tube.png type0.png type1.png type2.png vect.png venn.png) + +# foreach(SAMPLE ${MGL_PNG}) +# add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/png/${SAMPLE} +# COMMAND ${CMAKE_BINARY_DIR}/examples/mgl_example --kind=${SAMPLE} +# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo/png ) +# endforeach(SAMPLE) + add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/png/all.png -# COMMAND LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/mgl ${CMAKE_BINARY_DIR}/examples/mgl_example COMMAND ${CMAKE_BINARY_DIR}/examples/mgl_example COMMAND touch ${CMAKE_SOURCE_DIR}/texinfo/png/all.png -# MAIN_DEPENDENCY ${CMAKE_BINARY_DIR}/examples/mgl_example WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo/png ) - add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/small/all.png - COMMAND ${CMAKE_BINARY_DIR}/examples/mgl_example -mini - COMMAND touch ${CMAKE_SOURCE_DIR}/texinfo/small/all.png - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo/small - ) + add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/small/all.png + COMMAND ${CMAKE_BINARY_DIR}/examples/mgl_example -mini + COMMAND touch ${CMAKE_SOURCE_DIR}/texinfo/small/all.png + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo/small + ) # set_source_files_properties(${CMAKE_BINARY_DIR}/examples/mgl_example PROPERTIES GENERATED 1) # ADD_CUSTOM_TARGET(gen_all_png DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png) # ADD_DEPENDENCIES(gen_all_png mgl_example) - set(list_texi_files_en mathgl_en.texi mgl_en.texi overview_en.texi example_en.texi ex_mgl_en.texi parse_en.texi core_en.texi concept_en.texi widget_en.texi data_en.texi other_en.texi appendix_en.texi fdl.texi) - set(list_texi_files_ru mathgl_ru.texi mgl_ru.texi overview_ru.texi example_ru.texi ex_mgl_ru.texi parse_ru.texi core_ru.texi concept_ru.texi widget_ru.texi data_ru.texi other_ru.texi appendix_ru.texi fdl.texi) + set(list_texi_files_en mathgl_en.texi mgl_en.texi overview_en.texi example_en.texi ex_mgl_en.texi parse_en.texi + core_en.texi concept_en.texi widget_en.texi data_en.texi other_en.texi appendix_en.texi fdl.texi) + set(list_texi_files_ru mathgl_ru.texi mgl_ru.texi overview_ru.texi example_ru.texi ex_mgl_ru.texi parse_ru.texi + core_ru.texi concept_ru.texi widget_ru.texi data_ru.texi other_ru.texi appendix_ru.texi fdl.texi) add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/web_en.pdf COMMAND ${findtp} -I ${CMAKE_SOURCE_DIR}/texinfo/png web_en.texi @@ -30,7 +46,7 @@ if(MGL_HAVE_DOC) add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.info COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=section mathgl_en.texi -o mathgl_en - COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=node --frames -o mgl_web_en mathgl_en.texi + COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=node --frames -o doc_en mathgl_en.texi COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=no mgl_en.texi -o mgl_en.html COMMAND ${findmi} --no-validate mathgl_en.texi DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png @@ -39,6 +55,7 @@ if(MGL_HAVE_DOC) ) add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru.info COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=section mathgl_ru.texi -o mathgl_ru + COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=node --frames -o doc_ru mathgl_ru.texi COMMAND ${findth} -I=${CMAKE_SOURCE_DIR}/texinfo/png --split=no mgl_ru.texi -o mgl_ru.html COMMAND ${findmi} --no-validate mathgl_ru.texi DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png diff --git a/texinfo/Makefile.am b/texinfo/Makefile.am deleted file mode 100644 index a2eb88f..0000000 --- a/texinfo/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -SUBDIRS = png . - -CLEANFILES = mathgl_en.info mathgl_en.info-1 mathgl_en.info-2 mathgl_en.info-3 mgl_en.info \ -mathgl_ru.info mathgl_ru.info-1 mathgl_ru.info-2 mathgl_ru.info-3 mathgl_ru.info-4 mgl_ru.info - -MAKEINFOHTML = texi2html -TEXI2PDF = texi2pdf - -#AM_MAKEINFOHTMLFLAGS = --split=chapter -AM_MAKEINFOFLAGS = --no-validate - -info_TEXINFOS = mathgl_en.texi -mathgl_en_TEXINFOS = \ -overview_en.texi example_en.texi core_en.texi class_en.texi widget_en.texi \ -data_en.texi other_en.texi mgl_cmd_en.texi samples_en.texi appendix_en.texi fdl.texi - - -info_TEXINFOS += mathgl_ru.texi -mathgl_ru_TEXINFOS = \ -overview_ru.texi example_ru.texi core_ru.texi class_ru.texi widget_ru.texi \ -data_ru.texi other_ru.texi mgl_cmd_ru.texi samples_ru.texi appendix_ru.texi fdl.texi - -info_TEXINFOS += mgl_en.texi -mgl_en_TEXINFOS = \ -mgl_cmd_en.texi samples_en.texi ex_mgl_en.texi concept_en.texi fdl.texi - -info_TEXINFOS += mgl_ru.texi -mgl_ru_TEXINFOS = \ -mgl_cmd_ru.texi samples_ru.texi ex_mgl_ru.texi concept_ru.texi fdl.texi - -#mglpng=$(DESTDIR)$(docdir)/png_static - -#install-data-local: install-html install-pdf -install-data-local: -# mkdir -p $(mglpng) -# cp -r $(top_srcdir)/texinfo/png_static/*.png $(mglpng) -uninstall-local: -# rm -rf $(mglpng) - -#all-local: html pdf -all-local: html - ./filter.py diff --git a/texinfo/concept_en.texi b/texinfo/concept_en.texi index 743e1ae..d7b9bdf 100644 --- a/texinfo/concept_en.texi +++ b/texinfo/concept_en.texi @@ -284,7 +284,7 @@ Finally, a special command language MGL (see @ref{MGL scripts}) was written for The C interface is a base for many other interfaces. It contains the pure C functions for most of the methods of MathGL classes. In distinction to C++ classes, C functions must have an argument HMGL (for graphics) and/or HMDT (for data arrays), which specifies the object for drawing or manipulating (changing). So, firstly, the user has to create this object by the function @code{mgl_create_*()} and has to delete it after the use by function @code{mgl_delete_*()}. -All C functions are described in the header file @code{#include } and use variables of the following types: +All C functions are described in the header file @code{#include } and use variables of the following types: @itemize @item @code{HMGL} --- Pointer to class @code{mglGraph} (@pxref{MathGL core}). @@ -329,4 +329,4 @@ a.WritePNG("test.png") @end verbatim This becomes useful if you create many @code{mglData} objects, for example. -@end ifclear \ No newline at end of file +@end ifclear diff --git a/texinfo/core_en.texi b/texinfo/core_en.texi index 63656d5..1869640 100644 --- a/texinfo/core_en.texi +++ b/texinfo/core_en.texi @@ -7,7 +7,7 @@ This chapter contains a lot of plotting commands for 1D, 2D and 3D data. It also @end ifset @ifclear UDAV -The core of MathGL is @strong{mglGraph} class defined in @code{#include }. It contains a lot of plotting functions for 1D, 2D and 3D data. It also encapsulates parameters for axes drawing. Moreover an arbitrary coordinate transformation can be used for each axis. All plotting functions use data encapsulated in mglData class (see @ref{Data processing}) that allows to check sizes of used arrays easily. Also it have many functions for data handling: modify it by formulas, find momentums and distribution (histogram), apply operator (differentiate, integrate, transpose, Fourier and so on), change data sizes (interpolate, squeeze, crop and so on). Additional information about colors, fonts, formula parsing can be found in @ref{General concepts} and @ref{Other classes}. +The core of MathGL is @strong{mglGraph} class defined in @code{#include }. It contains a lot of plotting functions for 1D, 2D and 3D data. It also encapsulates parameters for axes drawing. Moreover an arbitrary coordinate transformation can be used for each axis. All plotting functions use data encapsulated in mglData class (see @ref{Data processing}) that allows to check sizes of used arrays easily. Also it have many functions for data handling: modify it by formulas, find momentums and distribution (histogram), apply operator (differentiate, integrate, transpose, Fourier and so on), change data sizes (interpolate, squeeze, crop and so on). Additional information about colors, fonts, formula parsing can be found in @ref{General concepts} and @ref{Other classes}. @end ifclear @menu @@ -377,12 +377,23 @@ Restore font data to default typeface. @anchor{palette} @deftypefn {MGL command} {} palette 'colors' @ifclear UDAV -@deftypefnx {Method on @code{mglGraph}} @code{void} SetPalette (@code{const char *}@var{colors}) -@deftypefnx {C function} @code{void} mgl_set_palette (@code{HMGL} gr, @code{const char *}@var{colors}) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetPalette (@code{const char *}colors) +@deftypefnx {C function} @code{void} mgl_set_palette (@code{HMGL} gr, @code{const char *}colors) @end ifclear Sets the palette as selected colors. Default value is @code{"Hbgrcmyhlnqeup"} that corresponds to colors: dark gray @samp{H}, blue @samp{b}, green @samp{g}, red @samp{r}, cyan @samp{c}, magenta @samp{m}, yellow @samp{y}, gray @samp{h}, blue-green @samp{l}, sky-blue @samp{n}, orange @samp{q}, yellow-green @samp{e}, blue-violet @samp{u}, purple @samp{p}. The palette is used mostly in 1D plots (see @ref{1D plotting}) for curves which styles are not specified. Internal color counter will be nullified by any change of palette. This includes even hidden change (for example, by @code{Box()} or @code{Axis()} functions). @end deftypefn +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} SetDefScheme (@code{const char *}sch) +@deftypefnx {C function} @code{void} mgl_set_def_sch (@code{HMGL} gr, @code{const char *}sch) +Sets the @var{sch} as default color scheme. Default value is @code{"BbcyrR"}. +@end deftypefn + +@deftypefn {C function} @code{void} mgl_set_color (@code{char} id, @code{float} r, @code{float} g, @code{float} b) +Sets RGB values for color with given @var{id}. +@end deftypefn +@end ifclear + @c ================================================================== @node Error handling, , Palette and colors, Graphics setup @subsection Error handling diff --git a/texinfo/core_ru.texi b/texinfo/core_ru.texi index bca21a5..996bd1f 100644 --- a/texinfo/core_ru.texi +++ b/texinfo/core_ru.texi @@ -7,7 +7,7 @@ @end ifset @ifclear UDAV -Основным классом MathGL является класс @strong{mglGraph}, определённый в @code{#include }. Он включает в себя множество функций для построения графиков от 1D, 2D и 3D массивов. Он также содержит функции вывода текста и построения осей координат. Есть возможность построения в произвольной системе координат, которая задается строковыми формулами. Все графические функции используют класс mglData (см. @ref{Data processing}) для хранения массивов данных. Это позволяет легко контролировать размеры, работу с памятью и производить обработку данных. Дополнительная информация о цветах, шрифтах, вычисления формул может быть найдена в @ref{General concepts} и @ref{Other classes}. +Основным классом MathGL является класс @strong{mglGraph}, определённый в @code{#include }. Он включает в себя множество функций для построения графиков от 1D, 2D и 3D массивов. Он также содержит функции вывода текста и построения осей координат. Есть возможность построения в произвольной системе координат, которая задается строковыми формулами. Все графические функции используют класс mglData (см. @ref{Data processing}) для хранения массивов данных. Это позволяет легко контролировать размеры, работу с памятью и производить обработку данных. Дополнительная информация о цветах, шрифтах, вычисления формул может быть найдена в @ref{General concepts} и @ref{Other classes}. @end ifclear @menu @@ -375,6 +375,18 @@ MGL не требует создания данного типа объекто Задает палитру как последовательность цветов. Значение по умолчанию @code{"Hbgrcmyhlnqeup"}, что соответствует цветам: темно серый @samp{H}, синий @samp{b}, зелёный @samp{g}, красный @samp{r}, голубой @samp{c}, малиновый @samp{m}, жёлтый @samp{y}, серый @samp{h}, сине-зелёный @samp{l}, небесно-голубой @samp{n}, оранжевый @samp{q}, желто-зелёный @samp{e}, сине-фиолетовый @samp{u}, фиолетовый @samp{p}. Палитра в основном используется в 1D графиках (см. @ref{1D plotting}) для кривых с неопределённым стилем линии. @end deftypefn + +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} SetDefScheme (@code{const char *}sch) +@deftypefnx {C function} @code{void} mgl_set_def_sch (@code{HMGL} gr, @code{const char *}sch) +Устанавливает @var{sch} в качестве цветовой схемы по умолчанию. Начальное значение @code{"BbcyrR"}. +@end deftypefn + +@deftypefn {C function} @code{void} mgl_set_color (@code{char} id, @code{float} r, @code{float} g, @code{float} b) +Задает RGB значения для цвета с заданным @var{id}. +@end deftypefn +@end ifclear + @c ================================================================== @node Error handling, , Palette and colors, Graphics setup @subsection Обработка ошибок diff --git a/texinfo/data_en.texi b/texinfo/data_en.texi index 55bea08..540c186 100644 --- a/texinfo/data_en.texi +++ b/texinfo/data_en.texi @@ -6,7 +6,7 @@ This chapter describe commands for allocation, resizing, loading and saving, mod @end ifset @ifclear UDAV -This chapter describe class @code{mglData} for working with data array. This class is defined in @code{#include }. The class has functions for easy and safe allocation, resizing, loading and saving, modifying of data arrays. Also it can numerically differentiate and integrate data, interpolate, fill data by formula and so on. Class supports data with dimensions up to 3 (like function of 3 variables -- x,y,z). The internal representation of numbers is float. Float type was chosen because it has smaller size in memory and usually it has enough precision in plotting purposes. You can change it by selecting option @code{--enable-double} at the library configuring (see @ref{Installation}). Data arrays are denoted by Small Caps (like @sc{dat}) if it can be (re-)created by MGL commands. +This chapter describe class @code{mglData} for working with data array. This class is defined in @code{#include }. The class has functions for easy and safe allocation, resizing, loading and saving, modifying of data arrays. Also it can numerically differentiate and integrate data, interpolate, fill data by formula and so on. Class supports data with dimensions up to 3 (like function of 3 variables -- x,y,z). The internal representation of numbers is float. Float type was chosen because it has smaller size in memory and usually it has enough precision in plotting purposes. You can change it by selecting option @code{--enable-double} at the library configuring (see @ref{Installation}). Data arrays are denoted by Small Caps (like @sc{dat}) if it can be (re-)created by MGL commands. @end ifclear @menu @@ -1185,7 +1185,7 @@ You can use arbitrary formulas of existed data arrays or constants as any argume @end ifset @ifclear UDAV -MathGL have a special class @code{mglExpr} for evaluating of formula specified by the string. This class is defined in @code{#include }. It is the fast variant of formula evaluation. At creation it will be recognized and compiled to tree-like internal code. At evaluation stage only fast calculations are performed. There is no difference between lower or upper case in formulas. If argument value lie outside the range of function definition then function returns NaN. @xref{Textual formulas}. +MathGL have a special class @code{mglExpr} for evaluating of formula specified by the string. This class is defined in @code{#include }. It is the fast variant of formula evaluation. At creation it will be recognized and compiled to tree-like internal code. At evaluation stage only fast calculations are performed. There is no difference between lower or upper case in formulas. If argument value lie outside the range of function definition then function returns NaN. @xref{Textual formulas}. @deftypefn {Constructor on @code{mglExpr}} @code{} mglExpr (@code{const char *}expr) @deftypefnx {C function} @code{HMEX} mgl_create_expr (@code{const char *}expr) diff --git a/texinfo/data_ru.texi b/texinfo/data_ru.texi index acb83af..e8ebc62 100644 --- a/texinfo/data_ru.texi +++ b/texinfo/data_ru.texi @@ -7,7 +7,7 @@ @end ifset @ifclear UDAV -В данной главе описывается класс @code{mglData} для работы с массивами данных, определённый в @code{#include }. Он содержит функции для выделения памяти и изменения размера данных, чтения данных из файла, численного дифференцирования, интегрирования, интерполяции и пр., заполнения по текстовой формуле и т.д. Класс позволяет работать с данными размерности не более 3 (как функции от трёх переменных -- x,y,z). По умолчанию внутреннее представление данных -- float, выбранный в силу меньшего размера занимаемой памяти и достаточной для построения графиков точности. Базовый тип можно сменить на этапе установки (@pxref{Installation and usage}) указав опцию @code{--enable-double}. Однако, в дальнейшем в документации будет использован тип @code{float}. Массивы которые могут быть созданы командами MGL отображаются Small Caps шрифтом (например, @sc{dat}). +В данной главе описывается класс @code{mglData} для работы с массивами данных, определённый в @code{#include }. Он содержит функции для выделения памяти и изменения размера данных, чтения данных из файла, численного дифференцирования, интегрирования, интерполяции и пр., заполнения по текстовой формуле и т.д. Класс позволяет работать с данными размерности не более 3 (как функции от трёх переменных -- x,y,z). По умолчанию внутреннее представление данных -- float, выбранный в силу меньшего размера занимаемой памяти и достаточной для построения графиков точности. Базовый тип можно сменить на этапе установки (@pxref{Installation and usage}) указав опцию @code{--enable-double}. Однако, в дальнейшем в документации будет использован тип @code{float}. Массивы которые могут быть созданы командами MGL отображаются Small Caps шрифтом (например, @sc{dat}). @end ifclear * Public variables:: @@ -1189,7 +1189,7 @@ These functions change the data in some direction like differentiations, integra @end ifset @ifclear UDAV -В MathGL есть специальный класс @code{mglExpr} для вычисления формул заданных строкой. Класс определён в @code{#include }. При создании класса происходит разбор формулы в древовидную структуру. А при вычислении только выполняется достаточно быстрый обход по дереву. В данный момент нет различия между верхним и нижним регистром. Если аргумент какой-либо функции лежит вне её области определения, то возвращается NaN. @xref{Textual formulas}. +В MathGL есть специальный класс @code{mglExpr} для вычисления формул заданных строкой. Класс определён в @code{#include }. При создании класса происходит разбор формулы в древовидную структуру. А при вычислении только выполняется достаточно быстрый обход по дереву. В данный момент нет различия между верхним и нижним регистром. Если аргумент какой-либо функции лежит вне её области определения, то возвращается NaN. @xref{Textual formulas}. @deftypefn {Constructor on @code{mglExpr}} @code{} mglExpr (@code{const char *}expr) @deftypefnx {C function} @code{HMEX} mgl_create_expr (@code{const char *}expr) diff --git a/texinfo/doc_en.texi b/texinfo/doc_en.texi new file mode 100644 index 0000000..a13c0c3 --- /dev/null +++ b/texinfo/doc_en.texi @@ -0,0 +1,134 @@ +\input texinfo +@setfilename mathgl_en.info +@set VERSION 2.0 +@settitle MathGL @value{VERSION} +@syncodeindex pg cp +@comment %**end of header + +@copying +This manual is for MathGL (version @value{VERSION}), a collection of classes and routines for scientific plotting. Please report any errors in this manual to @email{mathgl.abalakin@@gmail.org}. + +Copyright @copyright{} 2008 Alexey Balakin. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,'' +and with the Back-Cover Texts as in (a) below. A copy of the +license is included in the section entitled ``GNU Free Documentation +License.'' + +(a) The FSF's Back-Cover Text is: ``You have the freedom to +copy and modify this GNU manual. Buying copies from the FSF +supports it in developing GNU and promoting software freedom.'' +@end quotation +@end copying + +@dircategory MathGL documentation system +@direntry +* MathGL: (mathgl). The library for scientific graphics. +@end direntry + +@titlepage +@title MathGL +@subtitle for version @value{VERSION} +@author A.A. Balakin (@uref{http://mathgl.sourceforge.net/}) +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + +@contents + +@ifnottex +@node Top +@top MathGL + +This file documents the Mathematical Graphic Library (MathGL), a collection of classes and routines for scientific plotting. It corresponds to release @value{VERSION} of the library. Please report any errors in this manual to @email{mathgl.abalakin@@gmail.org}. More information about MathGL can be found at the project homepage, @uref{http://mathgl.sourceforge.net/}. + +Copyright @copyright{} 2008 Alexey A. Balakin. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,'' +and with the Back-Cover Texts as in (a) below. A copy of the +license is included in the section entitled ``GNU Free Documentation +License.'' + +(a) The FSF's Back-Cover Text is: ``You have the freedom to +copy and modify this GNU manual. Buying copies from the FSF +supports it in developing GNU and promoting software freedom.'' +@end quotation + +@end ifnottex + +@menu +* Overview:: +* Examples:: +* General concepts:: +* MathGL core:: +* Widget classes:: +* Data processing:: +* MGL scripts:: +* Other classes:: +* TeX-like symbols:: +* Copying This Manual:: +* Index:: +@end menu + +@macro fig {fname,text} +@center @image{../\fname\, 11cm, , \text\, .png} +@end macro + +@macro reklama +@end macro + +@rmacro sref {arg} +@xref{\arg\}, for sample code and picture. +@end rmacro +@macro tdref {nam} +@uref{http://mathgl.sourceforge.net/pdf_u3d/\nam\.pdf, 3D pdf} +@end macro + + +@node Overview, Examples, , Top +@include overview_en.texi + +@node Examples, General concepts, Overview, Top +@include example_en.texi + +@node General concepts, MathGL core, Examples, Top +@include concept_en.texi + +@node MathGL core, Widget classes, General concepts, Top +@include core_en.texi + +@node Widget classes, Data processing, MathGL core, Top +@include widget_en.texi + +@node Data processing, MGL scripts, Widget classes, Top +@include data_en.texi + +@node MGL scripts, Other classes, Data processing, Top +@include parse_en.texi + +@node Other classes, TeX-like symbols, MGL scripts, Top +@include other_en.texi + +@node TeX-like symbols, Copying This Manual, Other classes, Top +@appendix TeX-like symbols +@include appendix_en.texi + +@node Copying This Manual, Index, TeX-like symbols, Top +@appendix GNU Free Documentation License +@include fdl.texi + +@node Index, , Copying This Manual, Top +@unnumbered Index + +@printindex cp + +@bye diff --git a/texinfo/doc_ru.texi b/texinfo/doc_ru.texi new file mode 100644 index 0000000..28ac2e4 --- /dev/null +++ b/texinfo/doc_ru.texi @@ -0,0 +1,150 @@ +\input texinfo +@setfilename mathgl_ru.info +@c @documentlanguage ru +@documentencoding UTF-8 +@set VERSION 2.0 +@settitle MathGL @value{VERSION} +@syncodeindex pg cp +@comment %**end of header + +@copying +Это документация для MathGL (версии @value{VERSION}) -- библиотеки классов и функций для построения научной графики. Пожалуйста сообщайте о любых ошибках в этом руководстве на @email{mathgl.abalakin@@gmail.org}. + +Copyright @copyright{} 2009 Алексей Балакин. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,'' +and with the Back-Cover Texts as in (a) below. A copy of the +license is included in the section entitled ``GNU Free Documentation +License.'' + +(a) The FSF's Back-Cover Text is: ``You have the freedom to +copy and modify this GNU manual. Buying copies from the FSF +supports it in developing GNU and promoting software freedom.'' +@end quotation +@end copying + +@dircategory MathGL documentation system +@direntry +* MathGL: (mathgl). The library for scientific graphics. +@end direntry + +@titlepage +@title MathGL +@subtitle версия @value{VERSION} +@author А.А. Балакин (@uref{http://mathgl.sourceforge.net/}) +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + +@contents + +@ifnottex +@node Top +@top MathGL + +Это документация для MathGL (версии @value{VERSION}) -- библиотеки классов и функций для построения научной графики. Пожалуйста сообщайте о любых ошибках в этом руководстве на @email{mathgl.abalakin@@gmail.org}. Дополнительную информацию о MathGL можно найти на домашней странице проекта @uref{http://mathgl.sourceforge.net/}. + +Copyright @copyright{} 2009 Алексей Балакин. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,'' +and with the Back-Cover Texts as in (a) below. A copy of the +license is included in the section entitled ``GNU Free Documentation +License.'' + +(a) The FSF's Back-Cover Text is: ``You have the freedom to +copy and modify this GNU manual. Buying copies from the FSF +supports it in developing GNU and promoting software freedom.'' +@end quotation + +@end ifnottex + +@menu +* Overview:: +* Examples:: +* General concepts:: +* MathGL core:: +* Widget classes:: +* Data processing:: +* MGL scripts:: +* Other classes:: +* TeX-like symbols:: +* Copying This Manual:: +* Index:: +@end menu + +@ifhtml +@macro fig {fname,text} +@center @image{../\fname\, 11cm, , \text\, .png} +@end macro +@end ifhtml + +@ifnothtml +@iftex +@macro fig {fname,text} +@center @image{\fname\, 11cm, , \text\, .png} +@end macro +@end iftex + +@ifnottex +@macro fig {fname,text} +@c @center @image{\fname\, 11cm, , \text\, .png} +@end macro +@end ifnottex +@end ifnothtml + + +@rmacro sref {arg} +См. раздел @ref{\arg\}, для примеров кода и графика. +@end rmacro +@macro tdref {nam} +@uref{http://mathgl.sourceforge.net/pdf_u3d/\nam\.pdf, 3D pdf} +@end macro + + +@node Overview, Examples, , Top +@include overview_ru.texi + +@node Examples, General concepts, Overview, Top +@include example_ru.texi + +@node General concepts, MathGL core, Examples, Top +@include concept_ru.texi + +@node MathGL core, Widget classes, General concepts, Top +@include core_ru.texi + +@node Widget classes, Data processing, MathGL core, Top +@include widget_ru.texi + +@node Data processing, MGL scripts, Widget classes, Top +@include data_ru.texi + +@node MGL scripts, Other classes, Data processing, Top +@include parse_ru.texi + +@node Other classes, TeX-like symbols, MGL scripts, Top +@include other_ru.texi + +@node TeX-like symbols, Copying This Manual, Other classes, Top +@appendix Символы TeX +@include appendix_ru.texi + +@node Copying This Manual, Index, TeX-like symbols, Top +@appendix GNU Free Documentation License +@include fdl.texi + +@node Index, , Copying This Manual, Top +@unnumbered Индекс + +@printindex cp + +@bye diff --git a/texinfo/example_en.texi b/texinfo/example_en.texi index a3b9a41..5400d88 100644 --- a/texinfo/example_en.texi +++ b/texinfo/example_en.texi @@ -5,7 +5,7 @@ This chapter contain information about basic and advanced MathGL, hints and samp Note, that MathGL v.2.* have only 2 end-user interfaces: one for C/Fortran and similar languages which don't support classes, another one for C++/Python/Octave and similar languages which support classes. So, most of samples placed in this chapter can be run as is (after minor changes due to different syntaxes for different languages). For example, the C++ code @verbatim -#include +#include int main() { mglGraph gr; @@ -28,7 +28,7 @@ gr.WriteFrame("test.png"); @end verbatim in C will be as @verbatim -#include +#include int main() { HMGL gr = mgl_create_graph(600,400); @@ -112,7 +112,7 @@ Let me consider the aforesaid in more detail. The ``interactive'' way of drawing in MathGL consists in window creation with help of class @code{mglWindow} or @code{mglGLUT} (see @ref{Widget classes}) and the following drawing in this window. There is a corresponding code: @verbatim -#include +#include int sample(mglGraph *gr) { gr->Rotate(60,40); @@ -133,7 +133,7 @@ gcc test.cpp -lmgl-wnd -lmgl Alternatively you can create yours own class inherited from class @code{mglDraw} and re-implement the function @code{Draw()} in it: @verbatim -#include +#include class Foo : public mglDraw { public: @@ -156,7 +156,7 @@ int main(int argc,char **argv) @end verbatim Or use pure C-functions: @verbatim -#include +#include int sample(HMGL gr, void *) { mgl_rotate(gr,60,40,0); @@ -174,7 +174,7 @@ int main(int argc,char **argv) The similar code can be written for @code{mglGLUT} window (function @code{sample()} is the same): @verbatim -#include +#include int main(int argc,char **argv) { mglGLUT gr(sample,"MathGL examples"); @@ -194,7 +194,7 @@ Another way of using MathGL library is the direct writing of the picture to the The following code produces a bitmap PNG picture: @verbatim -#include +#include int main(int ,char **) { mglGraph gr; @@ -214,7 +214,7 @@ The only difference from the previous variant (using windows) is manual switchin The code for export into other formats (for example, into vector EPS file) looks the same: @verbatim -#include +#include int main(int ,char **) { mglGraph gr; @@ -249,7 +249,7 @@ First, the function creates a frame by calling @code{NewFrame()} for rotated axe Note, that such kind of animation is rather slow and not well suitable for visualization of running calculations. For the last case one can use @code{Update()} function. The most simple case for doing this is to use @code{mglDraw} class and reimplement its @code{Calc()} method. @verbatim -#include +#include class Foo : public mglDraw { mglPoint pnt; // some result of calculation @@ -310,7 +310,7 @@ Pictures with @strong{animation can be saved in file(s)} as well. You can: expor @anchor{GIF} The simplest methods is making animated GIF. There are 3 steps: (1) open GIF file by @code{StartGIF()} function; (2) create the frames by calling @code{NewFrame()} before and @code{EndFrame()} after plotting; (3) close GIF by @code{CloseGIF()} function. So the simplest code for ``running'' sinusoid will look like this: @verbatim -#include +#include int main(int ,char **) { mglGraph gr; @@ -334,7 +334,7 @@ int main(int ,char **) @anchor{MPEG} The second way is saving each frame in separate file (usually JPEG) and later make the movie from them. MathGL have special function for saving frames -- it is @code{WriteFrame()}. This function save each frame with automatic name @samp{frame0001.jpg, frame0002.jpg} and so on. Here prefix @samp{frame} is defined by @var{PlotId} variable of @code{mglGraph} class. So the similar code will look like this: @verbatim -#include +#include int main(int ,char **) { mglGraph gr; @@ -426,7 +426,7 @@ First of all you have to define the drawing function or inherit a class from @co #include #include #include -#include +#include int main(int argc,char **argv) { QApplication a(argc,argv); @@ -3423,7 +3423,7 @@ The standard way is to use Unicode encoding for the text output. But the MathGL There are 3 general ways. First, the point with @code{NAN} value as one of the coordinates will never be plotted. Second, special variables @var{CutMin}, @var{CutMax} or function @code{CutOff}() define the condition when the points should be omitted (see @ref{Cutting}). Last, you may change the transparency of a part of the plot by the help of functions @code{SurfA()}, @code{Surf3A()} (see @ref{Dual plotting}). In this last case the transparency is switched on smoothly. @item I use VisualStudio, CBuilder or some other compiler (not MinGW/gcc). How can I link the MathGL library? -In version 2.0, the recommended class @code{mglGraph} (header file @code{#include }) contains only @code{inline} functions and is acceptable for any compiler with the same binary files. However, if you plan to access low-level features (i.e. classes mglBase, mglCanvas and so on) then you have to recompile MathGL by yours compiler. +In version 2.0, the recommended class @code{mglGraph} (header file @code{#include }) contains only @code{inline} functions and is acceptable for any compiler with the same binary files. However, if you plan to access low-level features (i.e. classes mglBase, mglCanvas and so on) then you have to recompile MathGL by yours compiler. @c @strong{Finally!} Please @emph{do not} ask me Windows-specific questions. I do not use Windows. I know nothing about Visual Basic, Visual C++, CBuiled or .NET. Please find the appropriate Usenet discussion group and ask your question there. diff --git a/texinfo/example_ru.texi b/texinfo/example_ru.texi index ec8029f..8e3dfa7 100644 --- a/texinfo/example_ru.texi +++ b/texinfo/example_ru.texi @@ -5,7 +5,7 @@ This chapter contain information about basic and advanced MathGL, hints and samp Note, that MathGL v.2.* have only 2 end-user interfaces: one for C/Fortran and similar languages which don't support classes, another one for C++/Python/Octave and similar languages which support classes. So, most of samples placed in this chapter can be run as is (after minor changes due to different syntaxes for different languages). For example, the C++ code @verbatim -#include +#include int main() { mglGraph gr; @@ -28,7 +28,7 @@ gr.WriteFrame("test.png"); @end verbatim in C will be as @verbatim -#include +#include int main() { HMGL gr = mgl_create_graph(600,400); @@ -112,7 +112,7 @@ Let me consider the aforesaid in more detail. The ``interactive'' way of drawing in MathGL consists in window creation with help of class @code{mglWindow} or @code{mglGLUT} (see @ref{Widget classes}) and the following drawing in this window. There is a corresponding code: @verbatim -#include +#include int sample(mglGraph *gr) { gr->Rotate(60,40); @@ -133,7 +133,7 @@ gcc test.cpp -lmgl-wnd -lmgl Alternatively you can create yours own class inherited from class @code{mglDraw} and re-implement the function @code{Draw()} in it: @verbatim -#include +#include class Foo : public mglDraw { public: @@ -156,7 +156,7 @@ int main(int argc,char **argv) @end verbatim Or use pure C-functions: @verbatim -#include +#include int sample(HMGL gr) { mgl_rotate(gr,60,40,0); @@ -174,7 +174,7 @@ int main(int argc,char **argv) The similar code can be written for @code{mglGLUT} window (function @code{sample()} is the same): @verbatim -#include +#include int main(int argc,char **argv) { mglGLUT gr(sample,"MathGL examples"); @@ -194,7 +194,7 @@ Another way of using MathGL library is the direct writing of the picture to the The following code produces a bitmap PNG picture: @verbatim -#include +#include int main(int ,char **) { mglGraph gr; @@ -214,7 +214,7 @@ The only difference from the previous variant (using windows) is manual switchin The code for export in vector EPS file looks the same: @verbatim -#include +#include int main(int ,char **) { mglGraph gr; @@ -249,7 +249,7 @@ First, the function creates a frame @code{NewFrame()} for rotated axes and draws Note, that such kind of animation is rather slow and not well suitable for visualization of running calculations. For the last case one can use @code{Update()} function. The most simple case for doing this is to use @code{mglDraw} class and reimplement its @code{Calc()} method. @verbatim -#include +#include class Foo : public mglDraw { mglPoint pnt; // some result of calculation @@ -309,7 +309,7 @@ Pictures with @strong{animation can be saved in file(s)} as well. You can: expor The simplest methods is making animated GIF. There are 3 steps: (1) open GIF file by @code{StartGIF()} function; (2) create the frames by calling @code{NewFrame()} before and @code{EndFrame()} after plotting; (3) close GIF by @code{CloseGIF()} function. So the simplest code for ``running'' sinusoid will look like this: @verbatim -#include +#include int main(int ,char **) { mglGraph gr; @@ -332,7 +332,7 @@ int main(int ,char **) The second way is saving each frame in separate file (usually JPEG) and later make the movie from them. MathGL have special function for saving frames -- it is @code{WriteFrame()}. This function save each frame with automatic name @samp{frame0001.jpg, frame0002.jpg} and so on. Here prefix @samp{frame} is defined by @var{PlotId} variable of @code{mglGraph} class. So the similar code will look like this: @verbatim -#include +#include int main(int ,char **) { mglGraph gr; @@ -424,7 +424,7 @@ First of all you have to define the drawing function or inherit a class from @co #include #include #include -#include +#include int main(int argc,char **argv) { QApplication a(argc,argv); @@ -3421,7 +3421,7 @@ The standard way is to use Unicode encoding for the text output. But the MathGL There are 3 general ways. First, the point with @code{NAN} value as one of the coordinates will never be plotted. Second, special variables @var{CutMin}, @var{CutMax} or function @code{CutOff}() define the condition when the points should be omitted (see @ref{Cutting}). Last, you may change the transparency of a part of the plot by the help of functions @code{SurfA()}, @code{Surf3A()} (see @ref{Dual plotting}). In this last case the transparency is switched on smoothly. @item I use VisualStudio, CBuilder or some other compiler (not MinGW/gcc). How can I link the MathGL library? -In version 2.0, the recommended class @code{mglGraph} (header file @code{#include }) contains only @code{inline} functions and is acceptable for any compiler with the same binary files. However, if you plan to access low-level features (i.e. classes mglBase, mglCanvas and so on) then you have to recompile MathGL by yours compiler. +In version 2.0, the recommended class @code{mglGraph} (header file @code{#include }) contains only @code{inline} functions and is acceptable for any compiler with the same binary files. However, if you plan to access low-level features (i.e. classes mglBase, mglCanvas and so on) then you have to recompile MathGL by yours compiler. @c @strong{Finally!} Please @emph{do not} ask me Windows-specific questions. I do not use Windows. I know nothing about Visual Basic, Visual C++, CBuiled or .NET. Please find the appropriate Usenet discussion group and ask your question there. diff --git a/texinfo/mathgl_en.texi b/texinfo/mathgl_en.texi index 9df1aac..e2a7293 100644 --- a/texinfo/mathgl_en.texi +++ b/texinfo/mathgl_en.texi @@ -107,6 +107,9 @@ supports it in developing GNU and promoting software freedom.'' @uref{http://mathgl.sourceforge.net/pdf_u3d/\nam\.pdf, 3D pdf} @end macro +@macro reklama +@end macro + @node Overview, Examples, , Top @include overview_en.texi diff --git a/texinfo/mgl_en.texi b/texinfo/mgl_en.texi index 9eb4e7b..47404f5 100644 --- a/texinfo/mgl_en.texi +++ b/texinfo/mgl_en.texi @@ -102,6 +102,9 @@ supports it in developing GNU and promoting software freedom.'' @end macro @set UDAV +@macro reklama +@end macro + @c @node Overview, Examples, , Top @c @include overview_en.texi diff --git a/texinfo/other_en.texi b/texinfo/other_en.texi index 1440798..e823905 100644 --- a/texinfo/other_en.texi +++ b/texinfo/other_en.texi @@ -31,7 +31,7 @@ All plotting functions should use a pointer to @code{mglBase} class (or @code{HM MathGL tries to remember all vertexes and all primitives and plot creation stage, and to use them for making final picture by demand. Basically for making plot, you need to add vertexes by @code{AddPnt()} function, which return index for new vertex, and call one of primitive drawing function (like @code{mark_plot(), arrow_plot(), line_plot(), trig_plot(), quad_plot(), text_plot()}), using vertex indexes as argument(s). @code{AddPnt()} function use 2 float numbers for color specification. First one is positioning in textures -- integer part is texture index, fractional part is relative coordinate in the texture. Second number is like a transparency of plot (or second coordinate in the 2D texture). -I don't want to put here detailed description of @code{mglBase} class. It was rather well documented in @code{mgl/base.h} file. I just show and example of its usage on the base of circle drawing. +I don't want to put here detailed description of @code{mglBase} class. It was rather well documented in @code{mgl2/base.h} file. I just show and example of its usage on the base of circle drawing. First, we should prototype new function @code{circle()} as C function. @verbatim @@ -222,7 +222,7 @@ Note, that I use @code{inline} modifier for using the same binary code with diff So, the complete sample will be @verbatim -#include +#include //--------------------------------------------------------- #ifdef __cplusplus extern "C" { @@ -347,7 +347,7 @@ give access to all element as in single array (@code{vthr}) -- you need this onl Let me, for example define class @code{mglComplex} which will handle complex number and draw its amplitude or phase, depending on flag @var{use_abs}: @verbatim #include -#include +#include #define dual std::complex class mglComplex : public mglDataA { @@ -355,7 +355,7 @@ public: long nx; ///< number of points in 1st dimensions ('x' dimension) long ny; ///< number of points in 2nd dimensions ('y' dimension) long nz; ///< number of points in 3d dimensions ('z' dimension) - dual *a; ///< data array + dual *a; ///< data array bool use_abs; ///< flag to use abs() or arg() inline mglComplex(long xx=1,long yy=1,long zz=1) @@ -416,7 +416,7 @@ int main() @section mglColor class @cindex mglColor -Structure for working with colors. This structure is defined in @code{#include }. +Structure for working with colors. This structure is defined in @code{#include }. There are two ways to set the color in MathGL. First one is using of float values of red, green and blue channels for precise color definition. The second way is the using of character id. There are a set of characters specifying frequently used colors. Normally capital letter gives more dark color than lowercase one. @xref{Line styles}. @@ -485,7 +485,7 @@ Return inverted color. @section mglPoint class @cindex mglPoint -Structure describes point in space. This structure is defined in @code{#include } +Structure describes point in space. This structure is defined in @code{#include } @deftypecv {Parameter} mglPoint @code{float} {x, y, z, c} Point coordinates @{x,y,z@} and one extra value @var{c} used for amplitude, transparency and so on. By default all values are zero. @@ -559,7 +559,7 @@ Return true if points are different. @section mglFont class @cindex mglFont -Class for working with font: load, get metrics, parse and draw strings. This class is defined in @code{#include }. This class is accessible only from C++ (and only from GNU compilers in default binary files). +Class for working with font: load, get metrics, parse and draw strings. This class is defined in @code{#include }. This class is accessible only from C++ (and only from GNU compilers in default binary files). The class is based on loading and drawing of vector Hershey font. There are two styles of specifying of the font type and aligning: by integer parameters or by string. diff --git a/texinfo/other_ru.texi b/texinfo/other_ru.texi index 1440798..ce402ae 100644 --- a/texinfo/other_ru.texi +++ b/texinfo/other_ru.texi @@ -31,7 +31,7 @@ All plotting functions should use a pointer to @code{mglBase} class (or @code{HM MathGL tries to remember all vertexes and all primitives and plot creation stage, and to use them for making final picture by demand. Basically for making plot, you need to add vertexes by @code{AddPnt()} function, which return index for new vertex, and call one of primitive drawing function (like @code{mark_plot(), arrow_plot(), line_plot(), trig_plot(), quad_plot(), text_plot()}), using vertex indexes as argument(s). @code{AddPnt()} function use 2 float numbers for color specification. First one is positioning in textures -- integer part is texture index, fractional part is relative coordinate in the texture. Second number is like a transparency of plot (or second coordinate in the 2D texture). -I don't want to put here detailed description of @code{mglBase} class. It was rather well documented in @code{mgl/base.h} file. I just show and example of its usage on the base of circle drawing. +I don't want to put here detailed description of @code{mglBase} class. It was rather well documented in @code{mgl2/base.h} file. I just show and example of its usage on the base of circle drawing. First, we should prototype new function @code{circle()} as C function. @verbatim @@ -222,7 +222,7 @@ Note, that I use @code{inline} modifier for using the same binary code with diff So, the complete sample will be @verbatim -#include +#include //--------------------------------------------------------- #ifdef __cplusplus extern "C" { @@ -347,7 +347,7 @@ give access to all element as in single array (@code{vthr}) -- you need this onl Let me, for example define class @code{mglComplex} which will handle complex number and draw its amplitude or phase, depending on flag @var{use_abs}: @verbatim #include -#include +#include #define dual std::complex class mglComplex : public mglDataA { @@ -416,7 +416,7 @@ int main() @section mglColor class @cindex mglColor -Structure for working with colors. This structure is defined in @code{#include }. +Structure for working with colors. This structure is defined in @code{#include }. There are two ways to set the color in MathGL. First one is using of float values of red, green and blue channels for precise color definition. The second way is the using of character id. There are a set of characters specifying frequently used colors. Normally capital letter gives more dark color than lowercase one. @xref{Line styles}. @@ -485,7 +485,7 @@ Return inverted color. @section mglPoint class @cindex mglPoint -Structure describes point in space. This structure is defined in @code{#include } +Structure describes point in space. This structure is defined in @code{#include } @deftypecv {Parameter} mglPoint @code{float} {x, y, z, c} Point coordinates @{x,y,z@} and one extra value @var{c} used for amplitude, transparency and so on. By default all values are zero. @@ -559,7 +559,7 @@ Return true if points are different. @section mglFont class @cindex mglFont -Class for working with font: load, get metrics, parse and draw strings. This class is defined in @code{#include }. This class is accessible only from C++ (and only from GNU compilers in default binary files). +Class for working with font: load, get metrics, parse and draw strings. This class is defined in @code{#include }. This class is accessible only from C++ (and only from GNU compilers in default binary files). The class is based on loading and drawing of vector Hershey font. There are two styles of specifying of the font type and aligning: by integer parameters or by string. diff --git a/texinfo/overview_en.texi b/texinfo/overview_en.texi index 4d5b7cb..9c9a715 100644 --- a/texinfo/overview_en.texi +++ b/texinfo/overview_en.texi @@ -67,12 +67,9 @@ There is fast evaluation of a textual mathematical expression (@pxref{Textual fo MathGL can be installed in 4 different ways. @enumerate @item -Compile from sources. The standard script for autoconf/automake tool is included in the library. To run it, one should execute 3 commands: @code{./configure} after it @code{make} and @code{make install} with root/sudo rights. Sometimes after installation you may need to update the library list -- just execute @code{ldconfig} with root/sudo rights. Note, that if you try SVN version then you should run @code{./bootstrap} before configure. +Compile from sources. The standard script cmake build system is useded in the library. To run it, one should execute commands: @code{cmake .} twice, after it @code{make} and @code{make install} with root/sudo rights. Sometimes after installation you may need to update the library list -- just execute @code{ldconfig} with root/sudo rights. -Script @code{./configure} have several additional options which are switched off by default. They are: @code{--enable-fltk, --enable-glut, --enable-qt} for ebabling FLTK, GLUT and/or Qt windows; @code{--enable-jpeg, --enable-gif, --enable-hdf5} for enabling corresponding file formats; @code{--enable-all} for enabling all additional features. For using @code{double} as base internal data type use option @code{--enable-double}. For enabling language interfaces use @code{--enable-python, --enable-octave} or @code{--enable-langall} for all languages. The full list of options can be viewed by command @code{./configure --help}. - -@item -One can use also CMake (@uref{http://www.cmake.org/}) for building MathGL library if autoconf/automake tools are absent. For example, it is the typical situation for Windows, MacOS and/or using of non-GNU compilers. You can use WYSIWYG tools to change CMake build options. Just specify the features you need and resolve all possible conflicts -- specify the paths for header files or libraries if they are not found automatically. After it run @code{make} and @code{make install} with root/sudo rights. +There are several additional options which are switched off by default. They are: @code{enable-fltk, enable-glut, enable-qt} for ebabling FLTK, GLUT and/or Qt windows; @code{enable-jpeg, enable-gif, enable-hdf5} and so on for enabling corresponding file formats; @code{enable-all} for enabling all additional features. For using @code{double} as base internal data type use option @code{enable-double}. For enabling language interfaces use @code{enable-python, enable-octave} or @code{enable-langall} for all languages. You can use WYSIWYG tool (@code{cmake-gui}) to view all of them, or type @code{cmake -D enable-all=on -D enable-langall=on .} in command line for enabling all features. @item Use a precompiled binary. There are binaries for MinGW (platform Win32). For a precompiled variant one needs only to unpack the archive to the location of the compiler (or in any other folder and setup paths). By default, precompiled versions include the support of GSL (www.gsl.org) and PNG. So, one needs to have these libraries installed on system (it can be found, for example, at @uref{http://gnuwin32.sourceforge.net/packages.html}). diff --git a/texinfo/overview_ru.texi b/texinfo/overview_ru.texi index 5fb890b..c81c1ed 100644 --- a/texinfo/overview_ru.texi +++ b/texinfo/overview_ru.texi @@ -162,7 +162,7 @@ gr->Window(argc,argv,foo_draw,"Title",this); Есть три основных способа. Во-первых, можно вырезать точку, задав одну из ее координат равной @code{NAN}. Во-вторых, можно воспользоваться функцией @code{SetCutBox()} или @code{CutOff()} для удаления точек из некоторой области (@pxref{Cutting}). Наконец, можно сделать эти точки прозрачными (невидимыми) с помощью функций @code{SurfA()}, @code{Surf3A()} (@pxref{Dual plotting}). В последнем случае обеспечивается еще и плавность включения прозрачности. @item Я использую VisualStudio, CBuilder или другой компилятор (не MinGW/gcc). Как мне подключить библиотеку MathGL? -Начиная с версии 2.0, рекомендуемый к использованию класс mglGraph (заголовочный файл @code{#include }) содержbn только с @code{inline} функции и может использоваться с любым компилятором без перекомпиляции бинарной версии библиотеки. Однако, если Вы планируете использовать низкоуровневые возможности (т.е. классы mglBase, mglCanvas и т.д.), то Вам следует перекомпилировать библиотеку MathGL с использованием Вашего компилятора. +Начиная с версии 2.0, рекомендуемый к использованию класс mglGraph (заголовочный файл @code{#include }) содержbn только с @code{inline} функции и может использоваться с любым компилятором без перекомпиляции бинарной версии библиотеки. Однако, если Вы планируете использовать низкоуровневые возможности (т.е. классы mglBase, mglCanvas и т.д.), то Вам следует перекомпилировать библиотеку MathGL с использованием Вашего компилятора. @item Как мне собрать MathGL под Windows? Простейший путь -- использование комбинации CMake и MinGW. Также Вам может потребоваться дополнительные библиотеки, такие как GSL, PNG, JPEG и пр. Все они могут быть найдены на @url{http://gnuwin32.sourceforge.net/packages.html}. После установки всех компонент, просто запустите конфигуратор CMake и соберите MathGL командой make. @@ -171,7 +171,7 @@ gr->Window(argc,argv,foo_draw,"Title",this); Следует создать отдельный поток для обработки сообщений в окно. Кросс-платформенный путь -- использование библиотеки @code{pthread}. Обновление данных в окне можно выполнить вызовом функции @code{mglGraphFLTK::Update()}. Пример код имеет вид: @verbatim //----------------------------------------------------------------------------- -#include +#include #include mglPoint pnt; // some global variable for changable data @@ -202,7 +202,7 @@ int main (int argc, char ** argv) В случае если требуется вывести статичную картинку с текущими результатами расчетов, то достаточно передать @code{NULL} вместо функции рисования и вызывать @code{Update()} по мере необходимости для обновления графика. Такой способ подходит и для пользователей фортрана. @verbatim //----------------------------------------------------------------------------- -#include +#include //----------------------------------------------------------------------------- int sample(mglGraph *gr) { @@ -266,7 +266,7 @@ int main (int argc, char ** argv) C интерфейс является базовым для большинства других интерфейсов. Он содержит функции на чистом C для большинства методов классов MathGL. В отличие от членов-функций C++ классов, C функции в качестве аргументов должны явно иметь переменные типа HMGL (для графики) и/или HMDT (для массивов данных) для указания объекта рисования или данных. Таким образом, первым вызовом пользователя должно быть создание этих объектов с помощью функций @code{mgl_create_*()}, а последним -- их удаление с помощью функций @code{mgl_delete_*()}. -Все функции описанны в заголовочном файле @code{#include } и используют переменные для идентификаторов объектов рисования/данных следующих типов: +Все функции описанны в заголовочном файле @code{#include } и используют переменные для идентификаторов объектов рисования/данных следующих типов: @itemize @item @code{HMGL} --- Указатель на класс @code{mglGraph} (@pxref{MathGL core}). diff --git a/texinfo/parse_en.texi b/texinfo/parse_en.texi index 0ceec7e..39b9ad0 100644 --- a/texinfo/parse_en.texi +++ b/texinfo/parse_en.texi @@ -181,7 +181,7 @@ Terminate execution. @section mglParse class @cindex mglParse -Class for parsing and executing MGL script. This class is defined in @code{#include }. +Class for parsing and executing MGL script. This class is defined in @code{#include }. Class mglParse is the interpreter for MGL scripts. The main function of mglParse class is @code{Execute()}. Exactly this function parses and executes the script string-by-string. Also there are subservient functions for the finding and creation of a variable. These functions can be useful for displaying values of variables (arrays) in some external program (in window, for example). Function @code{AllowSetSize()} allows one to prevent changing the size of the picture inside the script (forbids the MGL command @code{setsize}). diff --git a/texinfo/parse_ru.texi b/texinfo/parse_ru.texi index 0ceec7e..39b9ad0 100644 --- a/texinfo/parse_ru.texi +++ b/texinfo/parse_ru.texi @@ -181,7 +181,7 @@ Terminate execution. @section mglParse class @cindex mglParse -Class for parsing and executing MGL script. This class is defined in @code{#include }. +Class for parsing and executing MGL script. This class is defined in @code{#include }. Class mglParse is the interpreter for MGL scripts. The main function of mglParse class is @code{Execute()}. Exactly this function parses and executes the script string-by-string. Also there are subservient functions for the finding and creation of a variable. These functions can be useful for displaying values of variables (arrays) in some external program (in window, for example). Function @code{AllowSetSize()} allows one to prevent changing the size of the picture inside the script (forbids the MGL command @code{setsize}). diff --git a/texinfo/toc_en.html b/texinfo/toc_en.html index 584acfd..ccac933 100644 --- a/texinfo/toc_en.html +++ b/texinfo/toc_en.html @@ -11,7 +11,7 @@ Pictures

MGL scripts

Download

-Documentation

+Documentation

Other projects


diff --git a/texinfo/web_en.texi b/texinfo/web_en.texi index 65c0915..5b6d5c5 100644 --- a/texinfo/web_en.texi +++ b/texinfo/web_en.texi @@ -123,7 +123,7 @@ a library for working in window and console modes and for easy embedding into ot a library with large and growing set of graphics. @end itemize -At this version (1.11) MathGL has more than 35000 lines of code, more than 55 general types of graphics for 1d, 2d and 3d data arrays, including special ones for chemical and statistical graphics. It can export graphics to raster and vector (EPS or SVG) formats. It has Qt, FLTK, OpenGL interfaces and can be used even from console programs. It has functions for data processing and script MGL language for simplification of data plotting. Also it has several types of transparency and smoothed lightning, vector fonts and TeX-like symbol parsing, arbitrary curvilinear coordinate system and many over useful things. It can be used from code written on C++/C/Fortran/Python/Octave and many other languages. Finally it is platform independent and free (under GPL v.2.0 license). +Now MathGL has more than 35000 lines of code, more than 55 general types of graphics for 1d, 2d and 3d data arrays, including special ones for chemical and statistical graphics. It can export graphics to raster and vector (EPS or SVG) formats. It has Qt, FLTK, OpenGL interfaces and can be used even from console programs. It has functions for data processing and script MGL language for simplification of data plotting. Also it has several types of transparency and smoothed lightning, vector fonts and TeX-like symbol parsing, arbitrary curvilinear coordinate system and many over useful things. It can be used from code written on C++/C/Fortran/Python/Octave and many other languages. Finally it is platform independent and free (under GPL v.2.0 license). There is a @uref{http://sourceforge.net/forum/?group_id=152187, forum} where you can ask a question or suggest an improvement. However the @uref{http://groups.google.com/group/mathgl, MathGL group} is preferable for quicker answer. @@ -141,7 +141,7 @@ Generally MathGL is GPL library. However, you can use LGPL license for MathGL co @strong{Latest news} @itemize -@item @emph{29 March 2012.} +@item @emph{12 April 2012.} New version (v.2.0) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. There are a lot of new features, which partially denoted @ref{News, here}. @end itemize @@ -154,7 +154,7 @@ There is detailed @ref{News, news list}. Sourceforge project page @uref{http://s @itemize @item -@strong{29 March 2012.} +@strong{12 April 2012.} New version (v.2.0) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. There are a lot of new features, which partially denoted below. @itemize @bullet @item @@ -257,117 +257,117 @@ There are samples for @ref{1D plotting, 1D arrays}, @ref{2D plotting, 2D arrays} @anchor{1D plotting} @subsection Examples of graphics for 1d arrays -@fig{plot, mathgl_en/mathgl_en_13.html#Plot-sample} -@fig{radar, mathgl_en/mathgl_en_13.html#Radar-sample} -@fig{step, mathgl_en/mathgl_en_13.html#Step-sample} -@fig{tens, mathgl_en/mathgl_en_13.html#Tens-sample} +@fig{plot, doc_en/mathgl_en_32.html#Plot-sample} +@fig{radar, doc_en/mathgl_en_33.html#Radar-sample} +@fig{step, doc_en/mathgl_en_34.html#Step-sample} +@fig{tens, doc_en/mathgl_en_35.html#Tens-sample} -@fig{area, mathgl_en/mathgl_en_13.html#Area-sample} -@fig{region, mathgl_en/mathgl_en_13.html#Region-sample} -@fig{stem, mathgl_en/mathgl_en_13.html#Stem-sample} -@fig{torus, mathgl_en/mathgl_en_13.html#Torus-sample} +@fig{area, doc_en/mathgl_en_36.html#Area-sample} +@fig{region, doc_en/mathgl_en_37.html#Region-sample} +@fig{stem, doc_en/mathgl_en_38.html#Stem-sample} +@fig{torus, doc_en/mathgl_en_51.html#Torus-sample} -@fig{bars, mathgl_en/mathgl_en_13.html#Bars-sample} -@fig{barh, mathgl_en/mathgl_en_13.html#Barh-sample} -@fig{cones, mathgl_en/mathgl_en_13.html#Cones-sample} -@fig{chart, mathgl_en/mathgl_en_13.html#Chart-sample} +@fig{bars, doc_en/mathgl_en_39.html#Bars-sample} +@fig{barh, doc_en/mathgl_en_40.html#Barh-sample} +@fig{cones, doc_en/mathgl_en_41.html#Cones-sample} +@fig{chart, doc_en/mathgl_en_42.html#Chart-sample} -@fig{boxplot, mathgl_en/mathgl_en_13.html#BoxPlot-sample} -@fig{candle, mathgl_en/mathgl_en_13.html#Candle-sample} -@fig{tube, mathgl_en/mathgl_en_13.html#Tube-sample} -@fig{tape, mathgl_en/mathgl_en_13.html#Tape-sample} +@fig{boxplot, doc_en/mathgl_en_43.html#BoxPlot-sample} +@fig{candle, doc_en/mathgl_en_44.html#Candle-sample} +@fig{tube, doc_en/mathgl_en_49.html#Tube-sample} +@fig{tape, doc_en/mathgl_en_50.html#Tape-sample} -@fig{error, mathgl_en/mathgl_en_13.html#Error-sample} -@fig{mark, mathgl_en/mathgl_en_13.html#Mark-sample} -@fig{textmark, mathgl_en/mathgl_en_13.html#TextMark-sample} -@fig{label, mathgl_en/mathgl_en_13.html#Label-sample} +@fig{error, doc_en/mathgl_en_45.html#Error-sample} +@fig{mark, doc_en/mathgl_en_46.html#Mark-sample} +@fig{textmark, doc_en/mathgl_en_47.html#TextMark-sample} +@fig{label, doc_en/mathgl_en_48.html#Label-sample} @anchor{2D plotting} @subsection Examples of graphics for 2d arrays -@fig{surf, mathgl_en/mathgl_en_14.html#Surf-sample} -@fig{surfc, mathgl_en/mathgl_en_14.html#SurfC-sample} -@fig{surfa, mathgl_en/mathgl_en_14.html#SurfA-sample} -@fig{mesh, mathgl_en/mathgl_en_14.html#Mesh-sample} +@fig{surf, doc_en/mathgl_en_53.html#Surf-sample} +@fig{surfc, doc_en/mathgl_en_54.html#SurfC-sample} +@fig{surfa, doc_en/mathgl_en_55.html#SurfA-sample} +@fig{mesh, doc_en/mathgl_en_56.html#Mesh-sample} -@fig{fall, mathgl_en/mathgl_en_14.html#Fall-sample} -@fig{belt, mathgl_en/mathgl_en_14.html#Belt-sample} -@fig{boxs, mathgl_en/mathgl_en_14.html#Boxs-sample} -@fig{axial, mathgl_en/mathgl_en_14.html#Axial-sample} +@fig{fall, doc_en/mathgl_en_57.html#Fall-sample} +@fig{belt, doc_en/mathgl_en_58.html#Belt-sample} +@fig{boxs, doc_en/mathgl_en_59.html#Boxs-sample} +@fig{axial, doc_en/mathgl_en_67.html#Axial-sample} -@fig{dens, mathgl_en/mathgl_en_14.html#Dens-sample} -@fig{tile, mathgl_en/mathgl_en_14.html#Tile-sample} -@fig{tiles, mathgl_en/mathgl_en_14.html#TileS-sample} -@fig{grad, mathgl_en/mathgl_en_14.html#Grad-sample} +@fig{dens, doc_en/mathgl_en_62.html#Dens-sample} +@fig{tile, doc_en/mathgl_en_60.html#Tile-sample} +@fig{tiles, doc_en/mathgl_en_61.html#TileS-sample} +@fig{grad, doc_en/mathgl_en_68.html#Grad-sample} -@fig{cont, mathgl_en/mathgl_en_14.html#Cont-sample} -@fig{contf, mathgl_en/mathgl_en_14.html#ContF-sample} -@fig{contd, mathgl_en/mathgl_en_14.html#ContD-sample} -@fig{contv, mathgl_en/mathgl_en_14.html#ContV-sample} +@fig{cont, doc_en/mathgl_en_63.html#Cont-sample} +@fig{contf, doc_en/mathgl_en_64.html#ContF-sample} +@fig{contd, doc_en/mathgl_en_65.html#ContD-sample} +@fig{contv, doc_en/mathgl_en_66.html#ContV-sample} @anchor{3D plotting} @subsection Examples of graphics for 3d arrays -@fig{surf3, mathgl_en/mathgl_en_15.html#Surf3-sample} -@fig{surf3c, mathgl_en/mathgl_en_15.html#Surf3C-sample} -@fig{surf3a, mathgl_en/mathgl_en_15.html#Surf3A-sample} -@fig{cloud, mathgl_en/mathgl_en_15.html#Cloud-sample} +@fig{surf3, doc_en/mathgl_en_70.html#Surf3-sample} +@fig{surf3c, doc_en/mathgl_en_71.html#Surf3C-sample} +@fig{surf3a, doc_en/mathgl_en_72.html#Surf3A-sample} +@fig{cloud, doc_en/mathgl_en_73.html#Cloud-sample} -@fig{densa, mathgl_en/mathgl_en_15.html#Dens3-sample} -@fig{conta, mathgl_en/mathgl_en_15.html#Cont3-sample} -@fig{contfa, mathgl_en/mathgl_en_15.html#ContF3-sample} -@fig{dots, mathgl_en/mathgl_en_15.html#Dots-sample} +@fig{densa, doc_en/mathgl_en_74.html#Dens3-sample} +@fig{conta, doc_en/mathgl_en_75.html#Cont3-sample} +@fig{contfa, doc_en/mathgl_en_76.html#ContF3-sample} +@fig{dots, doc_en/mathgl_en_81.html#Dots-sample} -@fig{dens_xyz, mathgl_en/mathgl_en_15.html#Dens-projection-sample} -@fig{cont_xyz, mathgl_en/mathgl_en_15.html#Cont-projection-sample} -@fig{contf_xyz, mathgl_en/mathgl_en_15.html#ContF-projection-sample} -@fig{triplot, mathgl_en/mathgl_en_15.html#TriPlot-and-QuadPlot} +@fig{dens_xyz, doc_en/mathgl_en_77.html#Dens-projection-sample} +@fig{cont_xyz, doc_en/mathgl_en_78.html#Cont-projection-sample} +@fig{contf_xyz, doc_en/mathgl_en_79.html#ContF-projection-sample} +@fig{triplot, doc_en/mathgl_en_80.html#TriPlot-and-QuadPlot} @anchor{Vector fields} @subsection Examples of graphics for vector fields -@fig{vect, mathgl_en/mathgl_en_16.html#Vect-sample} -@fig{traj, mathgl_en/mathgl_en_16.html#Tra-sjample} -@fig{flow, mathgl_en/mathgl_en_16.html#Flow-sample} -@fig{pipe, mathgl_en/mathgl_en_16.html#Pipe-sample} +@fig{vect, doc_en/mathgl_en_83.html#Vect-sample} +@fig{traj, doc_en/mathgl_en_84.html#Tra-sjample} +@fig{flow, doc_en/mathgl_en_85.html#Flow-sample} +@fig{pipe, doc_en/mathgl_en_86.html#Pipe-sample} @anchor{Extra samples} @subsection Examples of additional features -@fig{inplot, mathgl_en/mathgl_en_10.html#Subplots} -@fig{axis, mathgl_en/mathgl_en_10.html#Axis-and-ticks} -@fig{ticks, mathgl_en/mathgl_en_10.html#Axis-and-ticks} -@fig{loglog, mathgl_en/mathgl_en_10.html#Axis-and-ticks} - -@fig{curvcoor, mathgl_en/mathgl_en_10.html#Curvilinear-coordinates} -@fig{colorbar, mathgl_en/mathgl_en_10.html#Colorbars} -@fig{box, mathgl_en/mathgl_en_10.html#Bounding-box} -@fig{ternary, mathgl_en/mathgl_en_10.html#Ternary-axis} - -@fig{text, mathgl_en/mathgl_en_10.html#Text-features} -@fig{legend, mathgl_en/mathgl_en_10.html#Legend-sample} -@fig{cut, mathgl_en/mathgl_en_10.html#Cutting-sample} -@fig{alpha, mathgl_en/mathgl_en_17.html#Transparency-and-lighting} - -@fig{type0, mathgl_en/mathgl_en_17.html#Types-of-transparency} -@fig{type1, mathgl_en/mathgl_en_17.html#Types-of-transparency} -@fig{type2, mathgl_en/mathgl_en_17.html#Types-of-transparency} -@fig{fog, mathgl_en/mathgl_en_17.html#Adding-fog} - -@fig{combined, mathgl_en/mathgl_en_17.html#g_t_0060_0060Compound_0027_0027-graphics} -@fig{several_light, mathgl_en/mathgl_en_17.html#Several-light-sources} -@fig{stereo, mathgl_en/mathgl_en_17.html#Stereo-image} -@fig{primitives, mathgl_en/mathgl_en_17.html#Using-primitives} - -@fig{stfa, mathgl_en/mathgl_en_17.html#STFA-sample} -@fig{dat_diff, mathgl_en/mathgl_en_11.html#Change-data} -@fig{dat_extra, mathgl_en/mathgl_en_11.html#Change-data} -@fig{map, mathgl_en/mathgl_en_17.html#Mapping-visualization} - -@fig{hist, mathgl_en/mathgl_en_17.html#Making-histogram} -@fig{fit, mathgl_en/mathgl_en_17.html#Nonlinear-fitting-sample} -@fig{pde, mathgl_en/mathgl_en_17.html#PDE-solving-hints} -@fig{parser, mathgl_en/mathgl_en_17.html#MGL-parser-using} +@fig{inplot, doc_en/mathgl_en_17.html#Subplots} +@fig{axis, doc_en/mathgl_en_18.html#Axis-and-ticks} +@fig{ticks, doc_en/mathgl_en_18.html#Axis-and-ticks} +@fig{loglog, doc_en/mathgl_en_18.html#Axis-and-ticks} + +@fig{curvcoor, doc_en/mathgl_en_19.html#Curvilinear-coordinates} +@fig{colorbar, doc_en/mathgl_en_20.html#Colorbars} +@fig{box, doc_en/mathgl_en_21.html#Bounding-box} +@fig{ternary, doc_en/mathgl_en_22.html#Ternary-axis} + +@fig{text, doc_en/mathgl_en_23.html#Text-features} +@fig{legend, doc_en/mathgl_en_24.html#Legend-sample} +@fig{cut, doc_en/mathgl_en_25.html#Cutting-sample} +@fig{alpha, doc_en/mathgl_en_90.html#Transparency-and-lighting} + +@fig{type0, doc_en/mathgl_en_91.html#Types-of-transparency} +@fig{type1, doc_en/mathgl_en_91.html#Types-of-transparency} +@fig{type2, doc_en/mathgl_en_91.html#Types-of-transparency} +@fig{fog, doc_en/mathgl_en_92.html#Adding-fog} + +@fig{combined, doc_en/mathgl_en_89.html#g_t_0060_0060Compound_0027_0027-graphics} +@fig{several_light, doc_en/mathgl_en_93.html#Several-light-sources} +@fig{stereo, doc_en/mathgl_en_102.html#Stereo-image} +@fig{primitives, doc_en/mathgl_en_94.html#Using-primitives} + +@fig{stfa, doc_en/mathgl_en_95.html#STFA-sample} +@fig{dat_diff, doc_en/mathgl_en_29.html#Change-data} +@fig{dat_extra, doc_en/mathgl_en_29.html#Change-data} +@fig{map, doc_en/mathgl_en_96.html#Mapping-visualization} + +@fig{hist, doc_en/mathgl_en_97.html#Making-histogram} +@fig{fit, doc_en/mathgl_en_98.html#Nonlinear-fitting-sample} +@fig{pde, doc_en/mathgl_en_99.html#PDE-solving-hints} +@fig{parser, doc_en/mathgl_en_100.html#MGL-parser-using} @external @@ -410,7 +410,7 @@ Before the first using all variables must be defined with the help of commands, Command may have several set of possible arguments (for example, @code{plot ydat} and @code{plot xdat ydat}). All command arguments for a selected set must be specified. However, some arguments can have default values. These argument are printed in [], like @code{text ydat ['stl'='']} or @code{text x y 'txt' ['fnt'='' size=-1]}. At this, the record @code{[arg1 arg2 arg3 ...]} means @code{[arg1 [arg2 [arg3 ...]]]}, i.e. you can omit only tailing arguments if you agree with its default values. For example, @code{text x y 'txt' '' 1} or @code{text x y 'txt' ''} is correct, but @code{text x y 'txt' 1} is incorrect (argument @code{'fnt'} is missed). -For more details see @uref{../mathgl_en/mathgl_en_64.html#MGL-scripts, MathGL documentation} +For more details see @uref{../doc_en/mathgl_en_166.html#MGL-scripts, MathGL documentation} @external diff --git a/texinfo/widget_en.texi b/texinfo/widget_en.texi index e51f7c1..fb1c556 100644 --- a/texinfo/widget_en.texi +++ b/texinfo/widget_en.texi @@ -10,7 +10,7 @@ There are set of ``window'' classes for making a window with MathGL graphics: @code{mglWindow} and @code{mglGLUT} for whole window, @code{Fl_MathGL} and @code{QMathGL} as widgets. All these classes allow user to show, rotate, export, and change view of the plot using keyboard. Most of them (except @code{mglGLUT}) also have toolbar and menu for simplifying plot manipulation. All window classes have mostly the same set of functions. -For callback drawing you can use: @code{NULL} pointer if you'll update plot manually, global function of type @code{int draw(@code{HMGL} gr, @code{void *}p)} or @code{int draw(@code{mglGraph *}gr)}, or instance of class derived from @code{mglDraw} class. This class is defined in @code{#include } and have only 2 methods: +For callback drawing you can use: @code{NULL} pointer if you'll update plot manually, global function of type @code{int draw(@code{HMGL} gr, @code{void *}p)} or @code{int draw(@code{mglGraph *}gr)}, or instance of class derived from @code{mglDraw} class. This class is defined in @code{#include } and have only 2 methods: @verbatim class mglDraw { @@ -138,7 +138,7 @@ Gets last position of mouse click. @cindex Fl_MathGL @cindex widgets -Class is FLTK widget which display MathGL graphics (defined in @code{#include }). +Class is FLTK widget which display MathGL graphics (defined in @code{#include }). @fig{fltk, Example of FLTK window with MathGL plot.} @@ -194,7 +194,7 @@ Pointer to external phi-angle validator. @cindex QMathGL @cindex widgets -Class is Qt widget which display MathGL graphics (defined in @code{#include }). +Class is Qt widget which display MathGL graphics (defined in @code{#include }). @fig{qt, Example of Qt window with MathGL plot.} diff --git a/texinfo/widget_ru.texi b/texinfo/widget_ru.texi index 127bcc8..502b2b9 100644 --- a/texinfo/widget_ru.texi +++ b/texinfo/widget_ru.texi @@ -12,11 +12,11 @@ Есть целый набор ``оконных'' классов для создания окон с графикой MathGL: @code{mglGraphFLTK}, @code{mglGraphQT}, @code{mglGraphGLUT}. Все эти классы позволяют пользователю просмотривать, вращать, экспортировать рисунок. Большинство из них (кроме @code{mglGraphGLUT}) являются наследниками класса @code{mglGraphZB} и используют ``присоединенный'' класс для центрального виджета окна. Все оконные классы имеют схожий набор функций (@pxref{mglGraphAB class}). Ниже приведен список классов с краткими комментариями. @deftp {Class} mglGraphFLTK -Создает окно используя библиотеку FLTK. Окно имеет панель инструментов и меню для упрощения действий с графиками. ``Присоединенный'' класс элемента интерфейса -- @code{Fl_MathGL}. Класс определен в @code{#include }. +Создает окно используя библиотеку FLTK. Окно имеет панель инструментов и меню для упрощения действий с графиками. ``Присоединенный'' класс элемента интерфейса -- @code{Fl_MathGL}. Класс определен в @code{#include }. @end deftp @deftp {Class} Fl_MathGL -Класс реализует элемент интерфейса FLTK для отображения графики MathGL. Класс определен в @code{#include }. +Класс реализует элемент интерфейса FLTK для отображения графики MathGL. Класс определен в @code{#include }. @end deftp @float @@ -25,11 +25,11 @@ @end float @deftp {Class} mglGraphQT -Создает окно используя библиотеку Qt. Окно имеет панель инструментов и меню для упрощения действий с графиками. ``Присоединенный'' класс элемента интерфейса -- @code{QMathGL}. Класс определен в @code{#include }. +Создает окно используя библиотеку Qt. Окно имеет панель инструментов и меню для упрощения действий с графиками. ``Присоединенный'' класс элемента интерфейса -- @code{QMathGL}. Класс определен в @code{#include }. @end deftp @deftp {Class} QMathGL -Класс реализует элемент интерфейса Qt для отображения графики MathGL. Класс определен в @code{#include }. +Класс реализует элемент интерфейса Qt для отображения графики MathGL. Класс определен в @code{#include }. @end deftp @float @@ -38,7 +38,7 @@ @end float @deftp {Class} mglGraphGLUT -Создает окно используя библиотеку GLUT. Класс определен в @code{#include }. +Создает окно используя библиотеку GLUT. Класс определен в @code{#include }. @end deftp @float @@ -57,7 +57,7 @@ @cindex Fl_MathGL @cindex widgets -Класс реализует элемент интерфейса FLTK для отображения графики MathGL (определен в @code{#include }). +Класс реализует элемент интерфейса FLTK для отображения графики MathGL (определен в @code{#include }). @deftypemethod Fl_MathGL @code{void} set_draw (@code{mglDraw *}dr) Задает функцию рисования из класса производного от @code{mglDraw}. @@ -109,7 +109,7 @@ @cindex QMathGL @cindex widgets -Класс реализует элемент интерфейса Qt для отображения графики MathGL (определен в @code{#include }). +Класс реализует элемент интерфейса Qt для отображения графики MathGL (определен в @code{#include }). @deftypemethod QMathGL @code{void} setDraw (@code{mglDraw *}dr) Задает функцию рисования из класса производного от @code{mglDraw}. diff --git a/todo.txt b/todo.txt deleted file mode 100644 index 4317654..0000000 --- a/todo.txt +++ /dev/null @@ -1,92 +0,0 @@ -http://ubuntuforums.org/showthread.php?t=1862084 -Device 0 (VID=0502 and PID=337d) is UNKNOWN. - -============= NEW ============= - -2. Add help about cmake into the "Installation and using" -- after build system will be ready -3. Add FAQ about MPEG/GIF and PDF - -4. Check RunThr() in python - -============= FOR V.2.1 ======== - -1. MPI_Send(), MPI_Recv() -2. Use Hershey as built-in font ?!! -3. Import/Export via GIF (as 3d data) ??? -4. Read DICOM files ??? -5. Export to JavaScript (WebGL) -6. GTK and WX window/widgets -7. Labels at TriCont() - -8. Option 'absolute' for coordinates in absolute range (i.e. [0,1]) ??? -9. Save primitives for frames (not bitmap) ??? -- see MGL_USEDRWDAT -10. Enable several fonts at the same picture -11. Table(float x, float y, HCDT dat, char *xlabels, char *ylabels, char *stl) -- draw table with values (+ auto reduce font size?) -12. Parallelization of drawing (MathGL level) -- bug with primitives drawing --> pixel.cpp -13. Triangulation + GridData (for interpolation to regular grid) -14. Axis -- projection (ternary + quaternary) -15. Examples of animation, u3d, x3d, js and so on - -16. Check fontsize maximum ?!? -17. curved text (in new sample) look not so good -18. emulate fog in EPS/SVG -19. line segment losses in EPS ??? - -20. Add mglDataC for complex data -- main diff is reading/saving data -21. MGL testing system ??? -22. Export to X3D -23. Try libtcc (TinyCC) as alternative to MGL -- in mgllab??? -24. Use OI & Z for determining {x,y,z} from {xs,ys}. Try to find closest. -25. More accurate intersections in Region -26. Add flag for drawing 3d arrows instead of 2d (S,D -- cube, T -- sq.pyramid, I -- square, O -- sphere???, A,K,V -- ???) -27. s_hull for triangulation -- add define for any cerr (or exclude streams -at all) + testing -28. Add extra texture in Error -- for handling transparency of "marks" -29. Textual colors, like "{0xFF00FF}" ?!? - -============= UDAV ============= - -01. Dialog for data input ------------------------------------------------ -| [Data name |V|] | -| [x1] [x2] [func] {ADD} | -| [y1] [y2] [suf|V] {ADD} | -| [z1] [z2] [oper|V] [dir] {ADD} | -| Reuslt [ ] | -| {Cancel} {OK} | ------------------------------------------------ -Ranges can be inverted. -Remove other setting if data name is changed. - -02. Double click -> jump to string + setup dialog (optionally) -03. Dialog for InPlot(s): -{SubPlot,MultiPlot} -- enable rotate,aspect,title -{ColumnPlot} -- enable rotate,several -{StickPlot} -- enable several -{InPlot} -- enable rotate,aspect,title - -04. Group/ungroup if command in single line, separated by ':' -05. Hide plot/group by putting "#h " at beginning of line -06. Annotation of plot/group -- comment before it -09. Data change via menu/toolbar -- save to internal script => enable undo + save initial array(?) -10. Add primitives by mouse at beginning of script + change its size/position by mouse + "attraction" points -11. Drag&drop plot/group between inplots -12. Create default plot dependently of selected row/column/range in data table -13. Show plot at creation stage (if option is enabled -- can be size_t process!!!) -14. Rotate/perspective/lighting/... of primitive list (without script re-execution) - -15. QTreeWidgetItem -- ICON (if,for,once,subplot,...); Cmd text; LINE - POS in group/line. After editing/changing --> put text to editor. - -17. Setupable hot-keys ?!? -18. Insert just filename (without path) by demand - -============= UNSURE =========== - -1. Problem with \calB and so on (\calH, ...) -- they are present only in italic font :(. -2. create PWT fonts -3. \dfrac for normal size and centering (sample \big\big{\frac{1}{2}}) ??? -4. "Cut off" curves if text is printed inside it (for contour labels) ?!? -5. String variables in MGL + readstr command. -6. Pool of threads for speeding up ??? -7. Drops as mglPrim -- not accurate but smaller memory and faster -8. Text aspect ratio in OpenGL mode diff --git a/udav/args_dlg.cpp b/udav/args_dlg.cpp index 0745599..69591da 100644 --- a/udav/args_dlg.cpp +++ b/udav/args_dlg.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "args_dlg.h" extern mglParser parser; //----------------------------------------------------------------------------- diff --git a/udav/calc_dlg.cpp b/udav/calc_dlg.cpp index 446763f..000ecbe 100644 --- a/udav/calc_dlg.cpp +++ b/udav/calc_dlg.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "calc_dlg.h" extern mglParser parser; mglData mglFormulaCalc(const wchar_t *string, mglParser *arg); diff --git a/udav/dat_pnl.cpp b/udav/dat_pnl.cpp index cbc5229..7a1e1d7 100644 --- a/udav/dat_pnl.cpp +++ b/udav/dat_pnl.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include //----------------------------------------------------------------------------- #include "dat_pnl.h" #include "info_dlg.h" @@ -111,7 +111,7 @@ void DatPanel::refresh() for(i=0;id.GetVal(i,j,kz); - if(isnan(f)) s = "nan"; + if(mgl_isnan(f)) s = "nan"; else s.sprintf("%g",f); tab->item(j,i)->setText(s); } @@ -161,7 +161,7 @@ void DatPanel::putValue(int r, int c) f = s=="nan" ? NAN : s.toDouble(); if(f!=var->d.GetVal(c,r,kz)) { - if(isnan(f)) s="nan"; else s.sprintf("%g", f); + if(mgl_isnan(f)) s="nan"; else s.sprintf("%g", f); tab->item(r,c)->setText(s); } var->d.SetVal(f,c,r,kz); diff --git a/udav/info_dlg.cpp b/udav/info_dlg.cpp index 3a59066..9377b49 100644 --- a/udav/info_dlg.cpp +++ b/udav/info_dlg.cpp @@ -22,8 +22,8 @@ #include #include #include -#include "mgl/parser.h" -#include "mgl/qt.h" +#include "mgl2/parser.h" +#include "mgl2/qt.h" #include "info_dlg.h" extern mglParser parser; //----------------------------------------------------------------------------- diff --git a/udav/mem_pnl.cpp b/udav/mem_pnl.cpp index 381831f..5c1c844 100644 --- a/udav/mem_pnl.cpp +++ b/udav/mem_pnl.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include //----------------------------------------------------------------------------- #include "mem_pnl.h" #include "info_dlg.h" diff --git a/udav/newcmd_dlg.cpp b/udav/newcmd_dlg.cpp index 0547b4f..beb0787 100644 --- a/udav/newcmd_dlg.cpp +++ b/udav/newcmd_dlg.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include "newcmd_dlg.h" #include "opt_dlg.h" diff --git a/udav/open_dlg.cpp b/udav/open_dlg.cpp index cc060b8..7248ea7 100644 --- a/udav/open_dlg.cpp +++ b/udav/open_dlg.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include "open_dlg.h" int numDataOpened=0; extern mglParser parser; diff --git a/udav/plot_pnl.cpp b/udav/plot_pnl.cpp index cea2d00..651a0fb 100644 --- a/udav/plot_pnl.cpp +++ b/udav/plot_pnl.cpp @@ -33,8 +33,8 @@ #include #include -#include -#include "mgl/qt.h" +#include +#include "mgl2/qt.h" #include "plot_pnl.h" #include "anim_dlg.h" extern bool mglAutoSave; diff --git a/udav/qmglsyntax.cpp b/udav/qmglsyntax.cpp index f22329e..6d064a0 100644 --- a/udav/qmglsyntax.cpp +++ b/udav/qmglsyntax.cpp @@ -21,7 +21,7 @@ #include #include #include "qmglsyntax.h" -#include +#include mglParser parser; int mgl_cmd_cmp(const void *a, const void *b); // comment string keyword option suffix number diff --git a/udav/src.pro b/udav/src.pro deleted file mode 100644 index b1f8d91..0000000 --- a/udav/src.pro +++ /dev/null @@ -1,68 +0,0 @@ -#DEFINES += MGL_DOC_DIR=\\\"$(MGLDOCDIR)\\\" -TEMPLATE = app -CONFIG += release \ - warn_on \ - thread \ - qt -TARGET = ../bin/udav -RESOURCES += udav.qrc -SOURCES += calc_dlg.cpp \ - hint_dlg.cpp \ - find_dlg.cpp \ - textedit.cpp \ - style_dlg.cpp \ - setup_dlg.cpp \ - qmglsyntax.cpp \ - qmglcanvas.cpp \ - prop_dlg.cpp \ - opt_dlg.cpp \ - open_dlg.cpp \ - newcmd_dlg.cpp \ - main.cpp \ - info_dlg.cpp \ - files_dlg.cpp \ - args_dlg.cpp \ - anim_dlg.cpp \ - mem_pnl.cpp \ - dat_pnl.cpp \ - plot_pnl.cpp \ - help_pnl.cpp \ - text_pnl.cpp \ - udav_wnd.cpp -HEADERS += calc_dlg.h \ - hint_dlg.h \ - find_dlg.h \ - textedit.h \ - style_dlg.h \ - setup_dlg.h \ - qmglsyntax.h \ - qmglcanvas.h \ - prop_dlg.h \ - opt_dlg.h \ - open_dlg.h \ - newcmd_dlg.h \ - info_dlg.h \ - files_dlg.h \ - args_dlg.h \ - anim_dlg.h \ - mem_pnl.h \ - dat_pnl.h \ - plot_pnl.h \ - help_pnl.h \ - text_pnl.h \ - udav_wnd.h -DISTFILES += ../TODO \ - ../ChangeLog.txt \ - ../INSTALL -RC_FILE = udav.rc -INSTALLS += target data icon desc -TRANSLATIONS = udav_ru.ts -LIBS += -lmgl -lhdf5 -desc.files += ../UDAV.desktop -icon.files += udav.png -data.files += udav_ru.qm -target.path = /usr/local/bin/ -data.path = /usr/local/share/udav/ -icon.path = /usr/local/share/pixmaps/ -desc.path = /usr/local/share/applications/ -OTHER_FILES += ReadMe diff --git a/udav/style_dlg.cpp b/udav/style_dlg.cpp index af595d4..4007cef 100644 --- a/udav/style_dlg.cpp +++ b/udav/style_dlg.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include //----------------------------------------------------------------------------- #include "xpm/none.xpm" #include "xpm/mark_.xpm" diff --git a/udav/text_pnl.cpp b/udav/text_pnl.cpp index e6e6159..ca77d78 100644 --- a/udav/text_pnl.cpp +++ b/udav/text_pnl.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include //----------------------------------------------------------------------------- #include "udav_wnd.h" #include "qmglsyntax.h" diff --git a/udav/udav_wnd.cpp b/udav/udav_wnd.cpp index edefc9c..3154252 100644 --- a/udav/udav_wnd.cpp +++ b/udav/udav_wnd.cpp @@ -33,8 +33,8 @@ #include #include //----------------------------------------------------------------------------- -#include "mgl/parser.h" -#include "mgl/qt.h" +#include "mgl2/parser.h" +#include "mgl2/qt.h" #include "udav_wnd.h" #include "text_pnl.h" #include "plot_pnl.h" diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 3256cdb..271ca76 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -13,7 +13,7 @@ if(MGL_HAVE_WX) endif(MGL_HAVE_WX) if(MGL_HAVE_QT) include(${QT_USE_FILE}) - qt_wrap_cpp(mgl-qt MGL_MOC_FILES ../include/mgl/mgl_qt.h) + qt_wrap_cpp(mgl-qt MGL_MOC_FILES ../include/mgl2/qt.h) set(mgl_wnd_src ${mgl_wnd_src} qt.cpp ${MGL_MOC_FILES}) endif(MGL_HAVE_QT) diff --git a/utils/Makefile.am b/utils/Makefile.am deleted file mode 100644 index f837471..0000000 --- a/utils/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -AM_CXXFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include - -bin_PROGRAMS = mglconv -if USE_FLTK -bin_PROGRAMS += mglview -endif - -mglconv_SOURCES = mglconv.cpp -mglconv_LDADD = $(top_builddir)/src/libmgl.la - -if USE_FLTK -mglview_SOURCES = mglview.cpp -mglview_LDADD = $(top_builddir)/widgets/libmgl-wnd.la $(top_builddir)/src/libmgl.la -mglview_CXXFLAGS = $(FLTK_FLAGS) $(AM_CXXFLAGS) -endif - diff --git a/utils/mglconv.cpp b/utils/mglconv.cpp index 30768de..7e35e8b 100644 --- a/utils/mglconv.cpp +++ b/utils/mglconv.cpp @@ -21,7 +21,7 @@ #include #include #include -#include "mgl/mgl.h" +#include "mgl2/mgl.h" void mgl_error_print(const char *Message, void *par); void mgl_ask_gets(const wchar_t *quest, wchar_t *res); //----------------------------------------------------------------------------- @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) for(i=0;i #include #include -#include "mgl/window.h" -#include "mgl/parser.h" +#include "mgl2/window.h" +#include "mgl2/parser.h" //----------------------------------------------------------------------------- std::wstring str; mglParse p(true); diff --git a/widgets/CMakeLists.txt b/widgets/CMakeLists.txt index 0ee61d6..69f9653 100644 --- a/widgets/CMakeLists.txt +++ b/widgets/CMakeLists.txt @@ -1,4 +1,4 @@ -set(mgl_wnd_hdr ../include/mgl/window.h ../include/mgl/canvas_wnd.h) +set(mgl_wnd_hdr ../include/mgl2/window.h ../include/mgl2/canvas_wnd.h) set(mgl_wnd_src window.cpp) #set(mgl_wnd_src ) @@ -10,13 +10,13 @@ endif(MGL_HAVE_GSL) if(MGL_HAVE_FLTK) include_directories(${FLTK_INCLUDE_DIR}) set(mgl_wnd_src ${mgl_wnd_src} fltk.cpp) - set(mgl_wnd_hdr ${mgl_wnd_hdr} ../include/mgl/fltk.h) + set(mgl_wnd_hdr ${mgl_wnd_hdr} ../include/mgl2/fltk.h) endif(MGL_HAVE_FLTK) if(MGL_HAVE_GLUT) include_directories(${GLUT_INCLUDE_DIR}) set(mgl_glut_src glut.cpp window.cpp) - set(mgl_glut_hdr ../include/mgl/glut.h ../include/mgl/window.h) + set(mgl_glut_hdr ../include/mgl2/glut.h ../include/mgl2/window.h) add_library(mgl-glut SHARED ${mgl_glut_src} ${mgl_glut_hdr}) add_library(mgl-glut-static STATIC ${mgl_glut_src} ${mgl_glut_hdr}) @@ -42,15 +42,15 @@ endif(MGL_HAVE_GLUT) if(MGL_HAVE_WX) include(${wxWidgets_USE_FILE}) set(mgl_wnd_src ${mgl_wnd_src} wx.cpp) - set(mgl_wnd_hdr ${mgl_wnd_hdr} ../include/mgl/fltk.h) + set(mgl_wnd_hdr ${mgl_wnd_hdr} ../include/mgl2/fltk.h) endif(MGL_HAVE_WX) if(MGL_HAVE_QT) include(${QT_USE_FILE}) -# qt_wrap_cpp(mgl-wnd MGL_MOC_FILES ../include/mgl/qt.h) - qt4_wrap_cpp(MGL_MOC_FILES ../include/mgl/qt.h) +# qt_wrap_cpp(mgl-wnd MGL_MOC_FILES ../include/mgl2/qt.h) + qt4_wrap_cpp(MGL_MOC_FILES ../include/mgl2/qt.h) set(mgl_wnd_src ${mgl_wnd_src} qt.cpp ${MGL_MOC_FILES}) - set(mgl_wnd_hdr ${mgl_wnd_hdr} ../include/mgl/qt.h) + set(mgl_wnd_hdr ${mgl_wnd_hdr} ../include/mgl2/qt.h) endif(MGL_HAVE_QT) add_library(mgl-wnd SHARED ${mgl_wnd_src} ${mgl_wnd_hdr}) diff --git a/widgets/Makefile.am b/widgets/Makefile.am deleted file mode 100644 index f76b61a..0000000 --- a/widgets/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -AM_CXXFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include - -WIDGETS = -if USE_QT -WIDGETS += -DHAVE_QT -endif -if USE_FLTK -WIDGETS += -DHAVE_FLTK -endif - -lib_LTLIBRARIES = libmgl-wnd.la -libmgl_wnd_la_LDFLAGS = $(LDFLAGS) -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) -libmgl_wnd_la_LIBADD = $(top_builddir)/src/libmgl.la -libmgl_wnd_la_CPPFLAGS = $(AM_CXXFLAGS) $(WIDGETS) -libmgl_wnd_la_CXXFLAGS = $(AM_CXXFLAGS) $(WIDGETS) -libmgl_wnd_la_SOURCES = window.cpp -#libmgl_wnd_la_SOURCES = - - -if USE_FLTK -libmgl_wnd_la_LIBADD += $(FLTK_LIBS) -libmgl_wnd_la_CXXFLAGS += $(FLTK_FLAGS) -libmgl_wnd_la_SOURCES += fltk.cpp -endif - -if USE_QT -include $(top_srcdir)/config/autotroll.mk -ACLOCAL_AMFLAGS = -I $(top_srcdir)/config/ - -libmgl_wnd_la_LDFLAGS += $(QT_LDFLAGS) -libmgl_wnd_la_LIBADD += $(QT_LIBS) -libmgl_wnd_la_CPPFLAGS += $(QT_CPPFLAGS) -libmgl_wnd_la_CXXFLAGS += $(QT_CXXFLAGS) -libmgl_wnd_la_SOURCES += $(top_builddir)/include/mgl/qt.moc.cpp qt.cpp $(top_srcdir)/include/mgl/qt.h - -BUILT_SOURCES = $(top_builddir)/include/mgl/qt.moc.cpp -CLEANFILES = $(BUILT_SOURCES) -endif diff --git a/widgets/fltk.cpp b/widgets/fltk.cpp index 0543b6c..fbf2684 100644 --- a/widgets/fltk.cpp +++ b/widgets/fltk.cpp @@ -34,7 +34,7 @@ #endif #endif //----------------------------------------------------------------------------- -#include "mgl/fltk.h" +#include "mgl2/fltk.h" //----------------------------------------------------------------------------- #include "xpm/alpha_on.xpm" #include "xpm/light_on.xpm" diff --git a/widgets/glut.cpp b/widgets/glut.cpp index f4f3664..06d0d6f 100644 --- a/widgets/glut.cpp +++ b/widgets/glut.cpp @@ -39,7 +39,7 @@ #include #include -#include "mgl/glut.h" +#include "mgl2/glut.h" mglCanvasGLUT *_mgl_glwnd; void _mgl_key_up(unsigned char ch,int ,int ); diff --git a/widgets/qt.cpp b/widgets/qt.cpp index e670100..3349335 100644 --- a/widgets/qt.cpp +++ b/widgets/qt.cpp @@ -37,7 +37,7 @@ #include #include #include -#include "mgl/qt.h" +#include "mgl2/qt.h" //----------------------------------------------------------------------------- #if !defined(WIN32) && !defined(__APPLE__) #include diff --git a/widgets/window.cpp b/widgets/window.cpp index 203542a..3834775 100644 --- a/widgets/window.cpp +++ b/widgets/window.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "mgl/canvas_wnd.h" +#include "mgl2/canvas_wnd.h" //----------------------------------------------------------------------------- mglCanvasWnd::mglCanvasWnd() : mglCanvas() { -- 2.30.2